summaryrefslogtreecommitdiff
path: root/sys/arch/mvme68k/stand/bootxx/bootxx.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-08-20 00:24:44 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-08-20 00:24:44 +0000
commit7a6d5f65935ddbfe10f41b7bd049df01d06bc4f9 (patch)
tree5501c450386c16d6f61a963aac0aedb5debe81f8 /sys/arch/mvme68k/stand/bootxx/bootxx.c
parente9ebf8d17d43c4a9bca3cc91e3dcd1660a7681d2 (diff)
ansi and protos
Diffstat (limited to 'sys/arch/mvme68k/stand/bootxx/bootxx.c')
-rw-r--r--sys/arch/mvme68k/stand/bootxx/bootxx.c65
1 files changed, 31 insertions, 34 deletions
diff --git a/sys/arch/mvme68k/stand/bootxx/bootxx.c b/sys/arch/mvme68k/stand/bootxx/bootxx.c
index 54a6472e58b..57a963b4291 100644
--- a/sys/arch/mvme68k/stand/bootxx/bootxx.c
+++ b/sys/arch/mvme68k/stand/bootxx/bootxx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bootxx.c,v 1.6 2002/04/16 15:37:04 miod Exp $ */
+/* $OpenBSD: bootxx.c,v 1.7 2003/08/20 00:24:43 deraadt Exp $ */
/* $NetBSD: bootxx.c,v 1.5 1995/10/13 21:44:57 gwr Exp $ */
/*
@@ -48,6 +48,7 @@
#include "stand.h"
#include "libsa.h"
+#include "libbug.h"
/*
* Boot device is derived from ROM provided information.
@@ -70,37 +71,8 @@ daddr_t block_table[MAXBLOCKNUM] = { 0 };
extern char *version;
-
-main()
-{
- struct open_file f;
- char *addr;
- int n, error;
-
- printf("Boot: bug device: ctrl=%d, dev=%d\n",
- bugargs.ctrl_lun, bugargs.dev_lun);
- printf("\nbootxx: first level bootstrap program [%s]\n\n", version);
-
- f.f_flags = F_RAW;
- if (devopen(&f, 0, &addr)) {
- printf("bootxx: open failed\n");
- _rtt();
- }
-
- addr = (char *)LOADADDR;
- error = copyboot(&f, addr);
- f.f_dev->dv_close(&f);
- if (!error) {
- bugexec((void (*)())addr + 8);
- }
- /* copyboot had a problem... */
- _rtt();
-}
-
-int
-copyboot(fp, addr)
- struct open_file *fp;
- char *addr;
+static int
+copyboot(struct open_file *fp, char *addr)
{
int n, i, blknum;
struct exec *x;
@@ -122,8 +94,7 @@ copyboot(fp, addr)
printf("bootxx: read block # %d = %d\n", i, blknum);
#endif
if ((fp->f_dev->dv_strategy)(fp->f_devdata, F_READ,
- blknum, block_size, addr, &n))
- {
+ blknum, block_size, addr, &n)) {
printf("bootxx: read failed\n");
return -1;
}
@@ -141,3 +112,29 @@ copyboot(fp, addr)
return 0;
}
+
+main(int argc, char *argv[])
+{
+ struct open_file f;
+ char *addr;
+ int n, error;
+
+ printf("Boot: bug device: ctrl=%d, dev=%d\n",
+ bugargs.ctrl_lun, bugargs.dev_lun);
+ printf("\nbootxx: first level bootstrap program [%s]\n\n", version);
+
+ f.f_flags = F_RAW;
+ if (devopen(&f, 0, &addr)) {
+ printf("bootxx: open failed\n");
+ _rtt();
+ }
+
+ addr = (char *)LOADADDR;
+ error = copyboot(&f, addr);
+ f.f_dev->dv_close(&f);
+ if (!error) {
+ bugexec((void (*)(void))addr + 8);
+ }
+ /* copyboot had a problem... */
+ _rtt();
+}