summaryrefslogtreecommitdiff
path: root/sys/arch/mvme88k/stand/openbsd/libbug/m88k
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/mvme88k/stand/openbsd/libbug/m88k')
-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
11 files changed, 163 insertions, 0 deletions
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);
+}