summaryrefslogtreecommitdiff
path: root/sys/arch/mvme88k/stand/openbsd/libbug
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/mvme88k/stand/openbsd/libbug')
-rw-r--r--sys/arch/mvme88k/stand/openbsd/libbug/Makefile14
-rw-r--r--sys/arch/mvme88k/stand/openbsd/libbug/Makefile.inc12
-rw-r--r--sys/arch/mvme88k/stand/openbsd/libbug/log19
-rw-r--r--sys/arch/mvme88k/stand/openbsd/libbug/log29
-rw-r--r--sys/arch/mvme88k/stand/openbsd/libbug/m88k/delay.c15
-rw-r--r--sys/arch/mvme88k/stand/openbsd/libbug/m88k/diskrd.c19
-rw-r--r--sys/arch/mvme88k/stand/openbsd/libbug/m88k/diskwr.c19
-rw-r--r--sys/arch/mvme88k/stand/openbsd/libbug/m88k/getbrdid.c17
-rw-r--r--sys/arch/mvme88k/stand/openbsd/libbug/m88k/instat.c17
-rw-r--r--sys/arch/mvme88k/stand/openbsd/libbug/m88k/outch.c15
-rw-r--r--sys/arch/mvme88k/stand/openbsd/libbug/m88k/outln.c15
-rw-r--r--sys/arch/mvme88k/stand/openbsd/libbug/m88k/outstr.c15
-rw-r--r--sys/arch/mvme88k/stand/openbsd/libbug/m88k/prom.h3
-rw-r--r--sys/arch/mvme88k/stand/openbsd/libbug/m88k/return.c14
-rw-r--r--sys/arch/mvme88k/stand/openbsd/libbug/m88k/rtc_rd.c14
15 files changed, 207 insertions, 0 deletions
diff --git a/sys/arch/mvme88k/stand/openbsd/libbug/Makefile b/sys/arch/mvme88k/stand/openbsd/libbug/Makefile
new file mode 100644
index 00000000000..ba775e5693d
--- /dev/null
+++ b/sys/arch/mvme88k/stand/openbsd/libbug/Makefile
@@ -0,0 +1,14 @@
+LIB=bug
+
+NOPIC=
+NOPROFILE=
+
+CFLAGS+=-I${.CURDIR}/../../include
+
+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 ${.CURDIR}/${MACHINE_ARCH}
+
+install:
+
+.include <bsd.lib.mk>
diff --git a/sys/arch/mvme88k/stand/openbsd/libbug/Makefile.inc b/sys/arch/mvme88k/stand/openbsd/libbug/Makefile.inc
new file mode 100644
index 00000000000..dc1ad6b04c8
--- /dev/null
+++ b/sys/arch/mvme88k/stand/openbsd/libbug/Makefile.inc
@@ -0,0 +1,12 @@
+LIB_BUG_DIR=${S}/arch/${MACHINE}/stand/libbug
+
+LIBBUG_DIR!= cd ${LIB_BUG_DIR}; \
+ printf "xxx:\n\techo \$${.OBJDIR}\n" | ${MAKE} -r -s -f - xxx
+
+LIBBUG=${LIBBUG_DIR}/libbug.a
+
+$(LIBBUG): .NOTMAIN __always_make_libbug
+ @echo making sure the libbug is up to date...
+ @(cd ${LIB_BUG_DIR}; ${MAKE})
+
+__always_make_libbug: .NOTMAIN
diff --git a/sys/arch/mvme88k/stand/openbsd/libbug/log1 b/sys/arch/mvme88k/stand/openbsd/libbug/log1
new file mode 100644
index 00000000000..448b6b71f94
--- /dev/null
+++ b/sys/arch/mvme88k/stand/openbsd/libbug/log1
@@ -0,0 +1,9 @@
+delay.o delay.o
+diskrd.o diskrd.o
+diskwr.o diskwr.o
+getbrdid.o getbrdid.o
+instat.o instat.o
+outln.o outln.o
+outstr.o outstr.o
+return.o return.o
+rtc_rd.o rtc_rd.o
diff --git a/sys/arch/mvme88k/stand/openbsd/libbug/log2 b/sys/arch/mvme88k/stand/openbsd/libbug/log2
new file mode 100644
index 00000000000..7a8950e635f
--- /dev/null
+++ b/sys/arch/mvme88k/stand/openbsd/libbug/log2
@@ -0,0 +1,9 @@
+rtc_rd.o
+return.o
+outstr.o
+outln.o
+instat.o
+getbrdid.o
+diskwr.o
+diskrd.o
+delay.o
diff --git a/sys/arch/mvme88k/stand/openbsd/libbug/m88k/delay.c b/sys/arch/mvme88k/stand/openbsd/libbug/m88k/delay.c
new file mode 100644
index 00000000000..68b1db12106
--- /dev/null
+++ b/sys/arch/mvme88k/stand/openbsd/libbug/m88k/delay.c
@@ -0,0 +1,15 @@
+/*
+ * bug routines -- assumes that the necessary sections of memory
+ * are preserved.
+ */
+#include <sys/types.h>
+#include <machine/prom.h>
+
+/* BUG - timing routine */
+void
+mvmeprom_delay(msec)
+ int msec;
+{
+ asm volatile ("or r2,r0,%0": : "r" (msec));
+ MVMEPROM_CALL(MVMEPROM_DELAY);
+}
diff --git a/sys/arch/mvme88k/stand/openbsd/libbug/m88k/diskrd.c b/sys/arch/mvme88k/stand/openbsd/libbug/m88k/diskrd.c
new file mode 100644
index 00000000000..bc69b365501
--- /dev/null
+++ b/sys/arch/mvme88k/stand/openbsd/libbug/m88k/diskrd.c
@@ -0,0 +1,19 @@
+/*
+ * bug routines -- assumes that the necessary sections of memory
+ * are preserved.
+ */
+#include <sys/types.h>
+#include <machine/prom.h>
+
+/* returns 0: success, nonzero: error */
+int
+mvmeprom_diskrd(arg)
+ struct mvmeprom_dskio *arg;
+{
+ int ret;
+
+ asm volatile ("or r2,r0,%0": : "r" (arg));
+ MVMEPROM_CALL(MVMEPROM_DSKRD);
+ asm volatile ("or %0,r0,r2" : "=r" (ret));
+ return (!(ret & 0x4));
+}
diff --git a/sys/arch/mvme88k/stand/openbsd/libbug/m88k/diskwr.c b/sys/arch/mvme88k/stand/openbsd/libbug/m88k/diskwr.c
new file mode 100644
index 00000000000..681f521b5b0
--- /dev/null
+++ b/sys/arch/mvme88k/stand/openbsd/libbug/m88k/diskwr.c
@@ -0,0 +1,19 @@
+/*
+ * bug routines -- assumes that the necessary sections of memory
+ * are preserved.
+ */
+#include <sys/types.h>
+#include <machine/prom.h>
+
+/* returns 0: success, nonzero: error */
+int
+mvmeprom_diskwr(arg)
+ struct mvmeprom_dskio *arg;
+{
+ int ret;
+
+ asm volatile ("or r2,r0,%0": : "r" (arg) );
+ MVMEPROM_CALL(MVMEPROM_DSKWR);
+ asm volatile ("or %0,r0,r2" : "=r" (ret));
+ return (!(ret & 0x4));
+}
diff --git a/sys/arch/mvme88k/stand/openbsd/libbug/m88k/getbrdid.c b/sys/arch/mvme88k/stand/openbsd/libbug/m88k/getbrdid.c
new file mode 100644
index 00000000000..eeda9468ab7
--- /dev/null
+++ b/sys/arch/mvme88k/stand/openbsd/libbug/m88k/getbrdid.c
@@ -0,0 +1,17 @@
+/*
+ * bug routines -- assumes that the necessary sections of memory
+ * are preserved.
+ */
+#include <sys/types.h>
+#include <machine/prom.h>
+
+/* BUG - query board routines */
+struct mvmeprom_brdid *
+mvmeprom_brdid()
+{
+ struct mvmeprom_brdid *id;
+
+ MVMEPROM_CALL(MVMEPROM_GETBRDID);
+ asm volatile ("or %0,r0,r2": "=r" (id):);
+ return (id);
+}
diff --git a/sys/arch/mvme88k/stand/openbsd/libbug/m88k/instat.c b/sys/arch/mvme88k/stand/openbsd/libbug/m88k/instat.c
new file mode 100644
index 00000000000..0ac97fe7676
--- /dev/null
+++ b/sys/arch/mvme88k/stand/openbsd/libbug/m88k/instat.c
@@ -0,0 +1,17 @@
+/*
+ * bug routines -- assumes that the necessary sections of memory
+ * are preserved.
+ */
+#include <sys/types.h>
+#include <machine/prom.h>
+
+/* returns 0 if no characters ready to read */
+int
+mvmeprom_instat()
+{
+ short ret;
+
+ MVMEPROM_CALL(MVMEPROM_INSTAT);
+ asm volatile ("or %0,r0,r2" : "=r" (ret));
+ return (!(ret & 0x4));
+}
diff --git a/sys/arch/mvme88k/stand/openbsd/libbug/m88k/outch.c b/sys/arch/mvme88k/stand/openbsd/libbug/m88k/outch.c
new file mode 100644
index 00000000000..78110e0299f
--- /dev/null
+++ b/sys/arch/mvme88k/stand/openbsd/libbug/m88k/outch.c
@@ -0,0 +1,15 @@
+/*
+ * bug routines -- assumes that the necessary sections of memory
+ * are preserved.
+ */
+#include <sys/types.h>
+#include <machine/prom.h>
+
+void
+mvmeprom_outchr(a)
+ char a;
+{
+ asm volatile ("or r2, r0, %0" : :"r" (a));
+ BUG_CALL(_OUTCHR);
+}
+
diff --git a/sys/arch/mvme88k/stand/openbsd/libbug/m88k/outln.c b/sys/arch/mvme88k/stand/openbsd/libbug/m88k/outln.c
new file mode 100644
index 00000000000..ed0067e42d9
--- /dev/null
+++ b/sys/arch/mvme88k/stand/openbsd/libbug/m88k/outln.c
@@ -0,0 +1,15 @@
+/*
+ * bug routines -- assumes that the necessary sections of memory
+ * are preserved.
+ */
+#include <sys/types.h>
+#include <machine/prom.h>
+
+void
+mvmeprom_outln(start, end)
+ char *start, *end;
+{
+ asm volatile ("or r2,r0,%0": : "r" (start));
+ asm volatile ("or r3,r0,%0": : "r" (end));
+ MVMEPROM_CALL(MVMEPROM_OUTSTRCRLF);
+}
diff --git a/sys/arch/mvme88k/stand/openbsd/libbug/m88k/outstr.c b/sys/arch/mvme88k/stand/openbsd/libbug/m88k/outstr.c
new file mode 100644
index 00000000000..c9e3c355736
--- /dev/null
+++ b/sys/arch/mvme88k/stand/openbsd/libbug/m88k/outstr.c
@@ -0,0 +1,15 @@
+/*
+ * bug routines -- assumes that the necessary sections of memory
+ * are preserved.
+ */
+#include <sys/types.h>
+#include <machine/prom.h>
+
+void
+mvmeprom_outstr(start, end)
+ char *start, *end;
+{
+ asm volatile ("or r2,r0,%0": : "r" (start));
+ asm volatile ("or r3,r0,%0": : "r" (end));
+ MVMEPROM_CALL(MVMEPROM_OUTSTR);
+}
diff --git a/sys/arch/mvme88k/stand/openbsd/libbug/m88k/prom.h b/sys/arch/mvme88k/stand/openbsd/libbug/m88k/prom.h
new file mode 100644
index 00000000000..4048e86eaff
--- /dev/null
+++ b/sys/arch/mvme88k/stand/openbsd/libbug/m88k/prom.h
@@ -0,0 +1,3 @@
+#define MVMEPROM_CALL(x) \
+ asm volatile ( __CONCAT("or r9,r0," __STRING(x)) ); \
+ asm volatile ("tb0 0,r0,496");
diff --git a/sys/arch/mvme88k/stand/openbsd/libbug/m88k/return.c b/sys/arch/mvme88k/stand/openbsd/libbug/m88k/return.c
new file mode 100644
index 00000000000..00206a16c48
--- /dev/null
+++ b/sys/arch/mvme88k/stand/openbsd/libbug/m88k/return.c
@@ -0,0 +1,14 @@
+/*
+ * bug routines -- assumes that the necessary sections of memory
+ * are preserved.
+ */
+#include <sys/types.h>
+#include <machine/prom.h>
+
+/* BUG - return to bug routine */
+void
+mvmeprom_return()
+{
+ MVMEPROM_CALL(MVMEPROM_EXIT);
+ /*NOTREACHED*/
+}
diff --git a/sys/arch/mvme88k/stand/openbsd/libbug/m88k/rtc_rd.c b/sys/arch/mvme88k/stand/openbsd/libbug/m88k/rtc_rd.c
new file mode 100644
index 00000000000..7cff3227678
--- /dev/null
+++ b/sys/arch/mvme88k/stand/openbsd/libbug/m88k/rtc_rd.c
@@ -0,0 +1,14 @@
+/*
+ * bug routines -- assumes that the necessary sections of memory
+ * are preserved.
+ */
+#include <sys/types.h>
+#include <machine/prom.h>
+
+void
+mvmeprom_rtc_rd(ptime)
+ struct mvmeprom_time *ptime)
+{
+ asm volatile ("or r2,r0,%0": : "r" (ptime));
+ MVMEPROM_CALL(MVMEPROM_RTC_RD);
+}