summaryrefslogtreecommitdiff
path: root/sys/arch/hp300/stand
diff options
context:
space:
mode:
authorJason Downs <downsj@cvs.openbsd.org>1997-04-16 11:56:40 +0000
committerJason Downs <downsj@cvs.openbsd.org>1997-04-16 11:56:40 +0000
commitab08be91e5dc66cfc42b85763d4caf94e2fd3d09 (patch)
tree89caace66e8787764cc54b781a8cbfd881b69458 /sys/arch/hp300/stand
parent75113d46e0ad67778c0741a5bfc96d9d686f7eec (diff)
Merge portions of NetBSD up to 970415.
This includes: * All of the prototyping and KNF changes. * The new interrupt system. * Portions of the Domain Keyboard support from Mike Smith. This does not include: * m68k changes, namely generic dumps. Various sundry changes and fixes by me.
Diffstat (limited to 'sys/arch/hp300/stand')
-rw-r--r--sys/arch/hp300/stand/Makefile7
-rw-r--r--sys/arch/hp300/stand/dcm.c10
-rw-r--r--sys/arch/hp300/stand/dnkbd.c174
-rw-r--r--sys/arch/hp300/stand/hil.c86
-rw-r--r--sys/arch/hp300/stand/kbd.c91
-rw-r--r--sys/arch/hp300/stand/kbdconf.c69
-rw-r--r--sys/arch/hp300/stand/kbdvar.h66
7 files changed, 462 insertions, 41 deletions
diff --git a/sys/arch/hp300/stand/Makefile b/sys/arch/hp300/stand/Makefile
index c944da56ff4..6cf23f3c4a6 100644
--- a/sys/arch/hp300/stand/Makefile
+++ b/sys/arch/hp300/stand/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.7 1997/02/16 19:16:27 downsj Exp $
+# $OpenBSD: Makefile,v 1.8 1997/04/16 11:56:36 downsj Exp $
# $NetBSD: Makefile,v 1.22 1996/10/18 06:03:25 thorpej Exp $
# @(#)Makefile 8.1 (Berkeley) 6/10/93
@@ -11,6 +11,7 @@ NOMAN= noman
RELOC= FFF00000
CONS= -DDCACONSOLE -DITECONSOLE -DDCMCONSOLE
+CONS+= -DHIL_KEYBOARD -DUK_KEYBOARD -DDOMAIN_KEYBOARD
DEFS= -DSTANDALONE -DCOMPAT_NOLABEL ${CONS} -Dhp300 # -DROMPRF
#DEFS+= -DNETIF_DEBUG -DRPC_DEBUG -DNFS_DEBUG -DRARP_DEBUG -DNET_DEBUG
#DEFS+= -DLE_DEBUG
@@ -18,9 +19,9 @@ CFLAGS= -O3 ${INCPATH} ${DEFS}
SRCS= autoconf.c cons.c devopen.c machdep.c prf.c
OBJS= ${SRCS:N*.h:R:S/$/.o/g}
-DSRCS= ct.c dca.c dcm.c fhpib.c hd.c hil.c hpib.c if_le.c \
+DSRCS= ct.c dca.c dcm.c dnkbd.c fhpib.c hd.c hil.c hpib.c if_le.c \
ite.c ite_dv.c ite_gb.c ite_rb.c ite_subr.c ite_tc.c ite_hy.c \
- nhpib.c scsi.c sd.c
+ kbd.c kbdconf.c kbdvar.h nhpib.c scsi.c sd.c
DOBJS= ${DSRCS:N*.h:R:S/$/.o/g}
S= ${.CURDIR}/../../..
diff --git a/sys/arch/hp300/stand/dcm.c b/sys/arch/hp300/stand/dcm.c
index ae0fa1984ab..0724e723d8e 100644
--- a/sys/arch/hp300/stand/dcm.c
+++ b/sys/arch/hp300/stand/dcm.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: dcm.c,v 1.4 1997/02/03 04:48:02 downsj Exp $ */
-/* $NetBSD: dcm.c,v 1.10 1997/01/30 10:32:52 thorpej Exp $ */
+/* $OpenBSD: dcm.c,v 1.5 1997/04/16 11:56:37 downsj Exp $ */
+/* $NetBSD: dcm.c,v 1.2 1997/04/14 05:58:32 scottr Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -53,7 +53,7 @@
struct dcmdevice *dcmcnaddr = NULL;
-#define DCMCONUNIT 0 /* XXX */
+#define DCMCONUNIT 1 /* XXX */
void
dcmprobe(cp)
@@ -72,6 +72,9 @@ dcmprobe(cp)
}
dcmcnaddr = (struct dcmdevice *) hw->hw_kva;
+#ifdef FORCEDCMCONSOLE
+ cp->cn_pri = CN_REMOTE;
+#else
dcm = dcmcnaddr;
switch (dcm->dcm_rsid) {
case DCMID:
@@ -86,6 +89,7 @@ dcmprobe(cp)
}
curcons_scode = hw->hw_sc;
+#endif
}
void
diff --git a/sys/arch/hp300/stand/dnkbd.c b/sys/arch/hp300/stand/dnkbd.c
new file mode 100644
index 00000000000..ebba27d2499
--- /dev/null
+++ b/sys/arch/hp300/stand/dnkbd.c
@@ -0,0 +1,174 @@
+/* $OpenBSD: dnkbd.c,v 1.1 1997/04/16 11:56:37 downsj Exp $ */
+/* $NetBSD: dnkbd.c,v 1.1 1997/04/14 19:03:13 thorpej Exp $ */
+
+/*-
+ * Copyright (c) 1997 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Michael Smith and Jason R. Thorpe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Apollo Domain keyboard routines for the standalone ITE.
+ */
+
+#if defined(ITECONSOLE) && defined(DOMAIN_KEYBOARD)
+
+#include <sys/param.h>
+
+#include <hp300/dev/dcareg.h> /* for the register bit defintions */
+#include <hp300/dev/apcireg.h> /* for the apci registers */
+
+#include "samachdep.h"
+#include "kbdvar.h"
+
+#ifndef SMALL
+
+/*
+ * The Apollo keyboard is used in `cooked' mode as configured by the
+ * firmware; only one table is required.
+ *
+ * Note that if an entry in this table is set to 0, the key is passed
+ * through untranslated. If the entry is 0xff, the key is ignored.
+ */
+u_char dnkbd_keymap[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 07 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 17 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 1f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 27 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 2f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 37 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 3f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 47 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 4f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 57 */
+ 0x00, 0x00, 0x00, '{', 0x00, '}', 0x00, 0x00, /* 5f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 67 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 6f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 77 */
+ 0x00, 0x00, 0x00, '[', 0x00, ']', 0x00, 0x00, /* 7f */
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 87 */
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 8f */
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 97 */
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 9f */
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* a7 */
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* af */
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* b7 */
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* bf */
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* c7 */
+ '\\', '|', 0x09, 0x0a, '/', 0xff, 0xff, 0xff, /* cf */
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* d7 */
+ 0xff, 0xff, 0xff, 0xff, '?', 0xff, 0x08, 0xff, /* df */
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* e7 */
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ef */
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* f7 */
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ff */
+};
+
+int dnkbd_ignore; /* for ignoring mouse packets */
+
+int
+dnkbd_getc()
+{
+ struct apciregs *apci = (struct apciregs *)0x41c000; /* XXX */
+ int c;
+
+ /* default to `no key' */
+ c = 0;
+
+ /* Is data in the UART? */
+ if (apci->ap_lsr & LSR_RXRDY) {
+ /* Get the character. */
+ c = apci->ap_data;
+
+ /* Ignoring mouse? */
+ if (dnkbd_ignore) {
+ dnkbd_ignore--;
+ return (0);
+ }
+
+ /* Is this the start of a mouse packet? */
+ if (c == 0xdf) {
+ dnkbd_ignore = 3; /* 3 bytes of junk */
+ return (0);
+ }
+
+ /* It's a keyboard event. */
+ switch (dnkbd_keymap[c]) {
+ case 0x00:
+ /* passthrough */
+ break;
+
+ case 0xff:
+ /* ignore */
+ c = 0;
+ break;
+
+ default:
+ c = dnkbd_keymap[c];
+ break;
+ }
+ }
+
+ return (c);
+}
+#endif /* SMALL */
+
+void
+dnkbd_nmi()
+{
+
+ /*
+ * XXX Should we do anything? Can we even generate one?
+ */
+}
+
+int
+dnkbd_init()
+{
+
+ /*
+ * Look for a Frodo utility chip. If we find one, assume there
+ * is a Domain keyboard attached.
+ *
+ * XXX This could be improved.
+ */
+ if (badaddr(0x41c000))
+ return (0);
+
+ /*
+ * XXX Any other initialization? This appears to work ok.
+ */
+ return (1);
+}
+#endif /* ITECONSOLE && DOMAIN_KEYBOARD */
diff --git a/sys/arch/hp300/stand/hil.c b/sys/arch/hp300/stand/hil.c
index 03d2839505c..fc1383f5f2b 100644
--- a/sys/arch/hp300/stand/hil.c
+++ b/sys/arch/hp300/stand/hil.c
@@ -1,7 +1,8 @@
-/* $OpenBSD: hil.c,v 1.3 1997/02/03 04:48:03 downsj Exp $ */
-/* $NetBSD: hil.c,v 1.6 1997/01/30 10:32:53 thorpej Exp $ */
+/* $OpenBSD: hil.c,v 1.4 1997/04/16 11:56:38 downsj Exp $ */
+/* $NetBSD: hil.c,v 1.2 1997/04/14 19:00:10 thorpej Exp $ */
/*
+ * Copyright (c) 1997 Jason R. Thorpe. All rights reserved.
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -44,12 +45,10 @@
*/
/*
- * Keyboard routines for the standalone ITE.
+ * HIL keyboard routines for the standalone ITE.
*/
-#include "samachdep.h"
-
-#ifdef ITECONSOLE
+#if defined(ITECONSOLE) && defined(HIL_KEYBOARD)
#include <sys/param.h>
#include <sys/device.h> /* XXX */
@@ -57,13 +56,16 @@
#include <hp300/dev/kbdmap.h>
#include <hp300/dev/itevar.h>
+#include "samachdep.h"
+#include "kbdvar.h"
+
#ifndef SMALL
/*
* HIL cooked keyboard keymaps.
* Supports only unshifted, shifted and control keys.
*/
-char us_keymap[] = {
+char hil_us_keymap[] = {
NULL, '`', '\\', ESC, NULL, DEL, NULL, NULL,
'\n', '\t', NULL, NULL, NULL, NULL, NULL, NULL,
NULL, '\n', NULL, NULL, NULL, NULL, NULL, NULL,
@@ -82,7 +84,7 @@ char us_keymap[] = {
'z', 'x', 'c', 'v', 'b', 'n', NULL, NULL
};
-char us_shiftmap[] = {
+char hil_us_shiftmap[] = {
NULL, '~', '|', DEL, NULL, DEL, NULL, NULL,
'\n', '\t', NULL, NULL, NULL, NULL, NULL, NULL,
NULL, '\n', NULL, NULL, NULL, NULL, NULL, NULL,
@@ -101,7 +103,7 @@ char us_shiftmap[] = {
'Z', 'X', 'C', 'V', 'B', 'N', NULL, NULL
};
-char us_ctrlmap[] = {
+char hil_us_ctrlmap[] = {
NULL, '`', '\034', ESC, NULL, DEL, NULL, NULL,
'\n', '\t', NULL, NULL, NULL, NULL, NULL, NULL,
NULL, '\n', NULL, NULL, NULL, NULL, NULL, NULL,
@@ -121,7 +123,7 @@ char us_ctrlmap[] = {
};
#ifdef UK_KEYBOARD
-char uk_keymap[] = {
+char hil_uk_keymap[] = {
NULL, '`', '<', ESC, NULL, DEL, NULL, NULL,
'\n', '\t', NULL, NULL, NULL, NULL, NULL, NULL,
NULL, '\n', NULL, NULL, NULL, NULL, NULL, NULL,
@@ -140,7 +142,7 @@ char uk_keymap[] = {
'z', 'x', 'c', 'v', 'b', 'n', NULL, NULL
};
-char uk_shiftmap[] = {
+char hil_uk_shiftmap[] = {
NULL, '~', '>', DEL, NULL, DEL, NULL, NULL,
'\n', '\t', NULL, NULL, NULL, NULL, NULL, NULL,
NULL, '\n', NULL, NULL, NULL, NULL, NULL, NULL,
@@ -159,7 +161,7 @@ char uk_shiftmap[] = {
'Z', 'X', 'C', 'V', 'B', 'N', NULL, NULL
};
-char uk_ctrlmap[] = {
+char hil_uk_ctrlmap[] = {
NULL, '`', '<', ESC, NULL, DEL, NULL, NULL,
'\n', '\t', NULL, NULL, NULL, NULL, NULL, NULL,
NULL, '\n', NULL, NULL, NULL, NULL, NULL, NULL,
@@ -183,27 +185,28 @@ char uk_ctrlmap[] = {
* The keyboard map table.
* Lookup is by hardware returned language code.
*/
-struct kbdmap kbd_map[] = {
+struct kbdmap hilkbd_map[] = {
KBD_US, NULL,
- us_keymap, us_shiftmap, us_ctrlmap, NULL, NULL,
+ hil_us_keymap, hil_us_shiftmap, hil_us_ctrlmap, NULL, NULL,
#ifdef UK_KEYBOARD
KBD_UK, NULL,
- uk_keymap, uk_shiftmap, uk_ctrlmap, NULL, NULL,
+ hil_uk_keymap, hil_uk_shiftmap, hil_uk_ctrlmap, NULL, NULL,
#endif
0, NULL,
NULL, NULL, NULL, NULL, NULL,
};
-char *kbd_keymap = us_keymap;
-char *kbd_shiftmap = us_shiftmap;
-char *kbd_ctrlmap = us_ctrlmap;
+char *hilkbd_keymap = hil_us_keymap;
+char *hilkbd_shiftmap = hil_us_shiftmap;
+char *hilkbd_ctrlmap = hil_us_ctrlmap;
-kbdgetc()
+int
+hilkbd_getc()
{
- register int status, c;
- register struct hil_dev *hiladdr = HILADDR;
+ int status, c;
+ struct hil_dev *hiladdr = HILADDR;
status = hiladdr->hil_stat;
if ((status & HIL_DATA_RDY) == 0)
@@ -211,13 +214,13 @@ kbdgetc()
c = hiladdr->hil_data;
switch ((status>>KBD_SSHIFT) & KBD_SMASK) {
case KBD_SHIFT:
- c = kbd_shiftmap[c & KBD_CHARMASK];
+ c = hilkbd_shiftmap[c & KBD_CHARMASK];
break;
case KBD_CTRL:
- c = kbd_ctrlmap[c & KBD_CHARMASK];
+ c = hilkbd_ctrlmap[c & KBD_CHARMASK];
break;
case KBD_KEY:
- c = kbd_keymap[c & KBD_CHARMASK];
+ c = hilkbd_keymap[c & KBD_CHARMASK];
break;
default:
c = 0;
@@ -225,11 +228,12 @@ kbdgetc()
}
return(c);
}
-#endif
+#endif /* SMALL */
-kbdnmi()
+void
+hilkbd_nmi()
{
- register struct hil_dev *hiladdr = HILADDR;
+ struct hil_dev *hiladdr = HILADDR;
HILWAIT(hiladdr);
hiladdr->hil_cmd = HIL_CNMT;
@@ -239,12 +243,23 @@ kbdnmi()
printf("\nboot interrupted\n");
}
-kbdinit()
+int
+hilkbd_init()
{
- register struct hil_dev *hiladdr = HILADDR;
- register struct kbdmap *km;
+ struct hil_dev *hiladdr = HILADDR;
+ struct kbdmap *km;
u_char lang;
+ /*
+ * Determine the existence of a HIL keyboard.
+ */
+ HILWAIT(hiladdr);
+ hiladdr->hil_cmd = HIL_READKBDSADR;
+ HILDATAWAIT(hiladdr);
+ lang = hiladdr->hil_data;
+ if (lang == 0)
+ return (0);
+
HILWAIT(hiladdr);
hiladdr->hil_cmd = HIL_SETARR;
HILWAIT(hiladdr);
@@ -253,13 +268,14 @@ kbdinit()
hiladdr->hil_cmd = HIL_READKBDLANG;
HILDATAWAIT(hiladdr);
lang = hiladdr->hil_data;
- for (km = kbd_map; km->kbd_code; km++)
+ for (km = hilkbd_map; km->kbd_code; km++) {
if (km->kbd_code == lang) {
- kbd_keymap = km->kbd_keymap;
- kbd_shiftmap = km->kbd_shiftmap;
- kbd_ctrlmap = km->kbd_ctrlmap;
+ hilkbd_keymap = km->kbd_keymap;
+ hilkbd_shiftmap = km->kbd_shiftmap;
+ hilkbd_ctrlmap = km->kbd_ctrlmap;
}
+ }
HILWAIT(hiladdr);
hiladdr->hil_cmd = HIL_INTON;
}
-#endif
+#endif /* ITECONSOLE && HIL_KEYBOARD */
diff --git a/sys/arch/hp300/stand/kbd.c b/sys/arch/hp300/stand/kbd.c
new file mode 100644
index 00000000000..5dd8fccf18e
--- /dev/null
+++ b/sys/arch/hp300/stand/kbd.c
@@ -0,0 +1,91 @@
+/* $OpenBSD: kbd.c,v 1.1 1997/04/16 11:56:38 downsj Exp $ */
+/* $NetBSD: kbd.c,v 1.1 1997/04/14 19:00:11 thorpej Exp $ */
+
+/*-
+ * Copyright (c) 1997 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Indirect keyboard driver for standalone ITE.
+ */
+
+#ifdef ITECONSOLE
+
+#include <sys/param.h>
+
+#include "samachdep.h"
+#include "kbdvar.h"
+
+#ifndef SMALL
+
+/*
+ * Function switch initialized by keyboard drivers.
+ */
+struct kbdsw *selected_kbd;
+
+int
+kbdgetc()
+{
+
+ return ((selected_kbd != NULL) ? (*selected_kbd->k_getc)() : 0);
+}
+
+void
+kbdnmi()
+{
+
+ if (selected_kbd != NULL)
+ (*selected_kbd->k_nmi)();
+ printf("\nboot interrupted\n");
+}
+
+void
+kbdinit()
+{
+ int i;
+
+ selected_kbd = NULL;
+
+ for (i = 0; kbdsw[i].k_init != NULL; i++) {
+ if ((*kbdsw[i].k_init)()) {
+ selected_kbd = &kbdsw[i];
+ return;
+ }
+ }
+}
+
+#endif /* SMALL */
+
+#endif /* ITECONSOLE */
diff --git a/sys/arch/hp300/stand/kbdconf.c b/sys/arch/hp300/stand/kbdconf.c
new file mode 100644
index 00000000000..31d0531a315
--- /dev/null
+++ b/sys/arch/hp300/stand/kbdconf.c
@@ -0,0 +1,69 @@
+/* $OpenBSD: kbdconf.c,v 1.1 1997/04/16 11:56:39 downsj Exp $ */
+/* $NetBSD: kbdconf.c,v 1.1 1997/04/14 19:00:12 thorpej Exp $ */
+
+/*-
+ * Copyright (c) 1997 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Keyboard support configuration.
+ */
+
+#ifdef ITECONSOLE
+
+#include <sys/param.h>
+
+#include "samachdep.h"
+#include "kbdvar.h"
+
+#ifndef SMALL
+
+/*
+ * Note, these are arranged in order of preference. The first `init'
+ * routine to report success gets to play.
+ */
+struct kbdsw kbdsw[] = {
+#ifdef HIL_KEYBOARD
+ { hilkbd_getc, hilkbd_nmi, hilkbd_init },
+#endif
+#ifdef DOMAIN_KEYBOARD
+ { dnkbd_getc, dnkbd_nmi, dnkbd_init },
+#endif
+ { NULL, NULL, NULL },
+};
+
+#endif /* SMALL */
+
+#endif /* ITECONSOLE */
diff --git a/sys/arch/hp300/stand/kbdvar.h b/sys/arch/hp300/stand/kbdvar.h
new file mode 100644
index 00000000000..94c7e6d5ea7
--- /dev/null
+++ b/sys/arch/hp300/stand/kbdvar.h
@@ -0,0 +1,66 @@
+/* $OpenBSD: kbdvar.h,v 1.1 1997/04/16 11:56:39 downsj Exp $ */
+/* $NetBSD: kbdvar.h,v 1.1 1997/04/14 19:00:13 thorpej Exp $ */
+
+/*-
+ * Copyright (c) 1997 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Structure definitions and prototypes for the indirect keyboard driver
+ * for standalone ITE.
+ */
+
+struct kbdsw {
+ int (*k_getc) __P((void)); /* get character */
+ void (*k_nmi) __P((void)); /* handle non-maskable interrupt */
+ int (*k_init) __P((void)); /* probe/initialize keyboard */
+};
+
+#ifdef ITECONSOLE
+
+extern struct kbdsw kbdsw[];
+
+#ifdef HIL_KEYBOARD
+int hilkbd_getc __P((void));
+void hilkbd_nmi __P((void));
+int hilkbd_init __P((void));
+#endif
+
+#ifdef DOMAIN_KEYBOARD
+int dnkbd_getc __P((void));
+void dnkbd_nmi __P((void));
+int dnkbd_init __P((void));
+#endif
+#endif /* ITECONSOLE */