summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorchuck <chuck@cvs.openbsd.org>1996-05-16 02:25:44 +0000
committerchuck <chuck@cvs.openbsd.org>1996-05-16 02:25:44 +0000
commit043afc32eb81f007f926017a64bb1f34e8f0c068 (patch)
tree8df9edb0ed025d44e5b34dd2460dfd20e496f765 /sys/arch
parent1532b093a344b29f82ddf9f2fc0985b2d3578cb5 (diff)
reorg & cleanup. add in some stuff so we can remove libsa/promcons.c.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/mvme68k/stand/libbug/Makefile17
-rw-r--r--sys/arch/mvme68k/stand/libbug/delay.c4
-rw-r--r--sys/arch/mvme68k/stand/libbug/diskrd.c4
-rw-r--r--sys/arch/mvme68k/stand/libbug/diskwr.c4
-rw-r--r--sys/arch/mvme68k/stand/libbug/getbrdid.c4
-rw-r--r--sys/arch/mvme68k/stand/libbug/inchr.c22
-rw-r--r--sys/arch/mvme68k/stand/libbug/instat.c7
-rw-r--r--sys/arch/mvme68k/stand/libbug/libbug.h23
-rw-r--r--sys/arch/mvme68k/stand/libbug/outln.c6
-rw-r--r--sys/arch/mvme68k/stand/libbug/outstr.c8
-rw-r--r--sys/arch/mvme68k/stand/libbug/putchar.c25
-rw-r--r--sys/arch/mvme68k/stand/libbug/return.c11
-rw-r--r--sys/arch/mvme68k/stand/libbug/rtc_rd.c4
13 files changed, 113 insertions, 26 deletions
diff --git a/sys/arch/mvme68k/stand/libbug/Makefile b/sys/arch/mvme68k/stand/libbug/Makefile
index 53a0a185ff5..e3c23d04011 100644
--- a/sys/arch/mvme68k/stand/libbug/Makefile
+++ b/sys/arch/mvme68k/stand/libbug/Makefile
@@ -1,23 +1,18 @@
-# $OpenBSD: Makefile,v 1.4 1996/05/10 20:03:48 deraadt Exp $
+# $OpenBSD: Makefile,v 1.5 1996/05/16 02:25:39 chuck Exp $
LIB=bug
NOPIC=
NOPROFILE=
-CLEANFILES+=machine
+S=${.CURDIR}/../../../..
+DIR_SA=$S/lib/libsa
-CFLAGS+=-I${.OBJDIR}
+CFLAGS+=-I${.CURDIR}/../../include -I${DIR_SA}
-SRCS= delay.c diskrd.c diskwr.c getbrdid.c instat.c outln.c outstr.c \
- return.c rtc_rd.c
-.PATH: ${.CURDIR}/../../../../lib/libc_sa
-
-all: machine libbug.a
+SRCS= delay.c diskrd.c diskwr.c getbrdid.c inchr.c instat.c outln.c \
+ outstr.c putchar.c return.c rtc_rd.c
install:
-machine:
- rm -f machine; ln -s ${.CURDIR}/../../include machine
-
.include <bsd.lib.mk>
diff --git a/sys/arch/mvme68k/stand/libbug/delay.c b/sys/arch/mvme68k/stand/libbug/delay.c
index c9088938e81..f230d1409e3 100644
--- a/sys/arch/mvme68k/stand/libbug/delay.c
+++ b/sys/arch/mvme68k/stand/libbug/delay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: delay.c,v 1.1 1996/05/07 11:25:06 deraadt Exp $ */
+/* $OpenBSD: delay.c,v 1.2 1996/05/16 02:25:41 chuck Exp $ */
/*
* bug routines -- assumes that the necessary sections of memory
@@ -7,6 +7,8 @@
#include <sys/types.h>
#include <machine/prom.h>
+#include "libbug.h"
+
/* BUG - timing routine */
void
mvmeprom_delay(msec)
diff --git a/sys/arch/mvme68k/stand/libbug/diskrd.c b/sys/arch/mvme68k/stand/libbug/diskrd.c
index c96cde0dee3..76a859fe7ac 100644
--- a/sys/arch/mvme68k/stand/libbug/diskrd.c
+++ b/sys/arch/mvme68k/stand/libbug/diskrd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diskrd.c,v 1.1 1996/05/07 11:25:07 deraadt Exp $ */
+/* $OpenBSD: diskrd.c,v 1.2 1996/05/16 02:25:40 chuck Exp $ */
/*
* bug routines -- assumes that the necessary sections of memory
@@ -7,6 +7,8 @@
#include <sys/types.h>
#include <machine/prom.h>
+#include "libbug.h"
+
/* returns 0: success, nonzero: error */
int
mvmeprom_diskrd(arg)
diff --git a/sys/arch/mvme68k/stand/libbug/diskwr.c b/sys/arch/mvme68k/stand/libbug/diskwr.c
index 38f5dcef3d2..b4ecf66ca3b 100644
--- a/sys/arch/mvme68k/stand/libbug/diskwr.c
+++ b/sys/arch/mvme68k/stand/libbug/diskwr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diskwr.c,v 1.1 1996/05/07 11:25:07 deraadt Exp $ */
+/* $OpenBSD: diskwr.c,v 1.2 1996/05/16 02:25:41 chuck Exp $ */
/*
* bug routines -- assumes that the necessary sections of memory
@@ -7,6 +7,8 @@
#include <sys/types.h>
#include <machine/prom.h>
+#include "libbug.h"
+
/* returns 0: success, nonzero: error */
int
mvmeprom_diskwr(arg)
diff --git a/sys/arch/mvme68k/stand/libbug/getbrdid.c b/sys/arch/mvme68k/stand/libbug/getbrdid.c
index 02ac1bf422a..db4c49c719e 100644
--- a/sys/arch/mvme68k/stand/libbug/getbrdid.c
+++ b/sys/arch/mvme68k/stand/libbug/getbrdid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getbrdid.c,v 1.1 1996/05/07 11:25:08 deraadt Exp $ */
+/* $OpenBSD: getbrdid.c,v 1.2 1996/05/16 02:25:40 chuck Exp $ */
/*
* bug routines -- assumes that the necessary sections of memory
@@ -7,6 +7,8 @@
#include <sys/types.h>
#include <machine/prom.h>
+#include "libbug.h"
+
/* BUG - query board routines */
struct mvmeprom_brdid *
mvmeprom_getbrdid()
diff --git a/sys/arch/mvme68k/stand/libbug/inchr.c b/sys/arch/mvme68k/stand/libbug/inchr.c
new file mode 100644
index 00000000000..a2e691c89c1
--- /dev/null
+++ b/sys/arch/mvme68k/stand/libbug/inchr.c
@@ -0,0 +1,22 @@
+/* $OpenBSD: inchr.c,v 1.1 1996/05/16 02:25:38 chuck Exp $ */
+
+/*
+ * bug routines -- assumes that the necessary sections of memory
+ * are preserved.
+ */
+#include <sys/types.h>
+#include <machine/prom.h>
+
+#include "stand.h"
+#include "libbug.h"
+
+/* returns 0 if no characters ready to read */
+int
+getchar()
+{
+ int ret;
+
+ MVMEPROM_NOARG();
+ MVMEPROM_CALL(MVMEPROM_INCHR);
+ MVMEPROM_RETURN_BYTE(ret);
+}
diff --git a/sys/arch/mvme68k/stand/libbug/instat.c b/sys/arch/mvme68k/stand/libbug/instat.c
index c9a67c2db6d..23b70a7446a 100644
--- a/sys/arch/mvme68k/stand/libbug/instat.c
+++ b/sys/arch/mvme68k/stand/libbug/instat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: instat.c,v 1.1 1996/05/07 11:25:09 deraadt Exp $ */
+/* $OpenBSD: instat.c,v 1.2 1996/05/16 02:25:42 chuck Exp $ */
/*
* bug routines -- assumes that the necessary sections of memory
@@ -7,12 +7,15 @@
#include <sys/types.h>
#include <machine/prom.h>
+#include "libbug.h"
+
/* returns 0 if no characters ready to read */
int
-mvmeprom_instat()
+peekchar()
{
int ret;
+ MVMEPROM_NOARG();
MVMEPROM_CALL(MVMEPROM_INSTAT);
MVMEPROM_STATRET(ret);
}
diff --git a/sys/arch/mvme68k/stand/libbug/libbug.h b/sys/arch/mvme68k/stand/libbug/libbug.h
new file mode 100644
index 00000000000..e57de84104e
--- /dev/null
+++ b/sys/arch/mvme68k/stand/libbug/libbug.h
@@ -0,0 +1,23 @@
+/* $OpenBSD: libbug.h,v 1.1 1996/05/16 02:25:39 chuck Exp $ */
+
+/*
+ * prototypes and such. note that get/put char are in stand.h
+ */
+
+
+void mvmeprom_delay __P((int));
+int mvmeprom_diskrd __P((struct mvmeprom_dskio *));
+int mvmeprom_diskwr __P((struct mvmeprom_dskio *));
+struct mvmeprom_brdid *mvmeprom_getbrdid __P((void));
+int peekchar __P((void));
+void mvmeprom_outln __P((char *, char *));
+void mvmeprom_outstr __P((char *, char *));
+void mvmeprom_rtc_rd __P((struct mvmeprom_time *));
+
+/*
+ * bugcrt stuff
+ */
+
+extern struct mvmeprom_args bugargs;
+
+void bugexec __P((void (*)()));
diff --git a/sys/arch/mvme68k/stand/libbug/outln.c b/sys/arch/mvme68k/stand/libbug/outln.c
index 360d90434b5..7db0a1f6583 100644
--- a/sys/arch/mvme68k/stand/libbug/outln.c
+++ b/sys/arch/mvme68k/stand/libbug/outln.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: outln.c,v 1.1 1996/05/07 11:25:10 deraadt Exp $ */
+/* $OpenBSD: outln.c,v 1.2 1996/05/16 02:25:40 chuck Exp $ */
/*
* bug routines -- assumes that the necessary sections of memory
@@ -7,11 +7,13 @@
#include <sys/types.h>
#include <machine/prom.h>
+#include "libbug.h"
+
void
mvmeprom_outln(start, end)
char *start, *end;
{
- MVMEPROM_ARG1(start);
MVMEPROM_ARG1(end);
+ MVMEPROM_ARG2(start);
MVMEPROM_CALL(MVMEPROM_OUTSTRCRLF);
}
diff --git a/sys/arch/mvme68k/stand/libbug/outstr.c b/sys/arch/mvme68k/stand/libbug/outstr.c
index bede70a5e40..534f4aedaa5 100644
--- a/sys/arch/mvme68k/stand/libbug/outstr.c
+++ b/sys/arch/mvme68k/stand/libbug/outstr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: outstr.c,v 1.1 1996/05/07 11:25:10 deraadt Exp $ */
+/* $OpenBSD: outstr.c,v 1.2 1996/05/16 02:25:42 chuck Exp $ */
/*
* bug routines -- assumes that the necessary sections of memory
@@ -7,11 +7,13 @@
#include <sys/types.h>
#include <machine/prom.h>
+#include "libbug.h"
+
void
mvmeprom_outstr(start, end)
char *start, *end;
{
- MVMEPROM_ARG1(start);
- MVMEPROM_ARG2(end);
+ MVMEPROM_ARG1(end);
+ MVMEPROM_ARG2(start);
MVMEPROM_CALL(MVMEPROM_OUTSTR);
}
diff --git a/sys/arch/mvme68k/stand/libbug/putchar.c b/sys/arch/mvme68k/stand/libbug/putchar.c
new file mode 100644
index 00000000000..892bd964691
--- /dev/null
+++ b/sys/arch/mvme68k/stand/libbug/putchar.c
@@ -0,0 +1,25 @@
+/* $OpenBSD: putchar.c,v 1.1 1996/05/16 02:25:39 chuck Exp $ */
+
+/*
+ * putchar: easier to do this with outstr than to add more macros to
+ * handle byte passing on the stack
+ */
+
+#include <sys/types.h>
+#include <machine/prom.h>
+
+#include "stand.h"
+#include "libbug.h"
+
+void
+putchar(c)
+
+int c;
+
+{
+ char ca[2];
+ if (c == '\n')
+ putchar('\r');
+ ca[0] = c;
+ mvmeprom_outstr(&ca[0], &ca[1]);
+}
diff --git a/sys/arch/mvme68k/stand/libbug/return.c b/sys/arch/mvme68k/stand/libbug/return.c
index fddf5753191..808555f8568 100644
--- a/sys/arch/mvme68k/stand/libbug/return.c
+++ b/sys/arch/mvme68k/stand/libbug/return.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: return.c,v 1.1 1996/05/07 11:25:11 deraadt Exp $ */
+/* $OpenBSD: return.c,v 1.2 1996/05/16 02:25:41 chuck Exp $ */
/*
* bug routines -- assumes that the necessary sections of memory
@@ -7,10 +7,15 @@
#include <sys/types.h>
#include <machine/prom.h>
+#include "stand.h"
+#include "libbug.h"
+
/* BUG - return to bug routine */
-void
-mvmeprom_return()
+__dead void
+_rtt()
{
MVMEPROM_CALL(MVMEPROM_EXIT);
+ printf("_rtt: exit failed. spinning...");
+ while (1) ;
/*NOTREACHED*/
}
diff --git a/sys/arch/mvme68k/stand/libbug/rtc_rd.c b/sys/arch/mvme68k/stand/libbug/rtc_rd.c
index d9d9019d177..e6be8c6c5d2 100644
--- a/sys/arch/mvme68k/stand/libbug/rtc_rd.c
+++ b/sys/arch/mvme68k/stand/libbug/rtc_rd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtc_rd.c,v 1.1 1996/05/07 11:25:12 deraadt Exp $ */
+/* $OpenBSD: rtc_rd.c,v 1.2 1996/05/16 02:25:43 chuck Exp $ */
/*
* bug routines -- assumes that the necessary sections of memory
@@ -7,6 +7,8 @@
#include <sys/types.h>
#include <machine/prom.h>
+#include "libbug.h"
+
void
mvmeprom_rtc_rd(ptime)
struct mvmeprom_time *ptime;