aboutsummaryrefslogtreecommitdiff
path: root/sys/boot
diff options
context:
space:
mode:
authorJake Burkholder <jake@FreeBSD.org>2002-04-24 02:50:59 +0000
committerJake Burkholder <jake@FreeBSD.org>2002-04-24 02:50:59 +0000
commit3ff6556567528e879946022910e192a17ec80372 (patch)
tree9faa4c5fc8961f6b8f63debb2fd9bde4d5f5b853 /sys/boot
parent083d8c5bab14bb7e827ae2eeba3130a0eb4ebc1a (diff)
downloadsrc-3ff6556567528e879946022910e192a17ec80372.tar.gz
src-3ff6556567528e879946022910e192a17ec80372.zip
Add an exit function.
Notes
Notes: svn path=/head/; revision=95342
Diffstat (limited to 'sys/boot')
-rw-r--r--sys/boot/sparc64/boot1/boot1.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/sys/boot/sparc64/boot1/boot1.c b/sys/boot/sparc64/boot1/boot1.c
index 363831bc669f..f966df92c7c5 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;