idea by chuck to make libbug MI
authorderaadt <deraadt@openbsd.org>
Tue, 7 May 1996 11:25:01 +0000 (11:25 +0000)
committerderaadt <deraadt@openbsd.org>
Tue, 7 May 1996 11:25:01 +0000 (11:25 +0000)
31 files changed:
sys/arch/mvme68k/include/prom.h
sys/arch/mvme68k/stand/libbug/Makefile
sys/arch/mvme68k/stand/libbug/delay.c [new file with mode: 0644]
sys/arch/mvme68k/stand/libbug/diskrd.c [new file with mode: 0644]
sys/arch/mvme68k/stand/libbug/diskwr.c [new file with mode: 0644]
sys/arch/mvme68k/stand/libbug/getbrdid.c [new file with mode: 0644]
sys/arch/mvme68k/stand/libbug/instat.c [new file with mode: 0644]
sys/arch/mvme68k/stand/libbug/m68k/delay.c [deleted file]
sys/arch/mvme68k/stand/libbug/m68k/diskrd.c [deleted file]
sys/arch/mvme68k/stand/libbug/m68k/diskwr.c [deleted file]
sys/arch/mvme68k/stand/libbug/m68k/getbrdid.c [deleted file]
sys/arch/mvme68k/stand/libbug/m68k/instat.c [deleted file]
sys/arch/mvme68k/stand/libbug/m68k/outln.c [deleted file]
sys/arch/mvme68k/stand/libbug/m68k/outstr.c [deleted file]
sys/arch/mvme68k/stand/libbug/m68k/return.c [deleted file]
sys/arch/mvme68k/stand/libbug/m68k/rtc_rd.c [deleted file]
sys/arch/mvme68k/stand/libbug/m88k/delay.c [deleted file]
sys/arch/mvme68k/stand/libbug/m88k/diskrd.c [deleted file]
sys/arch/mvme68k/stand/libbug/m88k/diskwr.c [deleted file]
sys/arch/mvme68k/stand/libbug/m88k/getbrdid.c [deleted file]
sys/arch/mvme68k/stand/libbug/m88k/instat.c [deleted file]
sys/arch/mvme68k/stand/libbug/m88k/outch.c [deleted file]
sys/arch/mvme68k/stand/libbug/m88k/outln.c [deleted file]
sys/arch/mvme68k/stand/libbug/m88k/outstr.c [deleted file]
sys/arch/mvme68k/stand/libbug/m88k/return.c [deleted file]
sys/arch/mvme68k/stand/libbug/m88k/rtc_rd.c [deleted file]
sys/arch/mvme68k/stand/libbug/outln.c [new file with mode: 0644]
sys/arch/mvme68k/stand/libbug/outstr.c [new file with mode: 0644]
sys/arch/mvme68k/stand/libbug/ppc/bug.c [deleted file]
sys/arch/mvme68k/stand/libbug/return.c [new file with mode: 0644]
sys/arch/mvme68k/stand/libbug/rtc_rd.c [new file with mode: 0644]

index 767af78..3d5373c 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: prom.h,v 1.3 1996/04/28 10:56:27 deraadt Exp $ */
+/*     $OpenBSD: prom.h,v 1.4 1996/05/07 11:25:01 deraadt Exp $ */
 
 /*
  * Copyright (c) 1995 Theo de Raadt
@@ -154,3 +154,15 @@ struct mvmeprom_args {
 
 #define MVMEPROM_CALL(x) \
        asm volatile (__CONCAT("trap #15; .short ", __STRING(x)) )
+#define MVMEPROM_NOARG() \
+       asm volatile ("clrl sp@-")
+#define MVMEPROM_ARG1(arg) \
+       asm volatile ("movel %0, sp@-"::"d" (arg))
+#define MVMEPROM_ARG2(arg) \
+       asm volatile ("movel %0, sp@-"::"d" (arg))
+#define MVMEPROM_RETURN(ret) \
+       asm volatile ("movel sp@+,%0": "=d" (ret):); \
+       return (ret);                   /* return a value */
+#define MVMEPROM_STATRET(ret) \
+       asm volatile ("movew ccr,%0": "=d" (ret)); \
+       return (!(ret & 0x4));          /* return a 'status' */
index b0c606e..1231d08 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: Makefile,v 1.2 1996/04/28 10:48:33 deraadt Exp $
+#      $OpenBSD: Makefile,v 1.3 1996/05/07 11:25:05 deraadt Exp $
 
 LIB=bug
 
@@ -7,9 +7,9 @@ NOPROFILE=
 
 CFLAGS+=-I${.CURDIR}/../../include
 
-SRCS=delay.c diskrd.c diskwr.c getbrdid.c instat.c outln.c outstr.c \
+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}
+.PATH:    ${.CURDIR}/../../../../lib/libc_sa
 
 install:
 
diff --git a/sys/arch/mvme68k/stand/libbug/delay.c b/sys/arch/mvme68k/stand/libbug/delay.c
new file mode 100644 (file)
index 0000000..c908893
--- /dev/null
@@ -0,0 +1,17 @@
+/*     $OpenBSD: delay.c,v 1.1 1996/05/07 11:25:06 deraadt Exp $ */
+
+/*
+ * 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;
+{
+       MVMEPROM_ARG1(msec);
+       MVMEPROM_CALL(MVMEPROM_DELAY);
+}
diff --git a/sys/arch/mvme68k/stand/libbug/diskrd.c b/sys/arch/mvme68k/stand/libbug/diskrd.c
new file mode 100644 (file)
index 0000000..c96cde0
--- /dev/null
@@ -0,0 +1,20 @@
+/*     $OpenBSD: diskrd.c,v 1.1 1996/05/07 11:25:07 deraadt Exp $ */
+
+/*
+ * 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;
+
+       MVMEPROM_ARG1(arg);
+       MVMEPROM_CALL(MVMEPROM_DSKRD);
+       MVMEPROM_STATRET(ret);
+}
diff --git a/sys/arch/mvme68k/stand/libbug/diskwr.c b/sys/arch/mvme68k/stand/libbug/diskwr.c
new file mode 100644 (file)
index 0000000..38f5dce
--- /dev/null
@@ -0,0 +1,20 @@
+/*     $OpenBSD: diskwr.c,v 1.1 1996/05/07 11:25:07 deraadt Exp $ */
+
+/*
+ * 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;
+
+       MVMEPROM_ARG1(arg);
+       MVMEPROM_CALL(MVMEPROM_DSKWR);
+       MVMEPROM_STATRET(ret);
+}
diff --git a/sys/arch/mvme68k/stand/libbug/getbrdid.c b/sys/arch/mvme68k/stand/libbug/getbrdid.c
new file mode 100644 (file)
index 0000000..02ac1bf
--- /dev/null
@@ -0,0 +1,19 @@
+/*     $OpenBSD: getbrdid.c,v 1.1 1996/05/07 11:25:08 deraadt Exp $ */
+
+/*
+ * 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;
+
+       MVMEPROM_NOARG();
+       MVMEPROM_CALL(MVMEPROM_GETBRDID);
+       MVMEPROM_RETURN(id);
+}
diff --git a/sys/arch/mvme68k/stand/libbug/instat.c b/sys/arch/mvme68k/stand/libbug/instat.c
new file mode 100644 (file)
index 0000000..c9a67c2
--- /dev/null
@@ -0,0 +1,18 @@
+/*     $OpenBSD: instat.c,v 1.1 1996/05/07 11:25:09 deraadt Exp $ */
+
+/*
+ * 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()
+{
+       int ret;
+
+       MVMEPROM_CALL(MVMEPROM_INSTAT);
+       MVMEPROM_STATRET(ret);
+}
diff --git a/sys/arch/mvme68k/stand/libbug/m68k/delay.c b/sys/arch/mvme68k/stand/libbug/m68k/delay.c
deleted file mode 100644 (file)
index 570bf07..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*     $OpenBSD: delay.c,v 1.2 1996/04/28 10:48:36 deraadt Exp $ */
-
-/*
- * 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
deleted file mode 100644 (file)
index 60436fb..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*     $OpenBSD: diskrd.c,v 1.2 1996/04/28 10:48:37 deraadt Exp $ */
-
-/*
- * 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
deleted file mode 100644 (file)
index 985d473..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*     $OpenBSD: diskwr.c,v 1.2 1996/04/28 10:48:38 deraadt Exp $ */
-
-/*
- * 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
deleted file mode 100644 (file)
index 3854755..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*     $OpenBSD: getbrdid.c,v 1.2 1996/04/28 10:48:39 deraadt Exp $ */
-
-/*
- * 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
deleted file mode 100644 (file)
index b533cff..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*     $OpenBSD: instat.c,v 1.2 1996/04/28 10:48:43 deraadt Exp $ */
-
-/*
- * 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
deleted file mode 100644 (file)
index 784c0ed..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*     $OpenBSD: outln.c,v 1.2 1996/04/28 10:48:44 deraadt Exp $ */
-
-/*
- * 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
deleted file mode 100644 (file)
index 3cf9f4d..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*     $OpenBSD: outstr.c,v 1.2 1996/04/28 10:48:45 deraadt Exp $ */
-
-/*
- * 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
deleted file mode 100644 (file)
index 230bb6a..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*     $OpenBSD: return.c,v 1.2 1996/04/28 10:48:46 deraadt Exp $ */
-
-/*
- * 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
deleted file mode 100644 (file)
index 0f73e7b..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*     $OpenBSD: rtc_rd.c,v 1.2 1996/04/28 10:48:47 deraadt Exp $ */
-
-/*
- * 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);
-}
diff --git a/sys/arch/mvme68k/stand/libbug/m88k/delay.c b/sys/arch/mvme68k/stand/libbug/m88k/delay.c
deleted file mode 100644 (file)
index 8ff9478..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*     $OpenBSD: delay.c,v 1.2 1996/04/28 10:48:49 deraadt Exp $ */
-
-/*
- * 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/mvme68k/stand/libbug/m88k/diskrd.c b/sys/arch/mvme68k/stand/libbug/m88k/diskrd.c
deleted file mode 100644 (file)
index bc69b36..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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/mvme68k/stand/libbug/m88k/diskwr.c b/sys/arch/mvme68k/stand/libbug/m88k/diskwr.c
deleted file mode 100644 (file)
index 681f521..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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/mvme68k/stand/libbug/m88k/getbrdid.c b/sys/arch/mvme68k/stand/libbug/m88k/getbrdid.c
deleted file mode 100644 (file)
index eeda946..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * 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/mvme68k/stand/libbug/m88k/instat.c b/sys/arch/mvme68k/stand/libbug/m88k/instat.c
deleted file mode 100644 (file)
index 0ac97fe..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * 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/mvme68k/stand/libbug/m88k/outch.c b/sys/arch/mvme68k/stand/libbug/m88k/outch.c
deleted file mode 100644 (file)
index 78110e0..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * 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/mvme68k/stand/libbug/m88k/outln.c b/sys/arch/mvme68k/stand/libbug/m88k/outln.c
deleted file mode 100644 (file)
index ed0067e..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * 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/mvme68k/stand/libbug/m88k/outstr.c b/sys/arch/mvme68k/stand/libbug/m88k/outstr.c
deleted file mode 100644 (file)
index c9e3c35..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * 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/mvme68k/stand/libbug/m88k/return.c b/sys/arch/mvme68k/stand/libbug/m88k/return.c
deleted file mode 100644 (file)
index 00206a1..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * 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/m88k/rtc_rd.c b/sys/arch/mvme68k/stand/libbug/m88k/rtc_rd.c
deleted file mode 100644 (file)
index 7cff322..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * 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);
-}
diff --git a/sys/arch/mvme68k/stand/libbug/outln.c b/sys/arch/mvme68k/stand/libbug/outln.c
new file mode 100644 (file)
index 0000000..360d904
--- /dev/null
@@ -0,0 +1,17 @@
+/*     $OpenBSD: outln.c,v 1.1 1996/05/07 11:25:10 deraadt Exp $ */
+
+/*
+ * 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;
+{
+       MVMEPROM_ARG1(start);
+       MVMEPROM_ARG1(end);
+       MVMEPROM_CALL(MVMEPROM_OUTSTRCRLF);
+}
diff --git a/sys/arch/mvme68k/stand/libbug/outstr.c b/sys/arch/mvme68k/stand/libbug/outstr.c
new file mode 100644 (file)
index 0000000..bede70a
--- /dev/null
@@ -0,0 +1,17 @@
+/*     $OpenBSD: outstr.c,v 1.1 1996/05/07 11:25:10 deraadt Exp $ */
+
+/*
+ * 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;
+{
+       MVMEPROM_ARG1(start);
+       MVMEPROM_ARG2(end);
+       MVMEPROM_CALL(MVMEPROM_OUTSTR);
+}
diff --git a/sys/arch/mvme68k/stand/libbug/ppc/bug.c b/sys/arch/mvme68k/stand/libbug/ppc/bug.c
deleted file mode 100644 (file)
index 205571a..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*     $OpenBSD: bug.c,v 1.2 1996/04/28 10:48:50 deraadt Exp $ */
-
-/*
- * bug routines -- assumes that the necessary sections of memory
- * are preserved.
- */
-#include "bug.h"
-
-#define _INCHR         "0x00"
-#define _INSTAT                "0x01"
-#define _INLN          "0x02"
-#define _READSTR       "0x03"
-#define _READLN                "0x04"
-#define _OUTCHR                "0x20"
-#define _OUTSTR                "0x21"
-#define _OUTLN         "0x22"
-#define _DSKRD         "0x10"
-#define _DSKWR         "0x11"
-#define _DSKCFIG       "0x12"
-#define _DSKFMT                "0x14"
-#define _DSKCTRL       "0x15"
-#define _WRITE         "0x23"
-#define _WRITELN       "0x24"
-#define _DELAY         "0x43"
-#define _RTC_RD                "0x53"
-#define _RETURN                "0x63"
-#define _BRD_ID                "0x70"
-
-/* BUG  -  tty routines */
-
-#define BUG_CALL(x)    \
-       asm volatile ("addi r10,r0," x); \
-       asm volatile ("sc");
-
-char bug_inchr()
-{
-       register char a;
-       asm volatile ("sub r31,r31,4");
-       BUG_CALL(_INCHR);
-       asm volatile ("or %0,r0,r2" :  "=r" (a));
-       return a;
-}
-
-/* returns 0 if no characters ready to read */
-int bug_instat()
-{
-       short ret;
-       BUG_CALL(_INSTAT);
-       asm volatile ("or %0,r0,r2" :  "=r" (ret));
-       return (!(ret & 0x4));
-       
-}
-
-void bug_outchr(char a)
-{
-       asm volatile ("or r2, r0, %0" :  :"r" (a));
-       BUG_CALL(_OUTCHR);
-       return;
-}
-
-void bug_outstr(char *pstrb, char *pstre)
-{
-       asm volatile ("or r2,r0,%0": : "r" (pstrb) );
-       asm volatile ("or r3,r0,%0": : "r" (pstre) );
-       BUG_CALL(_OUTSTR);
-       return;
-}
-
-void bug_outln(char *pstrb, char *pstre)
-{
-       asm volatile ("or r2,r0,%0": : "r" (pstrb) );
-       asm volatile ("or r3,r0,%0": : "r" (pstre) );
-       BUG_CALL(_OUTLN);
-       return;
-}
-
-/* BUG - disk routines */
-
-/* returns 0: success, nonzero: error */
-int bug_diskrd(bug_dskio *arg)
-{
-       int ret;
-       asm volatile ("or r2,r0,%0": : "r" (arg) );
-       BUG_CALL(_DSKRD);
-       return (!(ret & 0x4));
-}
-/* returns 0: success, nonzero: error */
-int bug_diskwr(bug_dskio *arg)
-{
-       int ret;
-       asm volatile ("or r2,r0,%0": : "r" (arg) );
-       BUG_CALL(_DSKWR);
-       return (!(ret & 0x4));
-}
-#ifdef NOTYET
-bug_diskcfig()
-{
-       
-}
-bug_diskfmt(){}
-bug_diskctrl(){}
-#endif
-
-/* BUG - timing routine */
-
-void bug_delay(int delay_msec)
-{
-       asm volatile ("or r2,r0,%0": : "r" (delay_msec) );
-       BUG_CALL(_DELAY);
-       return ;
-}
-
-/* BUG - return to bug routine */
-
-void bug_return()
-{
-       BUG_CALL(_RETURN);
-       /*NOTREACHED*/
-}
-
-/* BUG - query board routines */
-
-struct bug_brdid *bug_brdid()
-{
-       struct bug_brdid *pbrd_id;
-       BUG_CALL(_BRD_ID);
-       asm volatile ("or %0,r0,r2": "=r" (pbrd_id):);
-       return pbrd_id;
-}
-void bug_rtc_rd(struct bug_time *ptime)
-{
-       asm volatile ("or r2,r0,%0": : "r" (ptime));
-       BUG_CALL(_RTC_RD);
-       return;
-}
diff --git a/sys/arch/mvme68k/stand/libbug/return.c b/sys/arch/mvme68k/stand/libbug/return.c
new file mode 100644 (file)
index 0000000..fddf575
--- /dev/null
@@ -0,0 +1,16 @@
+/*     $OpenBSD: return.c,v 1.1 1996/05/07 11:25:11 deraadt Exp $ */
+
+/*
+ * 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/rtc_rd.c b/sys/arch/mvme68k/stand/libbug/rtc_rd.c
new file mode 100644 (file)
index 0000000..d9d9019
--- /dev/null
@@ -0,0 +1,16 @@
+/*     $OpenBSD: rtc_rd.c,v 1.1 1996/05/07 11:25:12 deraadt Exp $ */
+
+/*
+ * 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;
+{
+       MVMEPROM_ARG1(ptime);
+       MVMEPROM_CALL(MVMEPROM_RTC_RD);
+}