From eabb97da524cda049f0e1264d3f41bf866368a58 Mon Sep 17 00:00:00 2001 From: chuck Date: Fri, 17 May 1996 19:31:46 +0000 Subject: [PATCH] libbug from Dale Rahn. Revisions by Theo de Raadt and myself. --- sys/arch/mvme68k/stand/libbug/Makefile | 16 ++++++++++++++++ sys/arch/mvme68k/stand/libbug/Makefile.inc | 14 ++++++++++++++ sys/arch/mvme68k/stand/libbug/delay.c | 17 +++++++++++++++++ sys/arch/mvme68k/stand/libbug/diskrd.c | 20 ++++++++++++++++++++ sys/arch/mvme68k/stand/libbug/diskwr.c | 20 ++++++++++++++++++++ sys/arch/mvme68k/stand/libbug/getbrdid.c | 20 ++++++++++++++++++++ sys/arch/mvme68k/stand/libbug/instat.c | 18 ++++++++++++++++++ sys/arch/mvme68k/stand/libbug/outln.c | 17 +++++++++++++++++ sys/arch/mvme68k/stand/libbug/outstr.c | 17 +++++++++++++++++ sys/arch/mvme68k/stand/libbug/return.c | 16 ++++++++++++++++ sys/arch/mvme68k/stand/libbug/rtc_rd.c | 16 ++++++++++++++++ 11 files changed, 191 insertions(+) create mode 100644 sys/arch/mvme68k/stand/libbug/Makefile create mode 100644 sys/arch/mvme68k/stand/libbug/Makefile.inc create mode 100644 sys/arch/mvme68k/stand/libbug/delay.c create mode 100644 sys/arch/mvme68k/stand/libbug/diskrd.c create mode 100644 sys/arch/mvme68k/stand/libbug/diskwr.c create mode 100644 sys/arch/mvme68k/stand/libbug/getbrdid.c create mode 100644 sys/arch/mvme68k/stand/libbug/instat.c create mode 100644 sys/arch/mvme68k/stand/libbug/outln.c create mode 100644 sys/arch/mvme68k/stand/libbug/outstr.c create mode 100644 sys/arch/mvme68k/stand/libbug/return.c create mode 100644 sys/arch/mvme68k/stand/libbug/rtc_rd.c diff --git a/sys/arch/mvme68k/stand/libbug/Makefile b/sys/arch/mvme68k/stand/libbug/Makefile new file mode 100644 index 000000000000..3c1b1ed1a7bb --- /dev/null +++ b/sys/arch/mvme68k/stand/libbug/Makefile @@ -0,0 +1,16 @@ +# $NetBSD: Makefile,v 1.1 1996/05/17 19:31:46 chuck Exp $ + +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 + +install: + +.include diff --git a/sys/arch/mvme68k/stand/libbug/Makefile.inc b/sys/arch/mvme68k/stand/libbug/Makefile.inc new file mode 100644 index 000000000000..f362a330ccf7 --- /dev/null +++ b/sys/arch/mvme68k/stand/libbug/Makefile.inc @@ -0,0 +1,14 @@ +# $NetBSD: Makefile.inc,v 1.1 1996/05/17 19:31:48 chuck Exp $ + +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/mvme68k/stand/libbug/delay.c b/sys/arch/mvme68k/stand/libbug/delay.c new file mode 100644 index 000000000000..cb955e0af554 --- /dev/null +++ b/sys/arch/mvme68k/stand/libbug/delay.c @@ -0,0 +1,17 @@ +/* $NetBSD: delay.c,v 1.1 1996/05/17 19:31:49 chuck Exp $ */ + +/* + * bug routines -- assumes that the necessary sections of memory + * are preserved. + */ +#include +#include + +/* 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 index 000000000000..3ec3ea12e276 --- /dev/null +++ b/sys/arch/mvme68k/stand/libbug/diskrd.c @@ -0,0 +1,20 @@ +/* $NetBSD: diskrd.c,v 1.1 1996/05/17 19:31:50 chuck Exp $ */ + +/* + * bug routines -- assumes that the necessary sections of memory + * are preserved. + */ +#include +#include + +/* 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 index 000000000000..ddf79f7dd0e5 --- /dev/null +++ b/sys/arch/mvme68k/stand/libbug/diskwr.c @@ -0,0 +1,20 @@ +/* $NetBSD: diskwr.c,v 1.1 1996/05/17 19:31:51 chuck Exp $ */ + +/* + * bug routines -- assumes that the necessary sections of memory + * are preserved. + */ +#include +#include + +/* 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 index 000000000000..51c7f9af4e42 --- /dev/null +++ b/sys/arch/mvme68k/stand/libbug/getbrdid.c @@ -0,0 +1,20 @@ +/* $NetBSD: getbrdid.c,v 1.1 1996/05/17 19:31:52 chuck Exp $ */ + +/* + * bug routines -- assumes that the necessary sections of memory + * are preserved. + */ + +#include +#include + +/* 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 index 000000000000..3cf6422cf09b --- /dev/null +++ b/sys/arch/mvme68k/stand/libbug/instat.c @@ -0,0 +1,18 @@ +/* $NetBSD: instat.c,v 1.1 1996/05/17 19:31:53 chuck Exp $ */ + +/* + * bug routines -- assumes that the necessary sections of memory + * are preserved. + */ +#include +#include + +/* 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/outln.c b/sys/arch/mvme68k/stand/libbug/outln.c new file mode 100644 index 000000000000..b8dbfdf15a5e --- /dev/null +++ b/sys/arch/mvme68k/stand/libbug/outln.c @@ -0,0 +1,17 @@ +/* $NetBSD: outln.c,v 1.1 1996/05/17 19:31:54 chuck Exp $ */ + +/* + * bug routines -- assumes that the necessary sections of memory + * are preserved. + */ +#include +#include + +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 index 000000000000..6d411cf63b88 --- /dev/null +++ b/sys/arch/mvme68k/stand/libbug/outstr.c @@ -0,0 +1,17 @@ +/* $NetBSD: outstr.c,v 1.1 1996/05/17 19:31:55 chuck Exp $ */ + +/* + * bug routines -- assumes that the necessary sections of memory + * are preserved. + */ +#include +#include + +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/return.c b/sys/arch/mvme68k/stand/libbug/return.c new file mode 100644 index 000000000000..13a868e13e5c --- /dev/null +++ b/sys/arch/mvme68k/stand/libbug/return.c @@ -0,0 +1,16 @@ +/* $NetBSD: return.c,v 1.1 1996/05/17 19:31:56 chuck Exp $ */ + +/* + * bug routines -- assumes that the necessary sections of memory + * are preserved. + */ +#include +#include + +/* 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 index 000000000000..cfd584cdf65f --- /dev/null +++ b/sys/arch/mvme68k/stand/libbug/rtc_rd.c @@ -0,0 +1,16 @@ +/* $NetBSD: rtc_rd.c,v 1.1 1996/05/17 19:31:57 chuck Exp $ */ + +/* + * bug routines -- assumes that the necessary sections of memory + * are preserved. + */ +#include +#include + +void +mvmeprom_rtc_rd(ptime) + struct mvmeprom_time *ptime; +{ + MVMEPROM_ARG1(ptime); + MVMEPROM_CALL(MVMEPROM_RTC_RD); +}