summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorchuck <chuck@cvs.openbsd.org>1996-05-16 02:22:00 +0000
committerchuck <chuck@cvs.openbsd.org>1996-05-16 02:22:00 +0000
commit1532b093a344b29f82ddf9f2fc0985b2d3578cb5 (patch)
treef762e5083c44fe272fd899c9d781dbb336d59655 /sys/arch
parentaeac1537ce41de0a79801e225042fa943d67a46e (diff)
add netboot stuff and cputyp stuff to bugcrt. also add bugexec().
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/mvme68k/stand/bugcrt/Makefile15
-rw-r--r--sys/arch/mvme68k/stand/bugcrt/bugcrt.c45
2 files changed, 50 insertions, 10 deletions
diff --git a/sys/arch/mvme68k/stand/bugcrt/Makefile b/sys/arch/mvme68k/stand/bugcrt/Makefile
index 4cc94059476..560f4afef4d 100644
--- a/sys/arch/mvme68k/stand/bugcrt/Makefile
+++ b/sys/arch/mvme68k/stand/bugcrt/Makefile
@@ -1,12 +1,14 @@
-# $OpenBSD: Makefile,v 1.5 1996/05/10 20:03:38 deraadt Exp $
-
-CFLAGS+=-I${.OBJDIR} -O2 -fomit-frame-pointer
+# $OpenBSD: Makefile,v 1.6 1996/05/16 02:21:58 chuck Exp $
+#
+# DO NOT OPTMIZE bugcrt (i.e. no "-O2")
+#
+CFLAGS=-I${.CURDIR}/../../include -I${.CURDIR}/../libbug -fomit-frame-pointer
OBJS=bugcrt.o
-CLEANFILES+=a.out machine
+CLEANFILES+=a.out
-all: machine ${OBJS}
+all: ${OBJS}
bugcrt.o: bugcrt.c
${CC} ${CFLAGS} -c ${.ALLSRC}
@@ -17,7 +19,4 @@ install:
lint tags:
-machine:
- rm -f machine; ln -s ${.CURDIR}/../../include machine
-
.include <bsd.prog.mk>
diff --git a/sys/arch/mvme68k/stand/bugcrt/bugcrt.c b/sys/arch/mvme68k/stand/bugcrt/bugcrt.c
index e7449e99096..2a6011cfc26 100644
--- a/sys/arch/mvme68k/stand/bugcrt/bugcrt.c
+++ b/sys/arch/mvme68k/stand/bugcrt/bugcrt.c
@@ -1,8 +1,10 @@
-/* $OpenBSD: bugcrt.c,v 1.1 1996/05/10 18:39:15 deraadt Exp $ */
+/* $OpenBSD: bugcrt.c,v 1.2 1996/05/16 02:21:59 chuck Exp $ */
#include <sys/types.h>
#include <machine/prom.h>
+#include "libbug.h"
+
struct mvmeprom_args bugargs = { 1 }; /* not in BSS */
asm (".text");
@@ -18,7 +20,10 @@ start()
register int conf_blk asm (MVMEPROM_REG_CONFBLK);
register char *arg_start asm (MVMEPROM_REG_ARGSTART);
register char *arg_end asm (MVMEPROM_REG_ARGEND);
+ register char *nbarg_start asm (MVMEPROM_REG_NBARGSTART);
+ register char *nbarg_end asm (MVMEPROM_REG_NBARGEND);
extern int edata, end;
+ struct mvmeprom_brdid *id, *mvmeprom_getbrdid();
bugargs.dev_lun = dev_lun;
bugargs.ctrl_lun = ctrl_lun;
@@ -28,14 +33,50 @@ start()
bugargs.conf_blk = conf_blk;
bugargs.arg_start = arg_start;
bugargs.arg_end = arg_end;
+ bugargs.nbarg_start = nbarg_start;
+ bugargs.nbarg_end = nbarg_end;
*arg_end = 0;
bzero(&edata, (int)&end-(int)&edata);
+ id = mvmeprom_getbrdid();
+ bugargs.cputyp = id->model;
main();
- mvmeprom_return();
+ _rtt();
/* NOTREACHED */
}
__main()
{
}
+
+
+void
+bugexec(addr)
+
+void (*addr)();
+
+{
+ register int dev_lun asm (MVMEPROM_REG_DEVLUN);
+ register int ctrl_lun asm (MVMEPROM_REG_CTRLLUN);
+ register int flags asm (MVMEPROM_REG_FLAGS);
+ register int ctrl_addr asm (MVMEPROM_REG_CTRLADDR);
+ register int entry asm (MVMEPROM_REG_ENTRY);
+ register int conf_blk asm (MVMEPROM_REG_CONFBLK);
+ register char *arg_start asm (MVMEPROM_REG_ARGSTART);
+ register char *arg_end asm (MVMEPROM_REG_ARGEND);
+
+ dev_lun = bugargs.dev_lun;
+ ctrl_lun = bugargs.ctrl_lun;
+ flags = bugargs.flags;
+ ctrl_addr = bugargs.ctrl_addr;
+ entry = bugargs.entry;
+ conf_blk = bugargs.conf_blk;
+ arg_start = bugargs.arg_start;
+ arg_end = bugargs.arg_end;
+
+ (*addr)();
+ printf("bugexec: 0x%x returned!\n", addr);
+
+ _rtt();
+}
+