diff options
author | jake <jake@FreeBSD.org> | 2002-04-24 02:50:59 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2002-04-24 02:50:59 +0000 |
commit | 40d13085f4ad7785dfe13370ebbd77152628fef9 (patch) | |
tree | 9faa4c5fc8961f6b8f63debb2fd9bde4d5f5b853 /sys | |
parent | 628ea2a252f4f4d654936788a3388758a87b2678 (diff) | |
download | FreeBSD-src-40d13085f4ad7785dfe13370ebbd77152628fef9.zip FreeBSD-src-40d13085f4ad7785dfe13370ebbd77152628fef9.tar.gz |
Add an exit function.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/boot/sparc64/boot1/boot1.c | 24 |
1 files changed, 21 insertions, 3 deletions
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; |