summaryrefslogtreecommitdiff
path: root/sys/arch/mvme68k/stand/libbug/m68k
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/mvme68k/stand/libbug/m68k')
-rw-r--r--sys/arch/mvme68k/stand/libbug/m68k/delay.c15
-rw-r--r--sys/arch/mvme68k/stand/libbug/m68k/diskrd.c19
-rw-r--r--sys/arch/mvme68k/stand/libbug/m68k/diskwr.c19
-rw-r--r--sys/arch/mvme68k/stand/libbug/m68k/getbrdid.c18
-rw-r--r--sys/arch/mvme68k/stand/libbug/m68k/instat.c17
-rw-r--r--sys/arch/mvme68k/stand/libbug/m68k/outln.c15
-rw-r--r--sys/arch/mvme68k/stand/libbug/m68k/outstr.c15
-rw-r--r--sys/arch/mvme68k/stand/libbug/m68k/return.c14
-rw-r--r--sys/arch/mvme68k/stand/libbug/m68k/rtc_rd.c14
9 files changed, 146 insertions, 0 deletions
diff --git a/sys/arch/mvme68k/stand/libbug/m68k/delay.c b/sys/arch/mvme68k/stand/libbug/m68k/delay.c
new file mode 100644
index 00000000000..a5c1f620084
--- /dev/null
+++ b/sys/arch/mvme68k/stand/libbug/m68k/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 ("movel %0,sp@-" : :"d" (msec));
+ MVMEPROM_CALL(MVMEPROM_DELAY);
+}
diff --git a/sys/arch/mvme68k/stand/libbug/m68k/diskrd.c b/sys/arch/mvme68k/stand/libbug/m68k/diskrd.c
new file mode 100644
index 00000000000..b0ebde49624
--- /dev/null
+++ b/sys/arch/mvme68k/stand/libbug/m68k/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 ("movel %0, sp@-"::"d" (arg));
+ MVMEPROM_CALL(MVMEPROM_DSKRD);
+ asm volatile ("movew ccr,%0": "=d" (ret));
+ return (!(ret & 0x4));
+}
diff --git a/sys/arch/mvme68k/stand/libbug/m68k/diskwr.c b/sys/arch/mvme68k/stand/libbug/m68k/diskwr.c
new file mode 100644
index 00000000000..962b947ccb3
--- /dev/null
+++ b/sys/arch/mvme68k/stand/libbug/m68k/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 ("movel %0, sp@-"::"d" (arg));
+ MVMEPROM_CALL(MVMEPROM_DSKWR);
+ asm volatile ("movew ccr,%0": "=d" (ret));
+ return (!(ret & 0x4));
+}
diff --git a/sys/arch/mvme68k/stand/libbug/m68k/getbrdid.c b/sys/arch/mvme68k/stand/libbug/m68k/getbrdid.c
new file mode 100644
index 00000000000..ded49ac3155
--- /dev/null
+++ b/sys/arch/mvme68k/stand/libbug/m68k/getbrdid.c
@@ -0,0 +1,18 @@
+/*
+ * 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_getbrdid()
+{
+ struct mvmeprom_brdid *id;
+
+ asm volatile ("clrl sp@-");
+ MVMEPROM_CALL(MVMEPROM_GETBRDID);
+ asm volatile ("movel sp@+,%0": "=d" (id):);
+ return (id);
+}
diff --git a/sys/arch/mvme68k/stand/libbug/m68k/instat.c b/sys/arch/mvme68k/stand/libbug/m68k/instat.c
new file mode 100644
index 00000000000..5e2f2d3e69e
--- /dev/null
+++ b/sys/arch/mvme68k/stand/libbug/m68k/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()
+{
+ u_short ret;
+
+ MVMEPROM_CALL(MVMEPROM_INSTAT);
+ asm volatile ("movew ccr,%0": "=d" (ret));
+ return (!(ret & 0x4));
+}
diff --git a/sys/arch/mvme68k/stand/libbug/m68k/outln.c b/sys/arch/mvme68k/stand/libbug/m68k/outln.c
new file mode 100644
index 00000000000..344f0ed01f1
--- /dev/null
+++ b/sys/arch/mvme68k/stand/libbug/m68k/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 ("movl %0, sp@-" : "=a" (start));
+ asm volatile ("movl %0, sp@-" : "=a" (end));
+ MVMEPROM_CALL(MVMEPROM_OUTSTRCRLF);
+}
diff --git a/sys/arch/mvme68k/stand/libbug/m68k/outstr.c b/sys/arch/mvme68k/stand/libbug/m68k/outstr.c
new file mode 100644
index 00000000000..b0a7c9ebc92
--- /dev/null
+++ b/sys/arch/mvme68k/stand/libbug/m68k/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 ("movl %0, sp@-" : "=a" (start));
+ asm volatile ("movl %0, sp@-" : "=a" (end));
+ MVMEPROM_CALL(MVMEPROM_OUTSTR);
+}
diff --git a/sys/arch/mvme68k/stand/libbug/m68k/return.c b/sys/arch/mvme68k/stand/libbug/m68k/return.c
new file mode 100644
index 00000000000..00206a16c48
--- /dev/null
+++ b/sys/arch/mvme68k/stand/libbug/m68k/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/mvme68k/stand/libbug/m68k/rtc_rd.c b/sys/arch/mvme68k/stand/libbug/m68k/rtc_rd.c
new file mode 100644
index 00000000000..7b075c4fd9f
--- /dev/null
+++ b/sys/arch/mvme68k/stand/libbug/m68k/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 ("movel %0,sp@-" : :"a" (ptime));
+ MVMEPROM_CALL(MVMEPROM_RTC_RD);
+}