From 40d13085f4ad7785dfe13370ebbd77152628fef9 Mon Sep 17 00:00:00 2001 From: jake Date: Wed, 24 Apr 2002 02:50:59 +0000 Subject: Add an exit function. --- sys/boot/sparc64/boot1/boot1.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'sys/boot') diff --git a/sys/boot/sparc64/boot1/boot1.c b/sys/boot/sparc64/boot1/boot1.c index 363831b..f966df9 100644 --- a/sys/boot/sparc64/boot1/boot1.c +++ b/sys/boot/sparc64/boot1/boot1.c @@ -52,7 +52,7 @@ static char bname[1024]; /* name of the binary to load */ static uint32_t fs_off; int main(void); -void exit(int); +static void exit(int); static void load(const char *); static ino_t lookup(const char *); static ssize_t fsread(ino_t, void *, size_t); @@ -105,8 +105,7 @@ ofw_init(int d, int d1, int d2, int d3, ofwfp_t ofwaddr) printf("Could not open boot device.\n"); } - main(); - d = d1 = d2 = d3; /* make GCC happy */ + exit(main()); } ofwh_t @@ -244,6 +243,18 @@ ofw_seek(ofwh_t devh, u_int64_t off) return (0); } +void +ofw_exit(void) +{ + ofwcell_t args[3]; + + args[0] = (ofwcell_t)"exit"; + args[1] = 0; + args[2] = 0; + + (*ofw)(args); +} + static void bcopy(const void *dst, void *src, size_t len) { @@ -316,6 +327,13 @@ main(void) } static void +exit(int code) +{ + + ofw_exit(); +} + +static void load(const char *fname) { Elf64_Ehdr eh; -- cgit v1.1