summaryrefslogtreecommitdiff
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
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.
-rw-r--r--sys/arch/hp300/conf/GENERIC4
-rw-r--r--sys/arch/hp300/conf/Makefile.hp3006
-rw-r--r--sys/arch/hp300/conf/RAMDISK10
-rw-r--r--sys/arch/hp300/conf/files.hp3006
-rw-r--r--sys/arch/hp300/dev/ac.c64
-rw-r--r--sys/arch/hp300/dev/acvar.h15
-rw-r--r--sys/arch/hp300/dev/apcireg.h63
-rw-r--r--sys/arch/hp300/dev/ct.c63
-rw-r--r--sys/arch/hp300/dev/dca.c104
-rw-r--r--sys/arch/hp300/dev/dcm.c151
-rw-r--r--sys/arch/hp300/dev/dio.c9
-rw-r--r--sys/arch/hp300/dev/dma.c58
-rw-r--r--sys/arch/hp300/dev/dmareg.h15
-rw-r--r--sys/arch/hp300/dev/dmavar.h15
-rw-r--r--sys/arch/hp300/dev/fhpib.c73
-rw-r--r--sys/arch/hp300/dev/grf.c48
-rw-r--r--sys/arch/hp300/dev/grf_dv.c37
-rw-r--r--sys/arch/hp300/dev/grf_gb.c31
-rw-r--r--sys/arch/hp300/dev/grf_hy.c41
-rw-r--r--sys/arch/hp300/dev/grf_rb.c39
-rw-r--r--sys/arch/hp300/dev/grf_subr.c6
-rw-r--r--sys/arch/hp300/dev/grf_tc.c22
-rw-r--r--sys/arch/hp300/dev/grfvar.h28
-rw-r--r--sys/arch/hp300/dev/hd.c172
-rw-r--r--sys/arch/hp300/dev/hil.c245
-rw-r--r--sys/arch/hp300/dev/hil_keymaps.c23
-rw-r--r--sys/arch/hp300/dev/hilvar.h29
-rw-r--r--sys/arch/hp300/dev/hpib.c18
-rw-r--r--sys/arch/hp300/dev/hpibvar.h13
-rw-r--r--sys/arch/hp300/dev/if_le.c20
-rw-r--r--sys/arch/hp300/dev/if_levar.h5
-rw-r--r--sys/arch/hp300/dev/ite.c29
-rw-r--r--sys/arch/hp300/dev/ite_subr.c6
-rw-r--r--sys/arch/hp300/dev/itevar.h6
-rw-r--r--sys/arch/hp300/dev/maskbits.h8
-rw-r--r--sys/arch/hp300/dev/mt.c47
-rw-r--r--sys/arch/hp300/dev/nhpib.c19
-rw-r--r--sys/arch/hp300/dev/ppi.c38
-rw-r--r--sys/arch/hp300/dev/scsi.c141
-rw-r--r--sys/arch/hp300/dev/scsivar.h28
-rw-r--r--sys/arch/hp300/dev/sd.c143
-rw-r--r--sys/arch/hp300/dev/sdvar.h19
-rw-r--r--sys/arch/hp300/dev/st.c186
-rw-r--r--sys/arch/hp300/dev/stvar.h54
-rw-r--r--sys/arch/hp300/hp300/autoconf.c27
-rw-r--r--sys/arch/hp300/hp300/clock.c50
-rw-r--r--sys/arch/hp300/hp300/conf.c7
-rw-r--r--sys/arch/hp300/hp300/db_memrw.c22
-rw-r--r--sys/arch/hp300/hp300/disksubr.c23
-rw-r--r--sys/arch/hp300/hp300/dkbad.c13
-rw-r--r--sys/arch/hp300/hp300/hpux_machdep.c112
-rw-r--r--sys/arch/hp300/hp300/intr.c (renamed from sys/arch/hp300/hp300/isr.c)73
-rw-r--r--sys/arch/hp300/hp300/kgdb_glue.c10
-rw-r--r--sys/arch/hp300/hp300/kgdb_stub.c38
-rw-r--r--sys/arch/hp300/hp300/locore.s8
-rw-r--r--sys/arch/hp300/hp300/machdep.c84
-rw-r--r--sys/arch/hp300/hp300/mem.c22
-rw-r--r--sys/arch/hp300/hp300/pmap.c278
-rw-r--r--sys/arch/hp300/hp300/pmap_bootstrap.c27
-rw-r--r--sys/arch/hp300/hp300/sys_machdep.c23
-rw-r--r--sys/arch/hp300/hp300/trap.c68
-rw-r--r--sys/arch/hp300/hp300/vm_machdep.c59
-rw-r--r--sys/arch/hp300/include/autoconf.h5
-rw-r--r--sys/arch/hp300/include/cpu.h64
-rw-r--r--sys/arch/hp300/include/hpux_machdep.h9
-rw-r--r--sys/arch/hp300/include/intr.h176
-rw-r--r--sys/arch/hp300/include/param.h76
-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.c (renamed from sys/arch/hp300/hp300/isr.h)59
-rw-r--r--sys/arch/hp300/stand/kbdvar.h66
74 files changed, 2462 insertions, 1462 deletions
diff --git a/sys/arch/hp300/conf/GENERIC b/sys/arch/hp300/conf/GENERIC
index 59aeeecf069..4354907d615 100644
--- a/sys/arch/hp300/conf/GENERIC
+++ b/sys/arch/hp300/conf/GENERIC
@@ -1,4 +1,4 @@
-# $OpenBSD: GENERIC,v 1.18 1997/02/24 01:16:07 downsj Exp $
+# $OpenBSD: GENERIC,v 1.19 1997/04/16 11:55:53 downsj Exp $
# $NetBSD: GENERIC,v 1.23 1997/01/31 06:12:57 thorpej Exp $
#
# Generic kernel - one size fits all.
@@ -109,5 +109,3 @@ oscsi* at dio? scode ? # Old HP SCSI
sd* at oscsi? target ? lun ? # SCSI disks
st* at oscsi? target ? lun ? # SCSI tapes
ac* at oscsi? target ? lun ? # SCSI changers
-
-pseudo-device rd 2
diff --git a/sys/arch/hp300/conf/Makefile.hp300 b/sys/arch/hp300/conf/Makefile.hp300
index 5cbc7821b6c..751541bbf91 100644
--- a/sys/arch/hp300/conf/Makefile.hp300
+++ b/sys/arch/hp300/conf/Makefile.hp300
@@ -1,5 +1,5 @@
-# $OpenBSD: Makefile.hp300,v 1.14 1997/03/29 05:18:05 downsj Exp $
-# $NetBSD: Makefile.hp300,v 1.45 1996/12/01 06:12:30 jonathan Exp $
+# $OpenBSD: Makefile.hp300,v 1.15 1997/04/16 11:55:54 downsj Exp $
+# $NetBSD: Makefile.hp300,v 1.54 1997/04/01 23:16:41 scottr Exp $
# Makefile for OpenBSD
#
@@ -35,7 +35,7 @@ HP300= ../..
INCLUDES= -I. -I$S/arch -I$S -nostdinc
CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL \
-Dmc68020 -Dhp300
-CWARNFLAGS= -Werror
+CWARNFLAGS= -Werror -Wstrict-prototypes -Wmissing-prototypes
CFLAGS= ${DEBUG} ${COPTS} ${CWARNFLAGS} -msoft-float
AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
LINKFLAGS= -n -Ttext 0 -e start
diff --git a/sys/arch/hp300/conf/RAMDISK b/sys/arch/hp300/conf/RAMDISK
index fffe9f43d21..cbb42d2ba03 100644
--- a/sys/arch/hp300/conf/RAMDISK
+++ b/sys/arch/hp300/conf/RAMDISK
@@ -1,4 +1,4 @@
-# $OpenBSD: RAMDISK,v 1.1 1997/02/23 01:19:08 downsj Exp $
+# $OpenBSD: RAMDISK,v 1.2 1997/04/16 11:55:54 downsj Exp $
#
# Ram disk kernel.
#
@@ -45,6 +45,10 @@ option SE_KEYBOARD # include Swedish HIL keymap
# (Warning: this compiles in a large string table)
option DIOVERBOSE # recognize "unknown" DIO devices
+# Options for the ramdisk.
+option MINIROOTSIZE=4096
+option RAMDISK_HOOKS
+
config bsd root rd0 swap rd0
mainbus0 at root # root "bus"
@@ -107,7 +111,3 @@ oscsi* at dio? scode ? # Old HP SCSI
sd* at oscsi? target ? lun ? # SCSI disks
st* at oscsi? target ? lun ? # SCSI tapes
ac* at oscsi? target ? lun ? # SCSI changers
-
-option MINIROOTSIZE=4096
-option RAMDISK_HOOKS
-pseudo-device rd 2
diff --git a/sys/arch/hp300/conf/files.hp300 b/sys/arch/hp300/conf/files.hp300
index 391bb1dab8f..fc63b482565 100644
--- a/sys/arch/hp300/conf/files.hp300
+++ b/sys/arch/hp300/conf/files.hp300
@@ -1,5 +1,5 @@
-# $OpenBSD: files.hp300,v 1.8 1997/03/26 08:32:38 downsj Exp $
-# $NetBSD: files.hp300,v 1.23 1997/03/17 19:46:43 gwr Exp $
+# $OpenBSD: files.hp300,v 1.9 1997/04/16 11:55:55 downsj Exp $
+# $NetBSD: files.hp300,v 1.25 1997/04/14 02:28:53 thorpej Exp $
#
# hp300-specific configuration info
@@ -170,7 +170,7 @@ file arch/hp300/hp300/dkbad.c
file arch/hp300/hp300/kgdb_glue.c kgdb compile-with "${NORMAL_C} -fno-defer-pop"
file arch/hp300/hp300/kgdb_stub.c kgdb
file arch/hp300/hp300/machdep.c
-file arch/hp300/hp300/isr.c
+file arch/hp300/hp300/intr.c
file arch/hp300/hp300/mem.c
file arch/hp300/hp300/pmap.c
file arch/hp300/hp300/pmap_bootstrap.c
diff --git a/sys/arch/hp300/dev/ac.c b/sys/arch/hp300/dev/ac.c
index 8597ace1823..507a98fb66b 100644
--- a/sys/arch/hp300/dev/ac.c
+++ b/sys/arch/hp300/dev/ac.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: ac.c,v 1.5 1997/02/03 04:47:11 downsj Exp $
-/* $NetBSD: ac.c,v 1.7 1997/01/30 09:14:10 thorpej Exp $ */
+/* $OpenBSD: ac.c,v 1.6 1997/04/16 11:55:56 downsj Exp $
+/* $NetBSD: ac.c,v 1.9 1997/04/02 22:37:21 scottr Exp $ */
/*
* Copyright (c) 1996, 1997 Jason R. Thorpe. All rights reserved.
@@ -54,21 +54,27 @@
*/
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/buf.h>
+#include <sys/device.h>
#include <sys/errno.h>
#include <sys/ioctl.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
-#include <sys/device.h>
#include <hp300/dev/scsireg.h>
#include <hp300/dev/scsivar.h>
-
#include <hp300/dev/acioctl.h>
#include <hp300/dev/acvar.h>
-int acmatch __P((struct device *, void *, void *));
-void acattach __P((struct device *, struct device *, void *));
+/* cdev_decl(ac); */
+/* XXX we should use macros to do these... */
+int acopen __P((dev_t, int, int, struct proc *));
+int acclose __P((dev_t, int, int, struct proc *));
+int acioctl __P((dev_t, u_long, caddr_t, int, struct proc *));
+
+static int acmatch __P((struct device *, void *, void *));
+static void acattach __P((struct device *, struct device *, void *));
struct cfattach ac_ca = {
sizeof(struct ac_softc), acmatch, acattach
@@ -88,7 +94,7 @@ int ac_debug = 0x0000;
#define ACD_OPEN 0x0002
#endif
-int
+static int
acmatch(parent, match, aux)
struct device *parent;
void *match, *aux;
@@ -102,7 +108,7 @@ acmatch(parent, match, aux)
return (1);
}
-void
+static void
acattach(parent, self, aux)
struct device *parent, *self;
void *aux;
@@ -137,14 +143,14 @@ acattach(parent, self, aux)
}
/*ARGSUSED*/
+int
acopen(dev, flag, mode, p)
dev_t dev;
int flag, mode;
struct proc *p;
{
- register int unit = minor(dev);
+ int unit = minor(dev);
struct ac_softc *sc;
- int error = 0;
if (unit >= ac_cd.cd_ndevs ||
(sc = ac_cd.cd_devs[unit]) == NULL ||
@@ -166,6 +172,7 @@ acopen(dev, flag, mode, p)
}
/*ARGSUSED*/
+int
acclose(dev, flag, mode, p)
dev_t dev;
int flag, mode;
@@ -181,9 +188,10 @@ acclose(dev, flag, mode, p)
(8 + (ep)->nmte*12 + (ep)->nse*12 + (ep)->niee*12 + (ep)->ndte*20)
/*ARGSUSED*/
+int
acioctl(dev, cmd, data, flag, p)
dev_t dev;
- int cmd;
+ u_long cmd;
caddr_t data;
int flag;
struct proc *p;
@@ -258,6 +266,7 @@ acioctl(dev, cmd, data, flag, p)
return(error);
}
+int
accommand(dev, command, bufp, buflen)
dev_t dev;
int command;
@@ -266,13 +275,13 @@ accommand(dev, command, bufp, buflen)
{
int unit = minor(dev);
struct ac_softc *sc = ac_cd.cd_devs[unit];
- register struct buf *bp = sc->sc_bp;
- register struct scsi_fmt_cdb *cmd = sc->sc_cmd;
+ struct buf *bp = sc->sc_bp;
+ struct scsi_fmt_cdb *cmd = sc->sc_cmd;
int error;
#ifdef DEBUG
if (ac_debug & ACD_FOLLOW)
- printf("accommand(dev=%x, cmd=%x, buf=%x, buflen=%x)\n",
+ printf("accommand(dev=%x, cmd=%x, buf=%p, buflen=%x)\n",
dev, command, bufp, buflen);
#endif
if (sc->sc_flags & ACF_ACTIVE)
@@ -336,7 +345,7 @@ acstart(arg)
#ifdef DEBUG
if (ac_debug & ACD_FOLLOW)
- printf("acstart(unit=%x)\n", unit);
+ printf("acstart(unit=%x)\n", sc->sc_dev.dv_unit);
#endif
if (scsiustart(sc->sc_dev.dv_parent->dv_unit))
acgo(arg);
@@ -347,12 +356,12 @@ acgo(arg)
void *arg;
{
struct ac_softc *sc = arg;
- register struct buf *bp = sc->sc_bp;
+ struct buf *bp = sc->sc_bp;
int stat;
#ifdef DEBUG
if (ac_debug & ACD_FOLLOW)
- printf("acgo(unit=%x): ", unit);
+ printf("acgo(unit=%x): ", sc->sc_dev.dv_unit);
#endif
stat = scsigo(sc->sc_dev.dv_parent->dv_unit, sc->sc_target,
sc->sc_lun, bp, sc->sc_cmd, 0);
@@ -373,15 +382,14 @@ acintr(arg, stat)
void *arg;
int stat;
{
- register struct ac_softc *sc = arg;
- register struct buf *bp = sc->sc_bp;
+ struct ac_softc *sc = arg;
+ struct buf *bp = sc->sc_bp;
u_char sensebuf[78];
struct scsi_xsense *sp;
- int unit = sc->sc_dev.dv_unit;
#ifdef DEBUG
if (ac_debug & ACD_FOLLOW)
- printf("acintr(unit=%x, stat=%x)\n", unit, stat);
+ printf("acintr(unit=%x, stat=%x)\n", sc->sc_dev.dv_unit, stat);
#endif
switch (stat) {
case 0:
@@ -405,11 +413,12 @@ acintr(arg, stat)
scsifree(sc->sc_dev.dv_parent, &sc->sc_sq);
}
+int
acgeteinfo(dev)
dev_t dev;
{
struct ac_softc *sc = ac_cd.cd_devs[minor(dev)];
- register char *bp;
+ char *bp;
char msbuf[48];
int error;
@@ -438,23 +447,24 @@ acgeteinfo(dev)
return(EIO);
}
+void
acconvert(sbuf, dbuf, ne)
char *sbuf, *dbuf;
int ne;
{
- register struct aceltstat *ep = (struct aceltstat *)dbuf;
- register struct ac_restatphdr *phdr;
- register struct ac_restatdb *dbp;
+ struct aceltstat *ep = (struct aceltstat *)dbuf;
+ struct ac_restatphdr *phdr;
+ struct ac_restatdb *dbp;
struct ac_restathdr *hdr;
#ifdef DEBUG
- register int bcount;
+ int bcount;
#endif
hdr = (struct ac_restathdr *)&sbuf[0];
sbuf += sizeof *hdr;
#ifdef DEBUG
if (ac_debug & ACD_FOLLOW)
- printf("element status: first=%d, num=%d, len=%d\n",
+ printf("element status: first=%d, num=%d, len=%ld\n",
hdr->ac_felt, hdr->ac_nelt, hdr->ac_bcount);
if (hdr->ac_nelt != ne) {
printf("acconvert: # of elements, %d != %d\n",
diff --git a/sys/arch/hp300/dev/acvar.h b/sys/arch/hp300/dev/acvar.h
index 91d330c36ae..96b622886e9 100644
--- a/sys/arch/hp300/dev/acvar.h
+++ b/sys/arch/hp300/dev/acvar.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: acvar.h,v 1.3 1997/02/03 04:47:11 downsj Exp $ */
-/* $NetBSD: acvar.h,v 1.3 1997/01/30 09:14:11 thorpej Exp $ */
+/* $OpenBSD: acvar.h,v 1.4 1997/04/16 11:55:56 downsj Exp $ */
+/* $NetBSD: acvar.h,v 1.4 1997/03/31 07:32:15 scottr Exp $ */
/*
* Copyright (c) 1991 University of Utah.
@@ -87,3 +87,14 @@ struct ac_restatdb {
ac_imp:1, /* 1 == user inserted medium (IEE only) */
ac_full:1; /* element contains media */
};
+
+#ifdef _KERNEL
+int accommand __P((dev_t, int, char *, int));
+
+void acstart __P((void *));
+void acgo __P((void *));
+void acintr __P((void *, int));
+
+int acgeteinfo __P((dev_t));
+void acconvert __P((char *, char *, int));
+#endif /* _KERNEL */
diff --git a/sys/arch/hp300/dev/apcireg.h b/sys/arch/hp300/dev/apcireg.h
new file mode 100644
index 00000000000..577033f53f5
--- /dev/null
+++ b/sys/arch/hp300/dev/apcireg.h
@@ -0,0 +1,63 @@
+/* $OpenBSD: apcireg.h,v 1.1 1997/04/16 11:55:57 downsj Exp $ */
+/* $NetBSD: apcireg.h,v 1.1 1997/04/14 20:36:11 thorpej Exp $ */
+
+/*
+ * Copyright (c) 1997 Michael Smith. All rights reserved.
+ *
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
+ */
+
+#include <hp300/dev/iotypes.h>
+
+struct apciregs {
+ vu_char ap_data;
+ u_char pad0[3];
+ vu_char ap_ier;
+ u_char pad1[3];
+ vu_char ap_iir;
+#define ap_fifo ap_iir
+ u_char pad2[3];
+ vu_char ap_cfcr;
+ u_char pad3[3];
+ vu_char ap_mcr;
+ u_char pad4[3];
+ vu_char ap_lsr;
+ u_char pad5[3];
+ vu_char ap_msr;
+ u_char pad6[3];
+ vu_char ap_scratch;
+};
+
+/* max number of apci ports */
+#define APCI_MAXPORT 4
+
+/* Frodo interrupt number of lowest apci port */
+#define APCI_INTR0 12
+
+/*
+ * baudrate divisor calculations.
+ *
+ * The input clock frequency appears to be 8.0064MHz, giving a scale
+ * factor of 500400. (Using exactly 8MHz gives framing errors with
+ * the Apollo keyboard.)
+ */
+#define APCIBRD(x) (500000 / (x))
diff --git a/sys/arch/hp300/dev/ct.c b/sys/arch/hp300/dev/ct.c
index 528d104da46..6b9f68b7942 100644
--- a/sys/arch/hp300/dev/ct.c
+++ b/sys/arch/hp300/dev/ct.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: ct.c,v 1.6 1997/02/03 04:47:12 downsj Exp $ */
-/* $NetBSD: ct.c,v 1.19 1997/01/30 09:14:12 thorpej Exp $ */
+/* $OpenBSD: ct.c,v 1.7 1997/04/16 11:55:57 downsj Exp $ */
+/* $NetBSD: ct.c,v 1.21 1997/04/02 22:37:23 scottr Exp $ */
/*
* Copyright (c) 1996, 1997 Jason R. Thorpe. All rights reserved.
@@ -52,13 +52,14 @@
*/
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/buf.h>
+#include <sys/conf.h>
+#include <sys/device.h>
#include <sys/ioctl.h>
#include <sys/mtio.h>
-#include <sys/tprintf.h>
#include <sys/proc.h>
-#include <sys/device.h>
-#include <sys/conf.h>
+#include <sys/tprintf.h>
#include <hp300/dev/hpibvar.h>
@@ -142,11 +143,11 @@ struct ctinfo {
short punit;
char *desc;
} ctinfo[] = {
- CT7946ID, 1, "7946A",
- CT7912PID, 1, "7912P",
- CT7914PID, 1, "7914P",
- CT9144ID, 0, "9144",
- CT9145ID, 0, "9145",
+ { CT7946ID, 1, "7946A" },
+ { CT7912PID, 1, "7912P" },
+ { CT7914PID, 1, "7914P" },
+ { CT9144ID, 0, "9144" },
+ { CT9145ID, 0, "9145" },
};
int nctinfo = sizeof(ctinfo) / sizeof(ctinfo[0]);
@@ -405,11 +406,11 @@ void
ctcommand(dev, cmd, cnt)
dev_t dev;
int cmd;
- register int cnt;
+ int cnt;
{
struct ct_softc *sc = ct_cd.cd_devs[UNIT(dev)];
- register struct buf *bp = &sc->sc_bufstore;
- register struct buf *nbp = 0;
+ struct buf *bp = &sc->sc_bufstore;
+ struct buf *nbp = 0;
if (cmd == MTBSF && sc->sc_eofp == EOFS - 1) {
cnt = sc->sc_eofs[EOFS - 1] - cnt;
@@ -457,10 +458,10 @@ ctcommand(dev, cmd, cnt)
void
ctstrategy(bp)
- register struct buf *bp;
+ struct buf *bp;
{
- register struct buf *dp;
- register int s, unit;
+ struct buf *dp;
+ int s, unit;
struct ct_softc *sc;
unit = UNIT(bp->b_dev);
@@ -483,7 +484,7 @@ void
ctustart(sc)
struct ct_softc *sc;
{
- register struct buf *bp;
+ struct buf *bp;
bp = sc->sc_tab.b_actf;
sc->sc_addr = bp->b_un.b_addr;
@@ -497,7 +498,7 @@ ctstart(arg)
void *arg;
{
struct ct_softc *sc = arg;
- struct buf *bp, *dp;
+ struct buf *bp;
int i, ctlr, slave;
ctlr = sc->sc_dev.dv_parent->dv_unit;
@@ -611,7 +612,7 @@ ctgo(arg)
void *arg;
{
struct ct_softc *sc = arg;
- register struct buf *bp;
+ struct buf *bp;
int rw;
bp = sc->sc_tab.b_actf;
@@ -625,8 +626,8 @@ ctgo(arg)
*/
void
cteof(sc, bp)
- register struct ct_softc *sc;
- register struct buf *bp;
+ struct ct_softc *sc;
+ struct buf *bp;
{
long blks;
@@ -647,7 +648,7 @@ cteof(sc, bp)
blks = sc->sc_stat.c_blk - sc->sc_blkno - 1;
#ifdef DEBUG
if (ctdebug & CDB_FILES)
- printf("cteof: bc %d oblk %d nblk %d read %d, resid %d\n",
+ printf("cteof: bc %ld oblk %d nblk %ld read %ld, resid %ld\n",
bp->b_bcount, sc->sc_blkno, sc->sc_stat.c_blk,
blks, bp->b_bcount - CTKTOB(blks));
#endif
@@ -673,7 +674,7 @@ cteof(sc, bp)
* we are now after EOF.
*/
else if ((sc->sc_flags & CTF_BEOF) ||
- (sc->sc_flags & CTF_CMD) && sc->sc_cmd == MTFSF) {
+ ((sc->sc_flags & CTF_CMD) && sc->sc_cmd == MTFSF)) {
sc->sc_flags |= CTF_AEOF;
sc->sc_flags &= ~CTF_BEOF;
}
@@ -701,8 +702,8 @@ void
ctintr(arg)
void *arg;
{
- register struct ct_softc *sc = arg;
- register struct buf *bp;
+ struct ct_softc *sc = arg;
+ struct buf *bp;
u_char stat;
int ctlr, slave, unit;
@@ -743,7 +744,7 @@ ctintr(arg)
hpibrecv(ctlr, slave, C_QSTAT, &stat, 1);
#ifdef DEBUG
if (ctdebug & CDB_FILES)
- printf("ctintr: return stat 0x%x, A%x F%x blk %d\n",
+ printf("ctintr: return stat 0x%x, A%x F%x blk %ld\n",
stat, sc->sc_stat.c_aef,
sc->sc_stat.c_fef, sc->sc_stat.c_blk);
#endif
@@ -776,7 +777,7 @@ ctintr(arg)
"%s: write protect\n",
sc->sc_dev.dv_xname);
} else {
- printf("%s err: v%d u%d ru%d bn%d, ",
+ printf("%s err: v%d u%d ru%d bn%ld, ",
sc->sc_dev.dv_xname,
(sc->sc_stat.c_vu>>4)&0xF,
sc->sc_stat.c_vu&0xF,
@@ -844,9 +845,9 @@ done:
void
ctdone(sc, bp)
struct ct_softc *sc;
- register struct buf *bp;
+ struct buf *bp;
{
- register struct buf *dp;
+ struct buf *dp;
if ((dp = bp->b_actf) != NULL)
dp->b_actb = bp->b_actb;
@@ -890,8 +891,8 @@ ctioctl(dev, cmd, data, flag, p)
caddr_t data;
struct proc *p;
{
- register struct mtop *op;
- register int cnt;
+ struct mtop *op;
+ int cnt;
switch (cmd) {
diff --git a/sys/arch/hp300/dev/dca.c b/sys/arch/hp300/dev/dca.c
index 4e0f6154699..69df5b9a3ae 100644
--- a/sys/arch/hp300/dev/dca.c
+++ b/sys/arch/hp300/dev/dca.c
@@ -1,8 +1,8 @@
-/* $OpenBSD: dca.c,v 1.7 1997/02/03 04:47:13 downsj Exp $ */
-/* $NetBSD: dca.c,v 1.32 1997/01/30 09:18:34 thorpej Exp $ */
+/* $OpenBSD: dca.c,v 1.8 1997/04/16 11:55:58 downsj Exp $ */
+/* $NetBSD: dca.c,v 1.34 1997/04/14 02:33:16 thorpej Exp $ */
/*
- * Copyright (c) 1995, 1996 Jason R. Thorpe. All rights reserved.
+ * Copyright (c) 1995, 1996, 1997 Jason R. Thorpe. All rights reserved.
* Copyright (c) 1982, 1986, 1990, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -63,6 +63,7 @@
#include <machine/autoconf.h>
#include <machine/cpu.h>
+#include <machine/intr.h>
#include <dev/cons.h>
@@ -70,7 +71,6 @@
#include <hp300/dev/diovar.h>
#include <hp300/dev/diodevs.h>
#include <hp300/dev/dcareg.h>
-#include <hp300/hp300/isr.h>
struct dca_softc {
struct device sc_dev; /* generic device glue */
@@ -100,12 +100,27 @@ struct cfdriver dca_cd = {
NULL, "dca", DV_TTY
};
-void dcastart();
-int dcaparam();
-int dcaintr __P((void *));
int dcadefaultrate = TTYDEF_SPEED;
int dcamajor;
+cdev_decl(dca);
+
+int dcaintr __P((void *));
+void dcaeint __P((struct dca_softc *, int));
+void dcamint __P((struct dca_softc *));
+
+int dcaparam __P((struct tty *, struct termios *));
+void dcastart __P((struct tty *));
+int dcastop __P((struct tty *, int));
+int dcamctl __P((struct dca_softc *, int, int));
+void dcainit __P((struct dcadevice *, int));
+
+int dca_console_scan __P((int, caddr_t, void *));
+void dcacnprobe __P((struct consdev *));
+void dcacninit __P((struct consdev *));
+int dcacngetc __P((dev_t));
+void dcacnputc __P((dev_t, int));
+
/*
* Stuff for DCA console support.
*/
@@ -113,23 +128,23 @@ static struct dcadevice *dca_cn = NULL; /* pointer to hardware */
static int dcaconsinit; /* has been initialized */
struct speedtab dcaspeedtab[] = {
- 0, 0,
- 50, DCABRD(50),
- 75, DCABRD(75),
- 110, DCABRD(110),
- 134, DCABRD(134),
- 150, DCABRD(150),
- 200, DCABRD(200),
- 300, DCABRD(300),
- 600, DCABRD(600),
- 1200, DCABRD(1200),
- 1800, DCABRD(1800),
- 2400, DCABRD(2400),
- 4800, DCABRD(4800),
- 9600, DCABRD(9600),
- 19200, DCABRD(19200),
- 38400, DCABRD(38400),
- -1, -1
+ { 0, 0 },
+ { 50, DCABRD(50) },
+ { 75, DCABRD(75) },
+ { 110, DCABRD(110) },
+ { 134, DCABRD(134) },
+ { 150, DCABRD(150) },
+ { 200, DCABRD(200) },
+ { 300, DCABRD(300) },
+ { 600, DCABRD(600) },
+ { 1200, DCABRD(1200) },
+ { 1800, DCABRD(1800) },
+ { 2400, DCABRD(2400) },
+ { 4800, DCABRD(4800) },
+ { 9600, DCABRD(9600) },
+ { 19200, DCABRD(19200) },
+ { 38400, DCABRD(38400) },
+ { -1, -1 },
};
#ifdef KGDB
@@ -216,8 +231,8 @@ dcaattach(parent, self, aux)
sc->sc_flags |= DCA_HASFIFO;
/* Establish interrupt handler. */
- (void) isrlink(dcaintr, sc, ipl,
- (sc->sc_flags & DCA_HASFIFO) ? ISRPRI_TTY : ISRPRI_TTYNOBUF);
+ (void) intr_establish(dcaintr, sc, ipl,
+ (sc->sc_flags & DCA_HASFIFO) ? IPL_TTY : IPL_TTYNOBUF);
sc->sc_flags |= DCA_ACTIVE;
if (self->dv_cfdata->cf_flags)
@@ -368,9 +383,9 @@ dcaclose(dev, flag, mode, p)
struct proc *p;
{
struct dca_softc *sc;
- register struct tty *tp;
- register struct dcadevice *dca;
- register int unit;
+ struct tty *tp;
+ struct dcadevice *dca;
+ int unit;
int s;
unit = DCAUNIT(dev);
@@ -455,10 +470,12 @@ dcaintr(arg)
void *arg;
{
struct dca_softc *sc = arg;
+#ifdef KGDB
int unit = sc->sc_dev.dv_unit;
- register struct dcadevice *dca = sc->sc_dca;
- register struct tty *tp = sc->sc_tty;
- register u_char code;
+#endif
+ struct dcadevice *dca = sc->sc_dca;
+ struct tty *tp = sc->sc_tty;
+ u_char code;
int iflowdone = 0;
/*
@@ -500,7 +517,7 @@ dcaintr(arg)
RCVBYTE();
if (sc->sc_flags & DCA_HASFIFO) {
#ifdef DEBUG
- register int fifocnt = 1;
+ int fifocnt = 1;
#endif
while ((code = dca->dca_lsr) & LSR_RCV_MASK) {
if (code == LSR_RXRDY) {
@@ -547,6 +564,7 @@ dcaintr(arg)
}
}
+void
dcaeint(sc, stat)
struct dca_softc *sc;
int stat;
@@ -575,6 +593,7 @@ dcaeint(sc, stat)
(*linesw[tp->t_line].l_rint)(c, tp);
}
+void
dcamint(sc)
struct dca_softc *sc;
{
@@ -611,7 +630,7 @@ dcamint(sc)
int
dcaioctl(dev, cmd, data, flag, p)
dev_t dev;
- int cmd;
+ u_long cmd;
caddr_t data;
int flag;
struct proc *p;
@@ -702,8 +721,8 @@ dcaioctl(dev, cmd, data, flag, p)
int
dcaparam(tp, t)
- register struct tty *tp;
- register struct termios *t;
+ struct tty *tp;
+ struct termios *t;
{
int unit = DCAUNIT(tp->t_dev);
struct dca_softc *sc = dca_cd.cd_devs[unit];
@@ -730,6 +749,7 @@ dcaparam(tp, t)
break;
case CS8:
+ default: /* XXX gcc whines about cfcr being unitialized... */
cfcr = CFCR_8BITS;
break;
}
@@ -779,7 +799,7 @@ dcaparam(tp, t)
void
dcastart(tp)
- register struct tty *tp;
+ struct tty *tp;
{
int s, c, unit = DCAUNIT(tp->t_dev);
struct dca_softc *sc = dca_cd.cd_devs[unit];
@@ -821,20 +841,22 @@ out:
* Stop output on a line.
*/
/*ARGSUSED*/
-void
+int
dcastop(tp, flag)
- register struct tty *tp;
+ struct tty *tp;
int flag;
{
- register int s;
+ int s;
s = spltty();
if (tp->t_state & TS_BUSY)
if ((tp->t_state & TS_TTSTOP) == 0)
tp->t_state |= TS_FLUSH;
splx(s);
+ return (0);
}
+int
dcamctl(sc, bits, how)
struct dca_softc *sc;
int bits, how;
@@ -1030,7 +1052,7 @@ dcacngetc(dev)
void
dcacnputc(dev, c)
dev_t dev;
- register int c;
+ int c;
{
int timo;
u_char stat;
diff --git a/sys/arch/hp300/dev/dcm.c b/sys/arch/hp300/dev/dcm.c
index 843b75e0626..62a4541ec14 100644
--- a/sys/arch/hp300/dev/dcm.c
+++ b/sys/arch/hp300/dev/dcm.c
@@ -1,8 +1,8 @@
-/* $OpenBSD: dcm.c,v 1.7 1997/02/03 04:47:15 downsj Exp $ */
-/* $NetBSD: dcm.c,v 1.35 1997/01/30 09:11:24 thorpej Exp $ */
+/* $OpenBSD: dcm.c,v 1.8 1997/04/16 11:55:59 downsj Exp $ */
+/* $NetBSD: dcm.c,v 1.39 1997/04/14 02:33:17 thorpej Exp $ */
/*
- * Copyright (c) 1995, 1996 Jason R. Thorpe. All rights reserved.
+ * Copyright (c) 1995, 1996, 1997 Jason R. Thorpe. All rights reserved.
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1982, 1986, 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -68,6 +68,7 @@
#include <machine/autoconf.h>
#include <machine/cpu.h>
+#include <machine/intr.h>
#include <dev/cons.h>
@@ -75,29 +76,28 @@
#include <hp300/dev/diovar.h>
#include <hp300/dev/diodevs.h>
#include <hp300/dev/dcmreg.h>
-#include <hp300/hp300/isr.h>
#ifndef DEFAULT_BAUD_RATE
#define DEFAULT_BAUD_RATE 9600
#endif
struct speedtab dcmspeedtab[] = {
- 0, BR_0,
- 50, BR_50,
- 75, BR_75,
- 110, BR_110,
- 134, BR_134,
- 150, BR_150,
- 300, BR_300,
- 600, BR_600,
- 1200, BR_1200,
- 1800, BR_1800,
- 2400, BR_2400,
- 4800, BR_4800,
- 9600, BR_9600,
- 19200, BR_19200,
- 38400, BR_38400,
- -1, -1
+ { 0, BR_0 },
+ { 50, BR_50 },
+ { 75, BR_75 },
+ { 110, BR_110 },
+ { 134, BR_134 },
+ { 150, BR_150 },
+ { 300, BR_300 },
+ { 600, BR_600 },
+ { 1200, BR_1200 },
+ { 1800, BR_1800 },
+ { 2400, BR_2400 },
+ { 4800, BR_4800 },
+ { 9600, BR_9600 },
+ { 19200, BR_19200 },
+ { 38400, BR_38400 },
+ { -1, -1 },
};
/* u-sec per character based on baudrate (assumes 1 start/8 data/1 stop bit) */
@@ -125,8 +125,8 @@ struct dcmischeme {
* better.
*/
static struct dcmdevice *dcm_cn = NULL; /* pointer to hardware */
-static int dcm_lastcnpri = CN_DEAD; /* XXX last priority */
static int dcmconsinit; /* has been initialized */
+/* static int dcm_lastcnpri = CN_DEAD; */ /* XXX last priority */
int dcmdefaultrate = DEFAULT_BAUD_RATE;
int dcmconbrdbusy = 0;
@@ -247,6 +247,30 @@ struct dcm_softc {
#endif
};
+cdev_decl(dcm);
+
+int dcmintr __P((void *));
+void dcmpint __P((struct dcm_softc *, int, int));
+void dcmrint __P((struct dcm_softc *));
+void dcmreadbuf __P((struct dcm_softc *, int));
+void dcmxint __P((struct dcm_softc *, int));
+void dcmmint __P((struct dcm_softc *, int, int));
+
+int dcmparam __P((struct tty *, struct termios *));
+void dcmstart __P((struct tty *));
+int dcmstop __P((struct tty *, int));
+int dcmmctl __P((dev_t, int, int));
+void dcmsetischeme __P((int, int));
+void dcminit __P((struct dcmdevice *, int, int));
+
+int dcmselftest __P((struct dcm_softc *));
+
+int dcm_console_scan __P((int, caddr_t, void *));
+void dcmcnprobe __P((struct consdev *));
+void dcmcninit __P((struct consdev *));
+int dcmcngetc __P((dev_t));
+void dcmcnputc __P((dev_t, int));
+
int dcmmatch __P((struct device *, void *, void *));
void dcmattach __P((struct device *, struct device *, void *));
@@ -258,14 +282,6 @@ struct cfdriver dcm_cd = {
NULL, "dcm", DV_TTY
};
-int dcmparam();
-void dcmstart();
-
-void dcminit __P((struct dcmdevice *, int, int));
-int dcmintr __P((void *));
-
-int dcmselftest __P((struct dcm_softc *));
-
int
dcmmatch(parent, match, aux)
struct device *parent;
@@ -292,7 +308,9 @@ dcmattach(parent, self, aux)
struct dcmdevice *dcm;
int brd = self->dv_unit;
int scode = da->da_scode;
- int i, mbits, ipl;
+ int i, mbits, code, ipl;
+
+ sc->sc_flags = 0;
if (scode == conscode) {
dcm = (struct dcmdevice *)conaddr;
@@ -319,20 +337,24 @@ dcmattach(parent, self, aux)
ipl = DIO_IPL(dcm);
printf(" ipl %d", ipl);
- if (dcmselftest(sc)) {
+ /*
+ * XXX someone _should_ fix this; the self test screws
+ * autoconfig messages.
+ */
+ if ((sc->sc_flags & DCM_ISCONSOLE) && dcmselftest(sc)) {
printf("\n%s: self-test failed\n", sc->sc_dev.dv_xname);
return;
}
/* Extract configuration info from flags. */
sc->sc_softCAR = self->dv_cfdata->cf_flags & DCM_SOFTCAR;
- sc->sc_flags = self->dv_cfdata->cf_flags & DCM_FLAGMASK;
+ sc->sc_flags |= self->dv_cfdata->cf_flags & DCM_FLAGMASK;
/* Mark our unit as configured. */
sc->sc_flags |= DCM_ACTIVE;
/* Establish the interrupt handler. */
- (void) isrlink(dcmintr, sc, ipl, ISRPRI_TTY);
+ (void) intr_establish(dcmintr, sc, ipl, IPL_TTY);
if (dcmistype == DIS_TIMER)
dcmsetischeme(brd, DIS_RESET|DIS_TIMER);
@@ -354,6 +376,17 @@ dcmattach(parent, self, aux)
for (i = 0; i < NDCMPORT; i++)
sc->sc_modem[i]->mdmmsk = mbits;
+ /*
+ * Get current state of mdmin register on all ports, so that
+ * deltas will work properly.
+ */
+ for (i = 0; i < NDCMPORT; i++) {
+ code = sc->sc_modem[i]->mdmin;
+ if (sc->sc_flags & DCM_STDDCE)
+ code = hp2dce_in(code);
+ sc->sc_mcndlast[i] = code;
+ }
+
dcm->dcm_ic = IC_IE; /* turn all interrupts on */
/*
@@ -546,7 +579,7 @@ dcmread(dev, uio, flag)
{
int unit, board, port;
struct dcm_softc *sc;
- register struct tty *tp;
+ struct tty *tp;
unit = DCMUNIT(dev);
board = DCMBOARD(unit);
@@ -566,7 +599,7 @@ dcmwrite(dev, uio, flag)
{
int unit, board, port;
struct dcm_softc *sc;
- register struct tty *tp;
+ struct tty *tp;
unit = DCMUNIT(dev);
board = DCMBOARD(unit);
@@ -606,7 +639,7 @@ dcmintr(arg)
int pcnd[4], mcode, mcnd[4];
/*
- * Do all guarded register accesses right off to minimize
+ * Do all guarded accesses right off to minimize
* block out of hardware.
*/
SEM_LOCK(dcm);
@@ -703,6 +736,7 @@ dcmintr(arg)
* First, it might be a special character (exception interrupt);
* Second, it may be a buffer empty (transmit interrupt);
*/
+void
dcmpint(sc, port, code)
struct dcm_softc *sc;
int port, code;
@@ -714,6 +748,7 @@ dcmpint(sc, port, code)
dcmxint(sc, port);
}
+void
dcmrint(sc)
struct dcm_softc *sc;
{
@@ -723,14 +758,15 @@ dcmrint(sc)
dcmreadbuf(sc, port);
}
+void
dcmreadbuf(sc, port)
struct dcm_softc *sc;
int port;
{
struct dcmdevice *dcm = sc->sc_dcm;
- struct tty *tp = sc->sc_tty[port];
struct dcmpreg *pp = dcm_preg(dcm, port);
struct dcmrfifo *fifo;
+ struct tty *tp;
int c, stat;
u_int head;
int nch = 0;
@@ -739,6 +775,10 @@ dcmreadbuf(sc, port)
dsp->rints++;
#endif
+ tp = sc->sc_tty[port];
+ if (tp == NULL || (tp->t_state & TS_ISOPEN) == 0)
+ return;
+
if ((tp->t_state & TS_ISOPEN) == 0) {
#ifdef KGDB
if ((makedev(dcmmajor, minor(tp->t_dev)) == kgdb_dev) &&
@@ -813,11 +853,16 @@ dcmreadbuf(sc, port)
#endif
}
+void
dcmxint(sc, port)
struct dcm_softc *sc;
int port;
{
- struct tty *tp = sc->sc_tty[port];
+ struct tty *tp;
+
+ tp = sc->sc_tty[port];
+ if (tp == NULL || (tp->t_state & TS_ISOPEN) == 0)
+ return;
tp->t_state &= ~TS_BUSY;
if (tp->t_state & TS_FLUSH)
@@ -825,6 +870,7 @@ dcmxint(sc, port)
(*linesw[tp->t_line].l_start)(tp);
}
+void
dcmmint(sc, port, mcnd)
struct dcm_softc *sc;
int port, mcnd;
@@ -834,6 +880,8 @@ dcmmint(sc, port, mcnd)
struct dcmdevice *dcm = sc->sc_dcm;
tp = sc->sc_tty[port];
+ if (tp == NULL || (tp->t_state & TS_ISOPEN) == 0)
+ return;
#ifdef DEBUG
if (dcmdebug & DDB_MODEM)
@@ -868,7 +916,7 @@ dcmmint(sc, port, mcnd)
int
dcmioctl(dev, cmd, data, flag, p)
dev_t dev;
- int cmd;
+ u_long cmd;
caddr_t data;
int flag;
struct proc *p;
@@ -888,7 +936,7 @@ dcmioctl(dev, cmd, data, flag, p)
#ifdef DEBUG
if (dcmdebug & DDB_IOCTL)
- printf("%s port %d: dcmioctl: cmd %x data %x flag %x\n",
+ printf("%s port %d: dcmioctl: cmd %lx data %x flag %x\n",
sc->sc_dev.dv_xname, port, cmd, *data, flag);
#endif
error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);
@@ -985,8 +1033,8 @@ dcmioctl(dev, cmd, data, flag, p)
int
dcmparam(tp, t)
- register struct tty *tp;
- register struct termios *t;
+ struct tty *tp;
+ struct termios *t;
{
struct dcm_softc *sc;
struct dcmdevice *dcm;
@@ -1064,7 +1112,7 @@ dcmparam(tp, t)
void
dcmstart(tp)
- register struct tty *tp;
+ struct tty *tp;
{
struct dcm_softc *sc;
struct dcmdevice *dcm;
@@ -1175,7 +1223,7 @@ again:
}
#ifdef DEBUG
if (dcmdebug & DDB_INTR)
- printf("%s port %d: dcmstart(%d): head %x tail %x outqcc %d\n",
+ printf("%s port %d: dcmstart: head %x tail %x outqcc %d\n",
sc->sc_dev.dv_xname, port, head, tail, tp->t_outq.c_cc);
#endif
out:
@@ -1192,9 +1240,9 @@ out:
/*
* Stop output on a line.
*/
-void
+int
dcmstop(tp, flag)
- register struct tty *tp;
+ struct tty *tp;
int flag;
{
int s;
@@ -1206,11 +1254,13 @@ dcmstop(tp, flag)
tp->t_state |= TS_FLUSH;
}
splx(s);
+ return (0);
}
/*
* Modem control
*/
+int
dcmmctl(dev, bits, how)
dev_t dev;
int bits, how;
@@ -1270,6 +1320,7 @@ dcmmctl(dev, bits, how)
/*
* Set board to either interrupt per-character or at a fixed interval.
*/
+void
dcmsetischeme(brd, flags)
int brd, flags;
{
@@ -1305,7 +1356,7 @@ dcmsetischeme(brd, flags)
* chars for any port on the board.
*/
if (!perchar) {
- register struct tty *tp;
+ struct tty *tp;
int c;
for (i = 0; i < NDCMPORT; i++) {
@@ -1377,8 +1428,8 @@ dcmselftest(sc)
struct dcm_softc *sc;
{
struct dcmdevice *dcm = sc->sc_dcm;
- int i, timo = 0;
- int s, brd, mbits, rv;
+ int timo = 0;
+ int s, rv;
rv = 1;
@@ -1571,7 +1622,7 @@ dcmcnputc(dev, c)
{
struct dcmpreg *pp;
unsigned tail;
- int s, unit, stat;
+ int s, stat;
pp = dcm_preg(dcm_cn, DCMCONSPORT);
diff --git a/sys/arch/hp300/dev/dio.c b/sys/arch/hp300/dev/dio.c
index 4f6e3bcdc32..deb17145f54 100644
--- a/sys/arch/hp300/dev/dio.c
+++ b/sys/arch/hp300/dev/dio.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: dio.c,v 1.3 1997/02/03 04:47:17 downsj Exp $ */
-/* $NetBSD: dio.c,v 1.3 1997/01/30 09:18:37 thorpej Exp $ */
+/* $OpenBSD: dio.c,v 1.4 1997/04/16 11:55:59 downsj Exp $ */
+/* $NetBSD: dio.c,v 1.5 1997/04/04 09:53:43 thorpej Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -123,7 +123,8 @@ dioattach(parent, self, aux)
else {
va = iomap(pa, NBPG);
if (va == NULL) {
- printf("%s: can't map scode %d\n", scode);
+ printf("%s: can't map scode %d\n",
+ self->dv_xname, scode);
scode++;
continue;
}
@@ -262,7 +263,9 @@ dio_devinfo(da, buf, buflen)
char *buf;
size_t buflen;
{
+#ifdef DIOVERBOSE
int i;
+#endif
bzero(buf, buflen);
diff --git a/sys/arch/hp300/dev/dma.c b/sys/arch/hp300/dev/dma.c
index 64ac58a23b0..84583358f0a 100644
--- a/sys/arch/hp300/dev/dma.c
+++ b/sys/arch/hp300/dev/dma.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: dma.c,v 1.6 1997/02/04 07:15:24 downsj Exp $ */
-/* $NetBSD: dma.c,v 1.12 1997/01/31 23:01:25 carrel Exp $ */
+/* $OpenBSD: dma.c,v 1.7 1997/04/16 11:56:00 downsj Exp $ */
+/* $NetBSD: dma.c,v 1.17 1997/04/14 02:33:18 thorpej Exp $ */
/*
* Copyright (c) 1995, 1996, 1997
@@ -49,16 +49,13 @@
#include <sys/proc.h>
#include <sys/device.h>
+#include <machine/frame.h>
#include <machine/cpu.h>
+#include <machine/intr.h>
#include <hp300/dev/dmareg.h>
#include <hp300/dev/dmavar.h>
-#include <hp300/hp300/isr.h>
-
-extern u_int kvtop();
-extern void PCIA();
-
/*
* The largest single request will be MAXPHYS bytes which will require
* at most MAXPHYS/NBPG+1 chain elements to describe, i.e. if none of
@@ -202,14 +199,14 @@ dmacomputeipl()
struct dma_softc *sc = &Dma_softc;
if (sc->sc_ih != NULL)
- isrunlink(sc->sc_ih);
+ intr_disestablish(sc->sc_ih);
/*
* Our interrupt level must be as high as the highest
* device using DMA (i.e. splbio).
*/
sc->sc_ipl = PSLTOIPL(hp300_bioipl);
- sc->sc_ih = isrlink(dmaintr, sc, sc->sc_ipl, ISRPRI_BIO);
+ sc->sc_ih = intr_establish(dmaintr, sc, sc->sc_ipl, IPL_BIO);
}
int
@@ -277,7 +274,7 @@ dmafree(dq)
#endif
DMA_CLEAR(dc);
-#if defined(HP340) || defined(HP360) || defined(HP370) || defined(HP380)
+#if defined(HP340) || defined(HP360) || defined(HP370) || defined(HP375) || defined(HP380)
/*
* XXX we may not always go thru the flush code in dmastop()
*/
@@ -327,14 +324,14 @@ dmafree(dq)
void
dmago(unit, addr, count, flags)
int unit;
- register char *addr;
- register int count;
- register int flags;
+ char *addr;
+ int count;
+ int flags;
{
struct dma_softc *sc = &Dma_softc;
- register struct dma_channel *dc = &sc->sc_chan[unit];
- register char *dmaend = NULL;
- register int seg, tcount;
+ struct dma_channel *dc = &sc->sc_chan[unit];
+ char *dmaend = NULL;
+ int seg, tcount;
if (count > MAXPHYS)
panic("dmago: count > MAXPHYS");
@@ -344,7 +341,7 @@ dmago(unit, addr, count, flags)
#endif
#ifdef DEBUG
if (dmadebug & DDB_FOLLOW)
- printf("dmago(%d, %x, %x, %x)\n",
+ printf("dmago(%d, %p, %x, %x)\n",
unit, addr, count, flags);
if (flags & DMAGO_LWORD)
dmalword[unit]++;
@@ -363,7 +360,7 @@ dmago(unit, addr, count, flags)
* Push back dirty cache lines
*/
if (mmutype == MMU_68040)
- DCFP(dc->dm_chain[seg].dc_addr);
+ DCFP((vm_offset_t)dc->dm_chain[seg].dc_addr);
#endif
if (count < (tcount = NBPG - ((int)addr & PGOFSET)))
tcount = count;
@@ -426,7 +423,7 @@ dmago(unit, addr, count, flags)
if (mmutype == MMU_68040 && (flags & DMAGO_READ))
dc->dm_flags |= DMAF_PCFLUSH;
#endif
-#if defined(HP340) || defined(HP360) || defined(HP370)
+#if defined(HP340) || defined(HP360) || defined(HP370) || defined(HP375)
/*
* Remember if we need to flush external physical cache when
* DMA is done. We only do this if we are reading (writing memory).
@@ -450,12 +447,12 @@ dmago(unit, addr, count, flags)
}
#ifdef DEBUG
if (dmadebug & DDB_IO) {
- if ((dmadebug&DDB_WORD) && (dc->dm_cmd&DMA_WORD) ||
- (dmadebug&DDB_LWORD) && (dc->dm_cmd&DMA_LWORD)) {
+ if (((dmadebug&DDB_WORD) && (dc->dm_cmd&DMA_WORD)) ||
+ ((dmadebug&DDB_LWORD) && (dc->dm_cmd&DMA_LWORD))) {
printf("dmago: cmd %x, flags %x\n",
dc->dm_cmd, dc->dm_flags);
for (seg = 0; seg <= dc->dm_last; seg++)
- printf(" %d: %d@%x\n", seg,
+ printf(" %d: %d@%p\n", seg,
dc->dm_chain[seg].dc_count,
dc->dm_chain[seg].dc_addr);
}
@@ -467,11 +464,10 @@ dmago(unit, addr, count, flags)
void
dmastop(unit)
- register int unit;
+ int unit;
{
struct dma_softc *sc = &Dma_softc;
- register struct dma_channel *dc = &sc->sc_chan[unit];
- struct dmaqueue *dq;
+ struct dma_channel *dc = &sc->sc_chan[unit];
#ifdef DEBUG
if (dmadebug & DDB_FOLLOW)
@@ -479,7 +475,7 @@ dmastop(unit)
dmatimo[unit] = 0;
#endif
DMA_CLEAR(dc);
-#if defined(HP340) || defined(HP360) || defined(HP370) || defined(HP380)
+#if defined(HP340) || defined(HP360) || defined(HP370) || defined(HP375) || defined(HP380)
if (dc->dm_flags & DMAF_PCFLUSH) {
PCIA();
dc->dm_flags &= ~DMAF_PCFLUSH;
@@ -514,8 +510,8 @@ dmaintr(arg)
void *arg;
{
struct dma_softc *sc = arg;
- register struct dma_channel *dc;
- register int i, stat;
+ struct dma_channel *dc;
+ int i, stat;
int found = 0;
#ifdef DEBUG
@@ -530,8 +526,8 @@ dmaintr(arg)
found++;
#ifdef DEBUG
if (dmadebug & DDB_IO) {
- if ((dmadebug&DDB_WORD) && (dc->dm_cmd&DMA_WORD) ||
- (dmadebug&DDB_LWORD) && (dc->dm_cmd&DMA_LWORD))
+ if (((dmadebug&DDB_WORD) && (dc->dm_cmd&DMA_WORD)) ||
+ ((dmadebug&DDB_LWORD) && (dc->dm_cmd&DMA_LWORD)))
printf("dmaintr: flags %x unit %d stat %x next %d\n",
dc->dm_flags, i, stat, dc->dm_cur + 1);
}
@@ -567,7 +563,7 @@ void
dmatimeout(arg)
void *arg;
{
- register int i, s;
+ int i, s;
struct dma_softc *sc = arg;
for (i = 0; i < NDMACHAN; i++) {
diff --git a/sys/arch/hp300/dev/dmareg.h b/sys/arch/hp300/dev/dmareg.h
index 96f9741dbce..231b6510353 100644
--- a/sys/arch/hp300/dev/dmareg.h
+++ b/sys/arch/hp300/dev/dmareg.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: dmareg.h,v 1.4 1997/02/03 04:47:22 downsj Exp $ */
-/* $NetBSD: dmareg.h,v 1.8 1997/01/30 09:04:34 thorpej Exp $ */
+/* $OpenBSD: dmareg.h,v 1.5 1997/04/16 11:56:00 downsj Exp $ */
+/* $NetBSD: dmareg.h,v 1.10 1997/04/01 03:10:58 scottr Exp $ */
/*
* Copyright (c) 1982, 1990, 1993
@@ -109,18 +109,21 @@ struct dmareg {
* look at the 98620C status to get the extended bits.
* DMA_ARM: Load address, count and kick-off DMA.
*/
-#define DMA_CLEAR(dc) { v_int dmaclr = (int) dc->dm_Bhwaddr->dmaB_addr; }
+#define DMA_CLEAR(dc) do { \
+ v_int dmaclr; \
+ dmaclr = (int)dc->dm_Bhwaddr->dmaB_addr; \
+ } while (0);
#define DMA_STAT(dc) dc->dm_Bhwaddr->dmaB_stat
#if defined(HP320)
#define DMA_ARM(dc) \
if (dc->dm_softc->sc_type == DMA_B) { \
- register struct dmaBdevice *dma = dc->dm_Bhwaddr; \
+ struct dmaBdevice *dma = dc->dm_Bhwaddr; \
dma->dmaB_addr = dc->dm_chain[dc->dm_cur].dc_addr; \
dma->dmaB_count = dc->dm_chain[dc->dm_cur].dc_count - 1; \
dma->dmaB_cmd = dc->dm_cmd; \
} else { \
- register struct dmadevice *dma = dc->dm_hwaddr; \
+ struct dmadevice *dma = dc->dm_hwaddr; \
dma->dma_addr = dc->dm_chain[dc->dm_cur].dc_addr; \
dma->dma_count = dc->dm_chain[dc->dm_cur].dc_count - 1; \
dma->dma_cmd = dc->dm_cmd; \
@@ -128,7 +131,7 @@ struct dmareg {
#else
#define DMA_ARM(dc) \
{ \
- register struct dmadevice *dma = dc->dm_hwaddr; \
+ struct dmadevice *dma = dc->dm_hwaddr; \
dma->dma_addr = dc->dm_chain[dc->dm_cur].dc_addr; \
dma->dma_count = dc->dm_chain[dc->dm_cur].dc_count - 1; \
dma->dma_cmd = dc->dm_cmd; \
diff --git a/sys/arch/hp300/dev/dmavar.h b/sys/arch/hp300/dev/dmavar.h
index 844e68a6ea3..19679b61638 100644
--- a/sys/arch/hp300/dev/dmavar.h
+++ b/sys/arch/hp300/dev/dmavar.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: dmavar.h,v 1.3 1997/02/03 04:47:23 downsj Exp $ */
-/* $NetBSD: dmavar.h,v 1.7 1997/01/30 09:04:35 thorpej Exp $ */
+/* $OpenBSD: dmavar.h,v 1.4 1997/04/16 11:56:01 downsj Exp $ */
+/* $NetBSD: dmavar.h,v 1.9 1997/04/01 03:10:59 scottr Exp $ */
/*
* Copyright (c) 1997 Jason R. Thorpe. All rights reserved.
@@ -70,7 +70,10 @@ struct dmaqueue {
};
#ifdef _KERNEL
-extern void dmago(), dmafree();
-extern int dmareq();
-extern void dmacomputeipl __P((void));
-#endif
+void dmainit __P((void));
+void dmago __P((int, char *, int, int));
+void dmastop __P((int));
+void dmafree __P((struct dmaqueue *));
+int dmareq __P((struct dmaqueue *));
+void dmacomputeipl __P((void));
+#endif /* _KERNEL */
diff --git a/sys/arch/hp300/dev/fhpib.c b/sys/arch/hp300/dev/fhpib.c
index e695517123e..4626ffadfba 100644
--- a/sys/arch/hp300/dev/fhpib.c
+++ b/sys/arch/hp300/dev/fhpib.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: fhpib.c,v 1.6 1997/02/03 04:47:24 downsj Exp $ */
-/* $NetBSD: fhpib.c,v 1.14 1997/01/30 09:06:53 thorpej Exp $ */
+/* $OpenBSD: fhpib.c,v 1.7 1997/04/16 11:56:01 downsj Exp $ */
+/* $NetBSD: fhpib.c,v 1.17 1997/04/14 02:33:19 thorpej Exp $ */
/*
* Copyright (c) 1996, 1997 Jason R. Thorpe. All rights reserved.
@@ -48,8 +48,7 @@
#include <sys/device.h>
#include <machine/autoconf.h>
-
-#include <hp300/hp300/isr.h>
+#include <machine/intr.h>
#include <hp300/dev/dioreg.h>
#include <hp300/dev/diovar.h>
@@ -159,7 +158,7 @@ fhpibattach(parent, self, aux)
printf(" ipl %d: %s\n", ipl, DIO_DEVICE_DESC_FHPIB);
/* Establish the interrupt handler. */
- (void) isrlink(fhpibintr, sc, ipl, ISRPRI_BIO);
+ (void) intr_establish(fhpibintr, sc, ipl, IPL_BIO);
dmacomputeipl();
ha.ha_ops = &fhpib_controller;
@@ -203,7 +202,7 @@ fhpibreset(hs)
void
fhpibifc(hd)
- register struct fhpibdevice *hd;
+ struct fhpibdevice *hd;
{
hd->hpib_cmd |= CT_IFC;
hd->hpib_cmd |= CT_INITFIFO;
@@ -221,8 +220,8 @@ fhpibsend(hs, slave, sec, ptr, origcnt)
{
struct fhpib_softc *sc = (struct fhpib_softc *)hs->sc_dev.dv_parent;
struct fhpibdevice *hd = sc->sc_regs;
- register int cnt = origcnt;
- register int timo;
+ int cnt = origcnt;
+ int timo;
char *addr = ptr;
hd->hpib_stat = 0;
@@ -285,8 +284,8 @@ fhpibrecv(hs, slave, sec, ptr, origcnt)
{
struct fhpib_softc *sc = (struct fhpib_softc *)hs->sc_dev.dv_parent;
struct fhpibdevice *hd = sc->sc_regs;
- register int cnt = origcnt;
- register int timo;
+ int cnt = origcnt;
+ int timo;
char *addr = ptr;
/*
@@ -348,8 +347,8 @@ fhpibgo(hs, slave, sec, ptr, count, rw, timo)
void *ptr;
{
struct fhpib_softc *sc = (struct fhpib_softc *)hs->sc_dev.dv_parent;
- register struct fhpibdevice *hd = sc->sc_regs;
- register int i;
+ struct fhpibdevice *hd = sc->sc_regs;
+ int i;
char *addr = ptr;
int flags = 0;
@@ -438,13 +437,13 @@ void
fhpibdmadone(arg)
void *arg;
{
- register struct hpibbus_softc *hs = arg;
+ struct hpibbus_softc *hs = arg;
struct fhpib_softc *sc = (struct fhpib_softc *)hs->sc_dev.dv_parent;
int s = splbio();
if (hs->sc_flags & HPIBF_IO) {
- register struct fhpibdevice *hd = sc->sc_regs;
- register struct hpibqueue *hq;
+ struct fhpibdevice *hd = sc->sc_regs;
+ struct hpibqueue *hq;
hd->hpib_imask = 0;
hd->hpib_cid = 0xFF;
@@ -467,16 +466,16 @@ fhpibdone(hs)
struct hpibbus_softc *hs;
{
struct fhpib_softc *sc = (struct fhpib_softc *)hs->sc_dev.dv_parent;
- register struct fhpibdevice *hd = sc->sc_regs;
- register char *addr;
- register int cnt;
+ struct fhpibdevice *hd = sc->sc_regs;
+ char *addr;
+ int cnt;
cnt = hs->sc_curcnt;
hs->sc_addr += cnt;
hs->sc_count -= cnt;
#ifdef DEBUG
- if ((fhpibdebug & FDB_DMA) && fhpibdebugunit == unit)
- printf("fhpibdone: addr %x cnt %d\n",
+ if ((fhpibdebug & FDB_DMA) && fhpibdebugunit == sc->sc_dev.dv_unit)
+ printf("fhpibdone: addr %p cnt %d\n",
hs->sc_addr, hs->sc_count);
#endif
if (hs->sc_flags & HPIBF_READ) {
@@ -509,10 +508,10 @@ fhpibintr(arg)
void *arg;
{
struct fhpib_softc *sc = arg;
- register struct hpibbus_softc *hs = sc->sc_hpibbus;
- register struct fhpibdevice *hd = sc->sc_regs;
- register struct hpibqueue *hq;
- register int stat0, unit = sc->sc_dev.dv_unit;
+ struct hpibbus_softc *hs = sc->sc_hpibbus;
+ struct fhpibdevice *hd = sc->sc_regs;
+ struct hpibqueue *hq;
+ int stat0;
stat0 = hd->hpib_ids;
if ((stat0 & (IDS_IE|IDS_IR)) != (IDS_IE|IDS_IR)) {
@@ -532,7 +531,7 @@ fhpibintr(arg)
return(0);
}
#ifdef DEBUG
- if ((fhpibdebug & FDB_DMA) && fhpibdebugunit == unit)
+ if ((fhpibdebug & FDB_DMA) && fhpibdebugunit == sc->sc_dev.dv_unit)
printf("fhpibintr: flags %x\n", hs->sc_flags);
#endif
hq = hs->sc_queue.tqh_first;
@@ -560,7 +559,8 @@ fhpibintr(arg)
hd->hpib_imask = 0;
#ifdef DEBUG
stat0 = fhpibppoll(hs);
- if ((fhpibdebug & FDB_PPOLL) && unit == fhpibdebugunit)
+ if ((fhpibdebug & FDB_PPOLL) &&
+ fhpibdebugunit == sc->sc_dev.dv_unit)
printf("fhpibintr: got PPOLL status %x\n", stat0);
if ((stat0 & (0x80 >> hq->hq_slave)) == 0) {
/*
@@ -570,9 +570,10 @@ fhpibintr(arg)
DELAY(fhpibppolldelay);
stat0 = fhpibppoll(hs);
if ((stat0 & (0x80 >> hq->hq_slave)) == 0 &&
- (fhpibdebug & FDB_PPOLL) && unit == fhpibdebugunit)
+ (fhpibdebug & FDB_PPOLL) &&
+ fhpibdebugunit == sc->sc_dev.dv_unit)
printf("fhpibintr: PPOLL: unit %d slave %d stat %x\n",
- unit, dq->dq_slave, stat0);
+ sc->sc_dev.dv_unit, hq->hq_slave, stat0);
}
#endif
hs->sc_flags &= ~HPIBF_PPOLL;
@@ -586,8 +587,8 @@ fhpibppoll(hs)
struct hpibbus_softc *hs;
{
struct fhpib_softc *sc = (struct fhpib_softc *)hs->sc_dev.dv_parent;
- register struct fhpibdevice *hd = sc->sc_regs;
- register int ppoll;
+ struct fhpibdevice *hd = sc->sc_regs;
+ int ppoll;
hd->hpib_stat = 0;
hd->hpib_psense = 0;
@@ -606,17 +607,17 @@ fhpibppoll(hs)
int
fhpibwait(hd, x)
- register struct fhpibdevice *hd;
+ struct fhpibdevice *hd;
int x;
{
- register int timo = hpibtimeout;
+ int timo = hpibtimeout;
while ((hd->hpib_intr & x) == 0 && --timo)
DELAY(1);
if (timo == 0) {
#ifdef DEBUG
if (fhpibdebug & FDB_FAIL)
- printf("fhpibwait(%x, %x) timeout\n", hd, x);
+ printf("fhpibwait(%p, %x) timeout\n", hd, x);
#endif
return(-1);
}
@@ -631,10 +632,10 @@ void
fhpibppwatch(arg)
void *arg;
{
- register struct hpibbus_softc *hs = arg;
+ struct hpibbus_softc *hs = arg;
struct fhpib_softc *sc = (struct fhpib_softc *)hs->sc_dev.dv_parent;
- register struct fhpibdevice *hd = sc->sc_regs;
- register int slave;
+ struct fhpibdevice *hd = sc->sc_regs;
+ int slave;
if ((hs->sc_flags & HPIBF_PPOLL) == 0)
return;
diff --git a/sys/arch/hp300/dev/grf.c b/sys/arch/hp300/dev/grf.c
index 3c9d16d3b40..d4fb949475c 100644
--- a/sys/arch/hp300/dev/grf.c
+++ b/sys/arch/hp300/dev/grf.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: grf.c,v 1.5 1997/02/03 04:47:25 downsj Exp $ */
-/* $NetBSD: grf.c,v 1.23 1997/01/30 09:18:42 thorpej Exp $ */
+/* $OpenBSD: grf.c,v 1.6 1997/04/16 11:56:02 downsj Exp $ */
+/* $NetBSD: grf.c,v 1.25 1997/04/02 22:37:30 scottr Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -50,14 +50,15 @@
*/
#include <sys/param.h>
-#include <sys/proc.h>
-#include <sys/ioctl.h>
+#include <sys/systm.h>
+#include <sys/conf.h>
+#include <sys/device.h>
#include <sys/file.h>
+#include <sys/ioctl.h>
#include <sys/malloc.h>
-#include <sys/vnode.h>
#include <sys/mman.h>
-#include <sys/conf.h>
-#include <sys/device.h>
+#include <sys/proc.h>
+#include <sys/vnode.h>
#include <machine/autoconf.h>
#include <machine/cpu.h>
@@ -355,7 +356,7 @@ grfoff(dev)
int
grfaddr(sc, off)
struct grf_softc *sc;
- register int off;
+ int off;
{
struct grf_data *gp= sc->sc_data;
struct grfinfo *gi = &gp->g_display;
@@ -519,8 +520,8 @@ grflock(gp, block)
return(OEAGAIN);
do {
gp->g_flags |= GF_WANTED;
- if (error = tsleep((caddr_t)&gp->g_flags,
- (PZERO+1) | PCATCH, devioc, 0))
+ if ((error = tsleep((caddr_t)&gp->g_flags,
+ (PZERO+1) | PCATCH, devioc, 0)))
return (error);
} while (gp->g_lockp);
}
@@ -625,7 +626,7 @@ grfmap(dev, addrp, p)
#ifdef DEBUG
if (grfdebug & GDB_MMAP)
- printf("grfmap(%d): addr %x\n", p->p_pid, *addrp);
+ printf("grfmap(%d): addr %p\n", p->p_pid, *addrp);
#endif
len = gp->g_display.gd_regsize + gp->g_display.gd_fbsize;
flags = MAP_SHARED;
@@ -644,6 +645,7 @@ grfmap(dev, addrp, p)
return(error);
}
+int
grfunmap(dev, addr, p)
dev_t dev;
caddr_t addr;
@@ -656,7 +658,7 @@ grfunmap(dev, addr, p)
#ifdef DEBUG
if (grfdebug & GDB_MMAP)
- printf("grfunmap(%d): dev %x addr %x\n", p->p_pid, dev, addr);
+ printf("grfunmap(%d): dev %x addr %p\n", p->p_pid, dev, addr);
#endif
if (addr == 0)
return(EINVAL); /* XXX: how do we deal with this? */
@@ -675,7 +677,7 @@ iommap(dev, addrp)
#ifdef DEBUG
if (grfdebug & (GDB_MMAP|GDB_IOMAP))
- printf("iommap(%d): addr %x\n", curproc->p_pid, *addrp);
+ printf("iommap(%d): addr %p\n", curproc->p_pid, *addrp);
#endif
return(EINVAL);
}
@@ -685,11 +687,11 @@ iounmmap(dev, addr)
dev_t dev;
caddr_t addr;
{
+#ifdef DEBUG
int unit = minor(dev);
-#ifdef DEBUG
if (grfdebug & (GDB_MMAP|GDB_IOMAP))
- printf("iounmmap(%d): id %d addr %x\n",
+ printf("iounmmap(%d): id %d addr %p\n",
curproc->p_pid, unit, addr);
#endif
return(0);
@@ -702,11 +704,12 @@ iounmmap(dev, addr)
* process ids. Returns a slot number between 1 and GRFMAXLCK or 0 if no
* slot is available.
*/
+int
grffindpid(gp)
struct grf_data *gp;
{
- register short pid, *sp;
- register int i, limit;
+ short pid, *sp;
+ int i, limit;
int ni;
if (gp->g_pid == NULL) {
@@ -740,11 +743,12 @@ done:
return(i);
}
+void
grfrmpid(gp)
struct grf_data *gp;
{
- register short pid, *sp;
- register int limit, i;
+ short pid, *sp;
+ int limit, i;
int mi;
if (gp->g_pid == NULL || (limit = gp->g_pid[0]) == 0)
@@ -768,6 +772,7 @@ grfrmpid(gp)
#endif
}
+int
grflckmmap(dev, addrp)
dev_t dev;
caddr_t *addrp;
@@ -776,12 +781,13 @@ grflckmmap(dev, addrp)
struct proc *p = curproc; /* XXX */
if (grfdebug & (GDB_MMAP|GDB_LOCK))
- printf("grflckmmap(%d): addr %x\n",
+ printf("grflckmmap(%d): addr %p\n",
p->p_pid, *addrp);
#endif
return(EINVAL);
}
+int
grflckunmmap(dev, addr)
dev_t dev;
caddr_t addr;
@@ -790,7 +796,7 @@ grflckunmmap(dev, addr)
int unit = minor(dev);
if (grfdebug & (GDB_MMAP|GDB_LOCK))
- printf("grflckunmmap(%d): id %d addr %x\n",
+ printf("grflckunmmap(%d): id %d addr %p\n",
curproc->p_pid, unit, addr);
#endif
return(EINVAL);
diff --git a/sys/arch/hp300/dev/grf_dv.c b/sys/arch/hp300/dev/grf_dv.c
index 80b80f40679..85b2bcfc0d9 100644
--- a/sys/arch/hp300/dev/grf_dv.c
+++ b/sys/arch/hp300/dev/grf_dv.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: grf_dv.c,v 1.5 1997/02/05 16:01:09 downsj Exp $ */
-/* $NetBSD: grf_dv.c,v 1.10 1997/01/30 09:18:45 thorpej Exp $ */
+/* $OpenBSD: grf_dv.c,v 1.6 1997/04/16 11:56:02 downsj Exp $ */
+/* $NetBSD: grf_dv.c,v 1.11 1997/03/31 07:34:14 scottr Exp $ */
/*
* Copyright (c) 1996 Jason R. Thorpe. All rights reserved.
@@ -48,13 +48,13 @@
* Graphics routines for the DaVinci, HP98730/98731 Graphics system.
*/
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/conf.h>
+#include <sys/device.h>
#include <sys/errno.h>
-#include <sys/proc.h>
#include <sys/ioctl.h>
+#include <sys/proc.h>
#include <sys/tty.h>
-#include <sys/systm.h>
-#include <sys/device.h>
#include <machine/autoconf.h>
#include <machine/cpu.h>
@@ -85,6 +85,10 @@ void dvbox_intio_attach __P((struct device *, struct device *, void *));
int dvbox_dio_match __P((struct device *, void *, void *));
void dvbox_dio_attach __P((struct device *, struct device *, void *));
+int dvbox_console_scan __P((int, caddr_t, void *));
+void dvboxcnprobe __P((struct consdev *cp));
+void dvboxcninit __P((struct consdev *cp));
+
struct cfattach dvbox_intio_ca = {
sizeof(struct grfdev_softc), dvbox_intio_match, dvbox_intio_attach
};
@@ -211,10 +215,9 @@ dv_init(gp, scode, addr)
int scode;
caddr_t addr;
{
- register struct dvboxfb *dbp;
+ struct dvboxfb *dbp;
struct grfinfo *gi = &gp->g_display;
int fboff;
- extern caddr_t iomap();
/*
* If the console has been initialized, and it was us, there's
@@ -237,7 +240,7 @@ dv_init(gp, scode, addr)
* For DIO II space the fbaddr just computed is
* the offset from the select code base (regaddr)
* of the framebuffer. Hence it is also implicitly
- * the size of the register set.
+ * the size of the set.
*/
gi->gd_regsize = (int) gi->gd_fbaddr;
gi->gd_fbaddr += (int) gi->gd_regaddr;
@@ -323,7 +326,7 @@ dv_mode(gp, cmd, data)
int cmd;
caddr_t data;
{
- register struct dvboxfb *dbp;
+ struct dvboxfb *dbp;
int error = 0;
dbp = (struct dvboxfb *) gp->g_regkva;
@@ -412,7 +415,7 @@ dv_mode(gp, cmd, data)
void
dvbox_init(ip)
- register struct ite_data *ip;
+ struct ite_data *ip;
{
int i;
@@ -509,7 +512,7 @@ dvbox_init(ip)
void
dvbox_deinit(ip)
- register struct ite_data *ip;
+ struct ite_data *ip;
{
dvbox_windowmove(ip, 0, 0, 0, 0, ip->fbheight, ip->fbwidth, RR_CLEAR);
db_waitbusy(ip->regbase);
@@ -522,7 +525,7 @@ dvbox_putc(ip, c, dy, dx, mode)
struct ite_data *ip;
int dy, dx, c, mode;
{
- register int wrr = ((mode == ATTR_INV) ? RR_COPYINVERTED : RR_COPY);
+ int wrr = ((mode == ATTR_INV) ? RR_COPYINVERTED : RR_COPY);
dvbox_windowmove(ip, charY(ip, c), charX(ip, c),
dy * ip->ftheight, dx * ip->ftwidth,
@@ -560,10 +563,10 @@ dvbox_scroll(ip, sy, sx, count, dir)
struct ite_data *ip;
int sy, count, dir, sx;
{
- register int dy;
- register int dx = sx;
- register int height = 1;
- register int width = ip->cols;
+ int dy;
+ int dx = sx;
+ int height = 1;
+ int width = ip->cols;
if (dir == SCROLL_UP) {
dy = sy - count;
@@ -595,7 +598,7 @@ dvbox_windowmove(ip, sy, sx, dy, dx, h, w, func)
struct ite_data *ip;
int sy, sx, dy, dx, h, w, func;
{
- register struct dvboxfb *dp = REGBASE;
+ struct dvboxfb *dp = REGBASE;
if (h == 0 || w == 0)
return;
diff --git a/sys/arch/hp300/dev/grf_gb.c b/sys/arch/hp300/dev/grf_gb.c
index 7d11b1bc48d..4e1b70161f6 100644
--- a/sys/arch/hp300/dev/grf_gb.c
+++ b/sys/arch/hp300/dev/grf_gb.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: grf_gb.c,v 1.5 1997/02/05 16:01:11 downsj Exp $ */
-/* $NetBSD: grf_gb.c,v 1.10 1997/01/30 09:18:45 thorpej Exp $ */
+/* $OpenBSD: grf_gb.c,v 1.6 1997/04/16 11:56:03 downsj Exp $ */
+/* $NetBSD: grf_gb.c,v 1.11 1997/03/31 07:34:15 scottr Exp $ */
/*
* Copyright (c) 1996 Jason R. Thorpe. All rights reserved.
@@ -52,13 +52,13 @@
* (as in 9837 Gator systems)
*/
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/conf.h>
+#include <sys/device.h>
#include <sys/errno.h>
-#include <sys/proc.h>
#include <sys/ioctl.h>
+#include <sys/proc.h>
#include <sys/tty.h>
-#include <sys/systm.h>
-#include <sys/device.h>
#include <machine/autoconf.h>
#include <machine/cpu.h>
@@ -95,6 +95,10 @@ void gbox_intio_attach __P((struct device *, struct device *, void *));
int gbox_dio_match __P((struct device *, void *, void *));
void gbox_dio_attach __P((struct device *, struct device *, void *));
+int gbox_console_scan __P((int, caddr_t, void *));
+void gboxcnprobe __P((struct consdev *cp));
+void gboxcninit __P((struct consdev *cp));
+
struct cfattach gbox_intio_ca = {
sizeof(struct grfdev_softc), gbox_intio_match, gbox_intio_attach
};
@@ -221,11 +225,10 @@ gb_init(gp, scode, addr)
int scode;
caddr_t addr;
{
- register struct gboxfb *gbp;
+ struct gboxfb *gbp;
struct grfinfo *gi = &gp->g_display;
u_char *fbp, save;
int fboff;
- extern caddr_t iomap();
/*
* If the console has been initialized, and it was us, there's
@@ -249,7 +252,7 @@ gb_init(gp, scode, addr)
gi->gd_dheight = 768; /* XXX */
gi->gd_planes = 0; /* how do we do this? */
/*
- * The minimal register info here is from the Gatorbox X driver.
+ * The minimal info here is from the Gatorbox X driver.
*/
fbp = (u_char *) gp->g_fbkva;
gbp->write_protect = 0;
@@ -280,7 +283,7 @@ void
gb_microcode(gbp)
struct gboxfb *gbp;
{
- register int i;
+ int i;
for (i = 0; i < CRTC_DATA_LENGTH; i++) {
gbp->crtc_address = i;
@@ -295,7 +298,7 @@ gb_microcode(gbp)
*/
int
gb_mode(gp, cmd, data)
- register struct grf_data *gp;
+ struct grf_data *gp;
int cmd;
caddr_t data;
{
@@ -378,7 +381,7 @@ gb_mode(gp, cmd, data)
void
gbox_init(ip)
- register struct ite_data *ip;
+ struct ite_data *ip;
{
/* XXX */
if (ip->regbase == 0) {
@@ -460,7 +463,7 @@ gbox_putc(ip, c, dy, dx, mode)
int dy, dx;
int c, mode;
{
- register int wrr = ((mode == ATTR_INV) ? RR_COPYINVERTED : RR_COPY);
+ int wrr = ((mode == ATTR_INV) ? RR_COPYINVERTED : RR_COPY);
gbox_windowmove(ip, charY(ip, c), charX(ip, c),
dy * ip->ftheight, dx * ip->ftwidth,
@@ -507,7 +510,7 @@ gbox_scroll(ip, sy, sx, count, dir)
struct ite_data *ip;
int sy, dir, sx, count;
{
- register int height, dy, i;
+ int height, dy, i;
tile_mover_waitbusy(ip->regbase);
REGBASE->write_protect = 0x0;
@@ -539,7 +542,7 @@ gbox_windowmove(ip, sy, sx, dy, dx, h, w, mask)
struct ite_data *ip;
int sy, sx, dy, dx, mask, h, w;
{
- register int src, dest;
+ int src, dest;
src = (sy * 1024) + sx; /* upper left corner in pixels */
dest = (dy * 1024) + dx;
diff --git a/sys/arch/hp300/dev/grf_hy.c b/sys/arch/hp300/dev/grf_hy.c
index b73a68406db..354d12ae6cf 100644
--- a/sys/arch/hp300/dev/grf_hy.c
+++ b/sys/arch/hp300/dev/grf_hy.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: grf_hy.c,v 1.5 1997/02/05 16:01:12 downsj Exp $ */
-/* $NetBSD: grf_hy.c,v 1.8 1997/01/30 09:18:47 thorpej Exp $ */
+/* $OpenBSD: grf_hy.c,v 1.6 1997/04/16 11:56:04 downsj Exp $ */
+/* $NetBSD: grf_hy.c,v 1.9 1997/03/31 07:34:16 scottr Exp $ */
/*
* Copyright (c) 1996 Jason R. Thorpe. All rights reserved.
@@ -49,14 +49,14 @@
* Graphics routines for HYPERION frame buffer
*/
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/conf.h>
+#include <sys/device.h>
#include <sys/errno.h>
-#include <sys/proc.h>
#include <sys/ioctl.h>
+#include <sys/proc.h>
#include <sys/tty.h>
-#include <sys/systm.h>
#include <sys/uio.h>
-#include <sys/device.h>
#include <machine/autoconf.h>
#include <machine/cpu.h>
@@ -86,6 +86,10 @@ void hyper_ite_fontinit __P((struct ite_data *));
int hyper_dio_match __P((struct device *, void *, void *));
void hyper_dio_attach __P((struct device *, struct device *, void *));
+int hyper_console_scan __P((int, caddr_t, void *));
+void hypercnprobe __P((struct consdev *cp));
+void hypercninit __P((struct consdev *cp));
+
struct cfattach hyper_dio_ca = {
sizeof(struct grfdev_softc), hyper_dio_match, hyper_dio_attach
};
@@ -170,10 +174,9 @@ hy_init(gp, scode, addr)
int scode;
caddr_t addr;
{
- register struct hyboxfb *hy = (struct hyboxfb *) addr;
+ struct hyboxfb *hy = (struct hyboxfb *) addr;
struct grfinfo *gi = &gp->g_display;
int fboff;
- extern caddr_t iomap();
/*
* If the console has been initialized, and it was us, there's
@@ -359,7 +362,7 @@ void
hyper_ite_fontinit(ip)
struct ite_data *ip;
{
- register u_char *fbmem, *dp;
+ u_char *fbmem, *dp;
int c, l, b;
int stride, width;
@@ -427,10 +430,10 @@ hyper_scroll(ip, sy, sx, count, dir)
struct ite_data *ip;
int sy, count, dir, sx;
{
- register int dy;
- register int dx = sx;
- register int height = 1;
- register int width = ip->cols;
+ int dy;
+ int dx = sx;
+ int height = 1;
+ int width = ip->cols;
if (dir == SCROLL_UP) {
dy = sy - count;
@@ -546,16 +549,16 @@ hyper_windowmove(ip, sy, sx, dy, dx, h, w, func)
unsigned int *psrcLine, *pdstLine;
/* pointers to line with current src and dst */
- register unsigned int *psrc; /* pointer to current src longword */
- register unsigned int *pdst; /* pointer to current dst longword */
+ unsigned int *psrc; /* pointer to current src longword */
+ unsigned int *pdst; /* pointer to current dst longword */
/* following used for looping through a line */
unsigned int startmask, endmask; /* masks for writing ends of dst */
int nlMiddle; /* whole longwords in dst */
- register int nl; /* temp copy of nlMiddle */
- register unsigned int tmpSrc;
+ int nl; /* temp copy of nlMiddle */
+ unsigned int tmpSrc;
/* place to store full source word */
- register int xoffSrc; /* offset (>= 0, < 32) from which to
+ int xoffSrc; /* offset (>= 0, < 32) from which to
fetch whole longwords fetched
in src */
int nstart; /* number of ragged bits at start of dst */
@@ -667,8 +670,8 @@ hyper_windowmove(ip, sy, sx, dy, dx, h, w, func)
}
else /* move right to left */
{
- pdstLine += (dx+w >> 5);
- psrcLine += (sx+w >> 5);
+ pdstLine += ((dx + w) >> 5);
+ psrcLine += ((sx + w) >> 5);
/* if fetch of last partial bits from source crosses
a longword boundary, start at the previous longword
*/
diff --git a/sys/arch/hp300/dev/grf_rb.c b/sys/arch/hp300/dev/grf_rb.c
index 68beb5b2dce..ff57dfb2091 100644
--- a/sys/arch/hp300/dev/grf_rb.c
+++ b/sys/arch/hp300/dev/grf_rb.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: grf_rb.c,v 1.5 1997/02/05 16:01:14 downsj Exp $ */
-/* $NetBSD: grf_rb.c,v 1.10 1997/01/30 09:18:48 thorpej Exp $ */
+/* $OpenBSD: grf_rb.c,v 1.6 1997/04/16 11:56:04 downsj Exp $ */
+/* $NetBSD: grf_rb.c,v 1.11 1997/03/31 07:34:17 scottr Exp $ */
/*
* Copyright (c) 1996 Jason R. Thorpe. All rights reserved.
@@ -48,13 +48,13 @@
* Graphics routines for the Renaissance, HP98720 Graphics system.
*/
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/conf.h>
+#include <sys/device.h>
#include <sys/errno.h>
-#include <sys/proc.h>
#include <sys/ioctl.h>
+#include <sys/proc.h>
#include <sys/tty.h>
-#include <sys/systm.h>
-#include <sys/device.h>
#include <machine/autoconf.h>
#include <machine/cpu.h>
@@ -84,6 +84,10 @@ void rbox_intio_attach __P((struct device *, struct device *, void *));
int rbox_dio_match __P((struct device *, void *, void *));
void rbox_dio_attach __P((struct device *, struct device *, void *));
+int rbox_console_scan __P((int, caddr_t, void *));
+void rboxcnprobe __P((struct consdev *cp));
+void rboxcninit __P((struct consdev *cp));
+
struct cfattach rbox_intio_ca = {
sizeof(struct grfdev_softc), rbox_intio_match, rbox_intio_attach
};
@@ -210,10 +214,9 @@ rb_init(gp, scode, addr)
int scode;
caddr_t addr;
{
- register struct rboxfb *rbp;
+ struct rboxfb *rbp;
struct grfinfo *gi = &gp->g_display;
int fboff;
- extern caddr_t iomap();
/*
* If the console has been initialized, and it was us, there's
@@ -236,7 +239,7 @@ rb_init(gp, scode, addr)
* For DIO II space the fbaddr just computed is
* the offset from the select code base (regaddr)
* of the framebuffer. Hence it is also implicitly
- * the size of the register set.
+ * the size of the set.
*/
gi->gd_regsize = (int) gi->gd_fbaddr;
gi->gd_fbaddr += (int) gi->gd_regaddr;
@@ -265,17 +268,17 @@ rb_init(gp, scode, addr)
*/
int
rb_mode(gp, cmd, data)
- register struct grf_data *gp;
+ struct grf_data *gp;
int cmd;
caddr_t data;
{
- register struct rboxfb *rbp;
+ struct rboxfb *rbp;
int error = 0;
rbp = (struct rboxfb *) gp->g_regkva;
switch (cmd) {
/*
- * The minimal register info here is from the Renaissance X driver.
+ * The minimal info here is from the Renaissance X driver.
*/
case GM_GRFON:
case GM_GRFOFF:
@@ -362,7 +365,7 @@ void
rbox_init(ip)
struct ite_data *ip;
{
- register int i;
+ int i;
/* XXX */
if (ip->regbase == 0) {
@@ -469,7 +472,7 @@ rbox_putc(ip, c, dy, dx, mode)
struct ite_data *ip;
int dy, dx, c, mode;
{
- register int wrr = ((mode == ATTR_INV) ? RR_COPYINVERTED : RR_COPY);
+ int wrr = ((mode == ATTR_INV) ? RR_COPYINVERTED : RR_COPY);
rbox_windowmove(ip, charY(ip, c), charX(ip, c),
dy * ip->ftheight, dx * ip->ftwidth,
@@ -507,10 +510,10 @@ rbox_scroll(ip, sy, sx, count, dir)
struct ite_data *ip;
int sy, count, dir, sx;
{
- register int dy;
- register int dx = sx;
- register int height = 1;
- register int width = ip->cols;
+ int dy;
+ int dx = sx;
+ int height = 1;
+ int width = ip->cols;
if (dir == SCROLL_UP) {
dy = sy - count;
@@ -542,7 +545,7 @@ rbox_windowmove(ip, sy, sx, dy, dx, h, w, func)
struct ite_data *ip;
int sy, sx, dy, dx, h, w, func;
{
- register struct rboxfb *rp = REGBASE;
+ struct rboxfb *rp = REGBASE;
if (h == 0 || w == 0)
return;
diff --git a/sys/arch/hp300/dev/grf_subr.c b/sys/arch/hp300/dev/grf_subr.c
index 6798b8051ea..19f11c0d058 100644
--- a/sys/arch/hp300/dev/grf_subr.c
+++ b/sys/arch/hp300/dev/grf_subr.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: grf_subr.c,v 1.4 1997/02/05 16:01:15 downsj Exp $ */
-/* $NetBSD: grf_subr.c,v 1.3 1997/01/31 21:16:50 carrel Exp $ */
+/* $OpenBSD: grf_subr.c,v 1.5 1997/04/16 11:56:05 downsj Exp $ */
+/* $NetBSD: grf_subr.c,v 1.4 1997/03/31 07:34:18 scottr Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -118,7 +118,7 @@ grfdevprint(aux, pnp)
void *aux;
const char *pnp;
{
- struct grfdev_attach_args *ga = aux;
+ /* struct grfdev_attach_args *ga = aux; */
/* Only grf's can attach to grfdev's... easy. */
if (pnp)
diff --git a/sys/arch/hp300/dev/grf_tc.c b/sys/arch/hp300/dev/grf_tc.c
index c5093815de7..2fdd1c56b17 100644
--- a/sys/arch/hp300/dev/grf_tc.c
+++ b/sys/arch/hp300/dev/grf_tc.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: grf_tc.c,v 1.5 1997/02/05 16:01:16 downsj Exp $ */
-/* $NetBSD: grf_tc.c,v 1.10 1997/01/30 09:18:50 thorpej Exp $ */
+/* $OpenBSD: grf_tc.c,v 1.6 1997/04/16 11:56:05 downsj Exp $ */
+/* $NetBSD: grf_tc.c,v 1.11 1997/03/31 07:34:18 scottr Exp $ */
/*
* Copyright (c) 1996 Jason R. Thorpe. All rights reserved.
@@ -86,6 +86,10 @@ void topcat_intio_attach __P((struct device *, struct device *, void *));
int topcat_dio_match __P((struct device *, void *, void *));
void topcat_dio_attach __P((struct device *, struct device *, void *));
+int topcat_console_scan __P((int, caddr_t, void *));
+void topcatcnprobe __P((struct consdev *cp));
+void topcatcninit __P((struct consdev *cp));
+
struct cfattach topcat_intio_ca = {
sizeof(struct grfdev_softc), topcat_intio_match, topcat_intio_attach
};
@@ -279,7 +283,7 @@ tc_init(gp, scode, addr)
int scode;
caddr_t addr;
{
- register struct tcboxfb *tp = (struct tcboxfb *) addr;
+ struct tcboxfb *tp = (struct tcboxfb *) addr;
struct grfinfo *gi = &gp->g_display;
volatile u_char *fbp;
u_char save;
@@ -305,7 +309,7 @@ tc_init(gp, scode, addr)
* For DIO II space the fbaddr just computed is the
* offset from the select code base (regaddr) of the
* framebuffer. Hence it is also implicitly the
- * size of the register set.
+ * size of the set.
*/
gi->gd_regsize = (int) gi->gd_fbaddr;
gi->gd_fbaddr += (int) gi->gd_regaddr;
@@ -604,10 +608,10 @@ topcat_scroll(ip, sy, sx, count, dir)
struct ite_data *ip;
int sy, count, dir, sx;
{
- register int dy;
- register int dx = sx;
- register int height = 1;
- register int width = ip->cols;
+ int dy;
+ int dx = sx;
+ int height = 1;
+ int width = ip->cols;
if (dir == SCROLL_UP) {
dy = sy - count;
@@ -639,7 +643,7 @@ topcat_windowmove(ip, sy, sx, dy, dx, h, w, func)
struct ite_data *ip;
int sy, sx, dy, dx, h, w, func;
{
- register struct tcboxfb *rp = REGBASE;
+ struct tcboxfb *rp = REGBASE;
if (h == 0 || w == 0)
return;
diff --git a/sys/arch/hp300/dev/grfvar.h b/sys/arch/hp300/dev/grfvar.h
index 5eaa0d3fe3c..0da88462c8c 100644
--- a/sys/arch/hp300/dev/grfvar.h
+++ b/sys/arch/hp300/dev/grfvar.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: grfvar.h,v 1.5 1997/02/05 16:01:17 downsj Exp $ */
-/* $NetBSD: grfvar.h,v 1.9 1997/01/30 09:18:51 thorpej Exp $ */
+/* $OpenBSD: grfvar.h,v 1.6 1997/04/16 11:56:06 downsj Exp $ */
+/* $NetBSD: grfvar.h,v 1.10 1997/03/31 07:34:19 scottr Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -126,6 +126,30 @@ struct grfdev_attach_args {
#ifdef _KERNEL
extern struct grf_data grf_cn; /* grf_data for console device */
+/* grf.c prototypes */
+int grfmap __P((dev_t, caddr_t *, struct proc *));
+int grfunmap __P((dev_t, caddr_t, struct proc *));
+int grfon __P((dev_t));
+int grfoff __P((dev_t));
+int grfaddr __P((struct grf_softc *, int));
+
+#ifdef COMPAT_HPUX
+int hpuxgrfioctl __P((dev_t, int, caddr_t, int, struct proc *));
+
+int grflock __P((struct grf_data *, int));
+int grfunlock __P((struct grf_data *));
+int grfdevno __P((dev_t));
+
+int iommap __P((dev_t, caddr_t *));
+int iounmmap __P((dev_t, caddr_t));
+
+int grffindpid __P((struct grf_data *));
+void grfrmpid __P((struct grf_data *));
+int grflckmmap __P((dev_t, caddr_t *));
+int grflckunmmap __P((dev_t, caddr_t));
+#endif /* COMPAT_HPUX */
+
+/* grf_subr.c prototypes */
struct itesw;
void grfdev_attach __P((struct grfdev_softc *,
int (*init)(struct grf_data *, int, caddr_t),
diff --git a/sys/arch/hp300/dev/hd.c b/sys/arch/hp300/dev/hd.c
index bac8b463b4e..7c2b3966638 100644
--- a/sys/arch/hp300/dev/hd.c
+++ b/sys/arch/hp300/dev/hd.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: hd.c,v 1.3 1997/02/10 06:43:32 downsj Exp $ */
-/* $NetBSD: rd.c,v 1.27 1997/01/30 09:14:17 thorpej Exp $ */
+/* $OpenBSD: hd.c,v 1.4 1997/04/16 11:56:06 downsj Exp $ */
+/* $NetBSD: rd.c,v 1.30 1997/04/09 20:01:04 thorpej Exp $ */
/*
* Copyright (c) 1996, 1997 Jason R. Thorpe. All rights reserved.
@@ -51,13 +51,14 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/buf.h>
-#include <sys/stat.h>
-#include <sys/disklabel.h>
+#include <sys/conf.h>
+#include <sys/device.h>
#include <sys/disk.h>
-#include <sys/ioctl.h>
+#include <sys/disklabel.h>
#include <sys/fcntl.h>
-#include <sys/device.h>
-#include <sys/conf.h>
+#include <sys/ioctl.h>
+#include <sys/proc.h>
+#include <sys/stat.h>
#include <hp300/dev/hpibvar.h>
@@ -73,32 +74,6 @@
#include <vm/vm_prot.h>
#include <vm/pmap.h>
-int hdmatch __P((struct device *, void *, void *));
-void hdattach __P((struct device *, struct device *, void *));
-
-struct cfattach hd_ca = {
- sizeof(struct hd_softc), hdmatch, hdattach
-};
-
-struct cfdriver hd_cd = {
- NULL, "hd", DV_DISK
-};
-
-int hdident __P((struct device *, struct hd_softc *,
- struct hpibbus_attach_args *));
-void hdreset __P((struct hd_softc *));
-void hdustart __P((struct hd_softc *));
-int hdgetinfo __P((dev_t));
-void hdrestart __P((void *));
-struct buf *hdfinish __P((struct hd_softc *, struct buf *));
-
-void hdstart __P((void *));
-void hdinterupt __P((void *));
-void hdgo __P((void *));
-
-bdev_decl(hd);
-cdev_decl(hd);
-
int hderrthresh = HDRETRY-1; /* when to start reporting errors */
#ifdef DEBUG
@@ -242,6 +217,37 @@ struct hdidentinfo hdidentinfo[] = {
};
int numhdidentinfo = sizeof(hdidentinfo) / sizeof(hdidentinfo[0]);
+bdev_decl(hd);
+cdev_decl(hd);
+
+int hdident __P((struct device *, struct hd_softc *,
+ struct hpibbus_attach_args *));
+void hdreset __P((struct hd_softc *));
+void hdustart __P((struct hd_softc *));
+int hdgetinfo __P((dev_t));
+void hdrestart __P((void *));
+struct buf *hdfinish __P((struct hd_softc *, struct buf *));
+
+void hdstart __P((void *));
+void hdinterupt __P((void *));
+void hdgo __P((void *));
+int hdstatus __P((struct hd_softc *));
+int hderror __P((int));
+#ifdef DEBUG
+void hdprinterr __P((char *, short, char **));
+#endif
+
+int hdmatch __P((struct device *, void *, void *));
+void hdattach __P((struct device *, struct device *, void *));
+
+struct cfattach hd_ca = {
+ sizeof(struct hd_softc), hdmatch, hdattach
+};
+
+struct cfdriver hd_cd = {
+ NULL, "hd", DV_DISK
+};
+
int
hdmatch(parent, match, aux)
struct device *parent;
@@ -318,7 +324,6 @@ hdident(parent, sc, ha)
struct hd_softc *sc;
struct hpibbus_attach_args *ha;
{
- struct hd_softc rsc;
struct hd_describe *desc = sc != NULL ? &sc->sc_hddesc : NULL;
u_char stat, cmd[3];
char name[7];
@@ -430,7 +435,7 @@ hdident(parent, sc, ha)
void
hdreset(rs)
- register struct hd_softc *rs;
+ struct hd_softc *rs;
{
int ctlr = rs->sc_dev.dv_parent->dv_unit;
int slave = rs->sc_slave;
@@ -473,9 +478,9 @@ hdgetinfo(dev)
{
int unit = hdunit(dev);
struct hd_softc *rs = hd_cd.cd_devs[unit];
- register struct disklabel *lp = rs->sc_dkdev.dk_label;
- register struct partition *pi;
- char *msg, *readdisklabel();
+ struct disklabel *lp = rs->sc_dkdev.dk_label;
+ struct partition *pi;
+ char *msg;
/*
* Set some default values to use while reading the label
@@ -497,7 +502,7 @@ hdgetinfo(dev)
*/
msg = readdisklabel(hdlabdev(dev), hdstrategy, lp, NULL);
if (msg == NULL)
- return(0);
+ return (0);
pi = lp->d_partitions;
printf("%s: WARNING: %s, defining `c' partition as entire disk\n",
@@ -515,8 +520,8 @@ hdopen(dev, flags, mode, p)
int flags, mode;
struct proc *p;
{
- register int unit = hdunit(dev);
- register struct hd_softc *rs;
+ int unit = hdunit(dev);
+ struct hd_softc *rs;
int error, mask, part;
if (unit >= hd_cd.cd_ndevs ||
@@ -576,7 +581,7 @@ hdclose(dev, flag, mode, p)
{
int unit = hdunit(dev);
struct hd_softc *rs = hd_cd.cd_devs[unit];
- register struct disk *dk = &rs->sc_dkdev;
+ struct disk *dk = &rs->sc_dkdev;
int mask, s;
mask = 1 << hdpart(dev);
@@ -608,19 +613,19 @@ hdclose(dev, flag, mode, p)
void
hdstrategy(bp)
- register struct buf *bp;
+ struct buf *bp;
{
int unit = hdunit(bp->b_dev);
struct hd_softc *rs = hd_cd.cd_devs[unit];
- register struct buf *dp = &rs->sc_tab;
- register struct partition *pinfo;
- register daddr_t bn;
- register int sz, s;
+ struct buf *dp = &rs->sc_tab;
+ struct partition *pinfo;
+ daddr_t bn;
+ int sz, s;
int offset;
#ifdef DEBUG
if (hddebug & HDB_FOLLOW)
- printf("hdstrategy(%x): dev %x, bn %x, bcount %x, %c\n",
+ printf("hdstrategy(%x): dev %x, bn %x, bcount %lx, %c\n",
bp, bp->b_dev, bp->b_blkno, bp->b_bcount,
(bp->b_flags & B_READ) ? 'R' : 'W');
#endif
@@ -692,7 +697,7 @@ void
hdustart(rs)
struct hd_softc *rs;
{
- register struct buf *bp;
+ struct buf *bp;
bp = rs->sc_tab.b_actf;
rs->sc_addr = bp->b_un.b_addr;
@@ -703,10 +708,10 @@ hdustart(rs)
struct buf *
hdfinish(rs, bp)
- register struct hd_softc *rs;
- register struct buf *bp;
+ struct hd_softc *rs;
+ struct buf *bp;
{
- register struct buf *dp = &rs->sc_tab;
+ struct buf *dp = &rs->sc_tab;
dp->b_errcnt = 0;
dp->b_actf = bp->b_actf;
@@ -728,8 +733,8 @@ hdstart(arg)
void *arg;
{
struct hd_softc *rs = arg;
- register struct buf *bp = rs->sc_tab.b_actf;
- register int part, ctlr, slave;
+ struct buf *bp = rs->sc_tab.b_actf;
+ int part, ctlr, slave;
ctlr = rs->sc_dev.dv_parent->dv_unit;
slave = rs->sc_slave;
@@ -737,7 +742,7 @@ hdstart(arg)
again:
#ifdef DEBUG
if (hddebug & HDB_FOLLOW)
- printf("hdstart(%s): bp %x, %c\n", sc->sc_dev.dv_xname, bp,
+ printf("hdstart(%s): bp %p, %c\n", rs->sc_dev.dv_xname, bp,
(bp->b_flags & B_READ) ? 'R' : 'W');
#endif
part = hdpart(bp->b_dev);
@@ -753,7 +758,7 @@ again:
rs->sc_ioc.c_cmd = bp->b_flags & B_READ ? C_READ : C_WRITE;
#ifdef DEBUG
if (hddebug & HDB_IO)
- printf("hdstart: hpibsend(%x, %x, %x, %x, %x)\n",
+ printf("hdstart: hpibsend(%x, %x, %x, %p, %x)\n",
ctlr, slave, C_CMD,
&rs->sc_ioc.c_unit, sizeof(rs->sc_ioc)-2);
#endif
@@ -779,7 +784,7 @@ again:
*/
#ifdef DEBUG
if (hddebug & HDB_ERROR)
- printf("%s: hdstart: cmd %x adr %d blk %d len %d ecnt %d\n",
+ printf("%s: hdstart: cmd %x adr %lx blk %d len %d ecnt %ld\n",
rs->sc_dev.dv_xname, rs->sc_ioc.c_cmd, rs->sc_ioc.c_addr,
bp->b_blkno, rs->sc_resid, rs->sc_tab.b_errcnt);
rs->sc_stats.hdretries++;
@@ -788,7 +793,7 @@ again:
hdreset(rs);
if (rs->sc_tab.b_errcnt++ < HDRETRY)
goto again;
- printf("%s: hdstart err: cmd 0x%x sect %d blk %d len %d\n",
+ printf("%s: hdstart err: err: cmd 0x%x sect %ld blk %d len %d\n",
rs->sc_dev.dv_xname, rs->sc_ioc.c_cmd, rs->sc_ioc.c_addr,
bp->b_blkno, rs->sc_resid);
bp->b_flags |= B_ERROR;
@@ -830,9 +835,9 @@ void
hdinterupt(arg)
void *arg;
{
- register struct hd_softc *rs = arg;
+ struct hd_softc *rs = arg;
int unit = rs->sc_dev.dv_unit;
- register struct buf *bp = rs->sc_tab.b_actf;
+ struct buf *bp = rs->sc_tab.b_actf;
u_char stat = 13; /* in case hpibrecv fails */
int rv, restart, ctlr, slave;
@@ -841,7 +846,7 @@ hdinterupt(arg)
#ifdef DEBUG
if (hddebug & HDB_FOLLOW)
- printf("hdinterupt(%d): bp %x, %c, flags %x\n", unit, bp,
+ printf("hdinterupt(%d): bp %p, %c, flags %x\n", unit, bp,
(bp->b_flags & B_READ) ? 'R' : 'W', rs->sc_flags);
if (bp == NULL) {
printf("%s: bp == NULL\n", rs->sc_dev.dv_xname);
@@ -897,9 +902,9 @@ hdinterupt(arg)
int
hdstatus(rs)
- register struct hd_softc *rs;
+ struct hd_softc *rs;
{
- register int c, s;
+ int c, s;
u_char stat;
int rv;
@@ -950,7 +955,7 @@ hderror(unit)
int unit;
{
struct hd_softc *rs = hd_cd.cd_devs[unit];
- register struct hd_stat *sp;
+ struct hd_stat *sp;
struct buf *bp;
daddr_t hwbn, pbn;
@@ -1034,28 +1039,28 @@ hderror(unit)
hdprinterr("access", sp->c_aef, err_access);
hdprinterr("info", sp->c_ief, err_info);
printf(" block: %d, P1-P10: ", hwbn);
- printf("%s", hexstr(*(u_int *)&sp->c_raw[0], 8));
- printf("%s", hexstr(*(u_int *)&sp->c_raw[4], 8));
- printf("%s\n", hexstr(*(u_short *)&sp->c_raw[8], 4));
+ printf("0x%x", *(u_int *)&sp->c_raw[0]);
+ printf("0x%x", *(u_int *)&sp->c_raw[4]);
+ printf("0x%x\n", *(u_short *)&sp->c_raw[8]);
/* command */
printf(" ioc: ");
- printf("%s", hexstr(*(u_int *)&rs->sc_ioc.c_pad, 8));
- printf("%s", hexstr(*(u_short *)&rs->sc_ioc.c_hiaddr, 4));
- printf("%s", hexstr(*(u_int *)&rs->sc_ioc.c_addr, 8));
- printf("%s", hexstr(*(u_short *)&rs->sc_ioc.c_nop2, 4));
- printf("%s", hexstr(*(u_int *)&rs->sc_ioc.c_len, 8));
- printf("%s\n", hexstr(*(u_short *)&rs->sc_ioc.c_cmd, 4));
- return(1);
+ printf("0x%x", *(u_int *)&rs->sc_ioc.c_pad);
+ printf("0x%x", *(u_short *)&rs->sc_ioc.c_hiaddr);
+ printf("0x%x", *(u_int *)&rs->sc_ioc.c_addr);
+ printf("0x%x", *(u_short *)&rs->sc_ioc.c_nop2);
+ printf("0x%x", *(u_int *)&rs->sc_ioc.c_len);
+ printf("0x%x\n", *(u_short *)&rs->sc_ioc.c_cmd);
+ return (1);
}
#endif
printf(" v%d u%d, R0x%x F0x%x A0x%x I0x%x\n",
(sp->c_vu>>4)&0xF, sp->c_vu&0xF,
sp->c_ref, sp->c_fef, sp->c_aef, sp->c_ief);
printf("P1-P10: ");
- printf("%s", hexstr(*(u_int *)&sp->c_raw[0], 8));
- printf("%s", hexstr(*(u_int *)&sp->c_raw[4], 8));
- printf("%s\n", hexstr(*(u_short *)&sp->c_raw[8], 4));
- return(1);
+ printf("0x%x", *(u_int *)&sp->c_raw[0]);
+ printf("0x%x", *(u_int *)&sp->c_raw[4]);
+ printf("0x%x\n", *(u_short *)&sp->c_raw[8]);
+ return (1);
}
int
@@ -1088,7 +1093,7 @@ hdioctl(dev, cmd, data, flag, p)
{
int unit = hdunit(dev);
struct hd_softc *sc = hd_cd.cd_devs[unit];
- register struct disklabel *lp = sc->sc_dkdev.dk_label;
+ struct disklabel *lp = sc->sc_dkdev.dk_label;
int error, flags;
switch (cmd) {
@@ -1142,7 +1147,7 @@ int
hdsize(dev)
dev_t dev;
{
- register int unit = hdunit(dev);
+ int unit = hdunit(dev);
struct hd_softc *rs;
int psize, didopen = 0;
@@ -1168,17 +1173,18 @@ hdsize(dev)
}
#ifdef DEBUG
+void
hdprinterr(str, err, tab)
char *str;
short err;
- char *tab[];
+ char **tab;
{
- register int i;
+ int i;
int printed;
if (err == 0)
return;
- printf(" %s error field:", str, err);
+ printf(" %s error %d field:", str, err);
printed = 0;
for (i = 0; i < 16; i++)
if (err & (0x8000 >> i))
diff --git a/sys/arch/hp300/dev/hil.c b/sys/arch/hp300/dev/hil.c
index 8817d393416..394529dd3d0 100644
--- a/sys/arch/hp300/dev/hil.c
+++ b/sys/arch/hp300/dev/hil.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: hil.c,v 1.9 1997/03/26 08:32:39 downsj Exp $ */
-/* $NetBSD: hil.c,v 1.29 1996/10/14 07:09:41 thorpej Exp $ */
+/* $OpenBSD: hil.c,v 1.10 1997/04/16 11:56:07 downsj Exp $ */
+/* $NetBSD: hil.c,v 1.34 1997/04/02 22:37:32 scottr Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -44,19 +44,21 @@
*/
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/conf.h>
-#include <sys/proc.h>
-#include <sys/user.h>
-#include <sys/ioctl.h>
+#include <sys/device.h>
#include <sys/file.h>
+#include <sys/ioctl.h>
+#include <sys/kernel.h>
+#include <sys/proc.h>
#include <sys/tty.h>
-#include <sys/systm.h>
#include <sys/uio.h>
-#include <sys/kernel.h>
+#include <sys/user.h>
#include <hp300/dev/hilreg.h>
#include <hp300/dev/hilioctl.h>
#include <hp300/dev/hilvar.h>
+#include <hp300/dev/itevar.h>
#include <hp300/dev/kbdmap.h>
#include <machine/cpu.h>
@@ -104,12 +106,37 @@ char **kbd_stringmap;
/* symbolic sleep message strings */
char hilin[] = "hilin";
+cdev_decl(hil);
+
+void hilinfo __P((int));
+void hilconfig __P((struct hil_softc *));
+void hilreset __P((struct hil_softc *));
+void hilbeep __P((struct hil_softc *, struct _hilbell *));
+int hiliddev __P((struct hil_softc *));
+
+void hilint __P((int));
+void hil_process_int __P((struct hil_softc *, u_char, u_char));
+void hilevent __P((struct hil_softc *));
+void hpuxhilevent __P((struct hil_softc *, struct hilloopdev *));
+
+int hilqalloc __P((struct hil_softc *, struct hilqinfo *, struct proc *));
+int hilqfree __P((struct hil_softc *, int, struct proc *));
+int hilqmap __P((struct hil_softc *, int, int, struct proc *));
+int hilqunmap __P((struct hil_softc *, int, int, struct proc *));
+
+#ifdef DEBUG
+void printhilpollbuf __P((struct hil_softc *));
+void printhilcmdbuf __P((struct hil_softc *));
+void hilreport __P((struct hil_softc *));
+#endif /* DEBUG */
+
+void
hilsoftinit(unit, hilbase)
int unit;
struct hil_dev *hilbase;
{
- register struct hil_softc *hilp = &hil_softc[unit];
- register int i;
+ struct hil_softc *hilp = &hil_softc[unit];
+ int i;
/* XXX ITE interface */
extern char us_keymap[], us_shiftmap[], us_ctrlmap[],
@@ -117,7 +144,7 @@ hilsoftinit(unit, hilbase)
#ifdef DEBUG
if (hildebug & HDB_FOLLOW)
- printf("hilsoftinit(%d, %x)\n", unit, hilbase);
+ printf("hilsoftinit(%d, %p)\n", unit, hilbase);
#endif
/*
* Initialize loop information
@@ -155,14 +182,15 @@ hilsoftinit(unit, hilbase)
kbd_stringmap = us_stringmap; /* XXX */
}
+void
hilinit(unit, hilbase)
int unit;
struct hil_dev *hilbase;
{
- register struct hil_softc *hilp = &hil_softc[unit];
+ struct hil_softc *hilp = &hil_softc[unit];
#ifdef DEBUG
if (hildebug & HDB_FOLLOW)
- printf("hilinit(%d, %x)\n", unit, hilbase);
+ printf("hilinit(%d, %p)\n", unit, hilbase);
#endif
/*
* Initialize software (if not already done).
@@ -179,13 +207,14 @@ hilinit(unit, hilbase)
}
/* ARGSUSED */
+int
hilopen(dev, flags, mode, p)
dev_t dev;
int flags, mode;
struct proc *p;
{
- register struct hil_softc *hilp = &hil_softc[HILLOOP(dev)];
- register struct hilloopdev *dptr;
+ struct hil_softc *hilp = &hil_softc[HILLOOP(dev)];
+ struct hilloopdev *dptr;
u_char device = HILUNIT(dev);
int s;
@@ -258,14 +287,15 @@ hilopen(dev, flags, mode, p)
}
/* ARGSUSED */
+int
hilclose(dev, flags, mode, p)
dev_t dev;
int flags, mode;
struct proc *p;
{
- register struct hil_softc *hilp = &hil_softc[HILLOOP(dev)];
- register struct hilloopdev *dptr;
- register int i;
+ struct hil_softc *hilp = &hil_softc[HILLOOP(dev)];
+ struct hilloopdev *dptr;
+ int i;
u_char device = HILUNIT(dev);
char mask, lpctrl;
int s;
@@ -341,13 +371,16 @@ hilclose(dev, flags, mode, p)
/*
* Read interface to HIL device.
*/
-hilread(dev, uio)
+/* ARGSUSED */
+int
+hilread(dev, uio, flag)
dev_t dev;
- register struct uio *uio;
+ struct uio *uio;
+ int flag;
{
struct hil_softc *hilp = &hil_softc[HILLOOP(dev)];
- register struct hilloopdev *dptr;
- register int cc;
+ struct hilloopdev *dptr;
+ int cc;
u_char device = HILUNIT(dev);
u_char buf[HILBUFSIZE];
int error, s;
@@ -374,7 +407,8 @@ hilread(dev, uio)
return(EWOULDBLOCK);
}
dptr->hd_flags |= HIL_ASLEEP;
- if (error = tsleep((caddr_t)dptr, TTIPRI | PCATCH, hilin, 0)) {
+ if ((error = tsleep((caddr_t)dptr,
+ TTIPRI | PCATCH, hilin, 0))) {
(void) spl0();
return (error);
}
@@ -392,26 +426,28 @@ hilread(dev, uio)
return(error);
}
+int
hilioctl(dev, cmd, data, flag, p)
dev_t dev;
- int cmd, flag;
+ u_long cmd;
caddr_t data;
+ int flag;
struct proc *p;
{
- register struct hil_softc *hilp = &hil_softc[HILLOOP(dev)];
+ struct hil_softc *hilp = &hil_softc[HILLOOP(dev)];
char device = HILUNIT(dev);
struct hilloopdev *dptr;
- register int i;
+ int i;
u_char hold;
int error;
#ifdef DEBUG
if (hildebug & HDB_FOLLOW)
- printf("hilioctl(%d): dev %x cmd %x\n",
+ printf("hilioctl(%d): dev %x cmd %lx\n",
p->p_pid, device, cmd);
#endif
- dptr = &hilp->hl_device[device];
+ dptr = &hilp->hl_device[(int)device];
if ((dptr->hd_flags & HIL_ALIVE) == 0)
return (ENODEV);
@@ -513,7 +549,7 @@ hilioctl(dev, cmd, data, flag, p)
break;
case FIONBIO:
- dptr = &hilp->hl_device[device];
+ dptr = &hilp->hl_device[(int)device];
if (*(int *)data)
dptr->hd_flags |= HIL_NOBLOCK;
else
@@ -544,7 +580,7 @@ hilioctl(dev, cmd, data, flag, p)
break;
case HILIOCHPUX:
- dptr = &hilp->hl_device[device];
+ dptr = &hilp->hl_device[(int)device];
dptr->hd_flags |= HIL_READIN;
dptr->hd_flags &= ~HIL_QUEUEIN;
break;
@@ -570,15 +606,16 @@ hilioctl(dev, cmd, data, flag, p)
#ifdef COMPAT_HPUX
/* ARGSUSED */
+int
hpuxhilioctl(dev, cmd, data, flag)
dev_t dev;
int cmd, flag;
caddr_t data;
{
- register struct hil_softc *hilp = &hil_softc[HILLOOP(dev)];
+ struct hil_softc *hilp = &hil_softc[HILLOOP(dev)];
char device = HILUNIT(dev);
struct hilloopdev *dptr;
- register int i;
+ int i;
u_char hold;
hilp->hl_cmdbp = hilp->hl_cmdbuf;
@@ -677,7 +714,7 @@ hpuxhilioctl(dev, cmd, data, flag)
break;
case FIONBIO:
- dptr = &hilp->hl_device[device];
+ dptr = &hilp->hl_device[(int)device];
if (*(int *)data)
dptr->hd_flags |= HIL_NOBLOCK;
else
@@ -697,10 +734,12 @@ hpuxhilioctl(dev, cmd, data, flag)
#endif
/* ARGSUSED */
+int
hilmmap(dev, off, prot)
dev_t dev;
int off, prot;
{
+ return (-1);
}
/*ARGSUSED*/
@@ -710,10 +749,10 @@ hilselect(dev, rw, p)
int rw;
struct proc *p;
{
- register struct hil_softc *hilp = &hil_softc[HILLOOP(dev)];
- register struct hilloopdev *dptr;
- register struct hiliqueue *qp;
- register int mask;
+ struct hil_softc *hilp = &hil_softc[HILLOOP(dev)];
+ struct hilloopdev *dptr;
+ struct hiliqueue *qp;
+ int mask;
int s, device;
if (rw == FWRITE)
@@ -771,6 +810,7 @@ hilselect(dev, rw, p)
}
/*ARGSUSED*/
+void
hilint(unit)
int unit;
{
@@ -779,7 +819,7 @@ hilint(unit)
#else
struct hil_softc *hilp = &hil_softc[unit];
#endif
- register struct hil_dev *hildevice = hilp->hl_addr;
+ struct hil_dev *hildevice = hilp->hl_addr;
u_char c, stat;
stat = READHILSTAT(hildevice);
@@ -789,9 +829,10 @@ hilint(unit)
#include "ite.h"
+void
hil_process_int(hilp, stat, c)
- register struct hil_softc *hilp;
- register u_char stat, c;
+ struct hil_softc *hilp;
+ u_char stat, c;
{
#ifdef DEBUG
if (hildebug & HDB_EVENTS)
@@ -865,13 +906,14 @@ hil_process_int(hilp, stat, c)
#define HQVALID(eq) \
((eq)->size == HEVQSIZE && (eq)->tail >= 0 && (eq)->tail < HEVQSIZE)
+void
hilevent(hilp)
struct hil_softc *hilp;
{
- register struct hilloopdev *dptr = &hilp->hl_device[hilp->hl_actdev];
- register int len, mask, qnum;
- register u_char *cp, *pp;
- register HILQ *hq;
+ struct hilloopdev *dptr = &hilp->hl_device[hilp->hl_actdev];
+ int len, mask, qnum;
+ u_char *cp, *pp;
+ HILQ *hq;
struct timeval ourtime;
hil_packet *proto;
int s, len0;
@@ -960,11 +1002,12 @@ hilevent(hilp)
#undef HQFULL
+void
hpuxhilevent(hilp, dptr)
- register struct hil_softc *hilp;
- register struct hilloopdev *dptr;
+ struct hil_softc *hilp;
+ struct hilloopdev *dptr;
{
- register int len;
+ int len;
struct timeval ourtime;
long tstamp;
int s;
@@ -1004,22 +1047,24 @@ hpuxhilevent(hilp, dptr)
* Shared queue manipulation routines
*/
+int
hilqalloc(hilp, qip, p)
- register struct hil_softc *hilp;
+ struct hil_softc *hilp;
struct hilqinfo *qip;
struct proc *p;
{
#ifdef DEBUG
if (hildebug & HDB_FOLLOW)
- printf("hilqalloc(%d): addr %x\n", p->p_pid, qip->addr);
+ printf("hilqalloc(%d): addr %p\n", p->p_pid, qip->addr);
#endif
return(EINVAL);
}
+int
hilqfree(hilp, qnum, p)
- register struct hil_softc *hilp;
- register int qnum;
+ struct hil_softc *hilp;
+ int qnum;
struct proc *p;
{
@@ -1030,12 +1075,13 @@ hilqfree(hilp, qnum, p)
return(EINVAL);
}
+int
hilqmap(hilp, qnum, device, p)
- register struct hil_softc *hilp;
- register int qnum, device;
+ struct hil_softc *hilp;
+ int qnum, device;
struct proc *p;
{
- register struct hilloopdev *dptr = &hilp->hl_device[device];
+ struct hilloopdev *dptr = &hilp->hl_device[device];
int s;
#ifdef DEBUG
@@ -1066,9 +1112,10 @@ hilqmap(hilp, qnum, device, p)
return(0);
}
+int
hilqunmap(hilp, qnum, device, p)
- register struct hil_softc *hilp;
- register int qnum, device;
+ struct hil_softc *hilp;
+ int qnum, device;
struct proc *p;
{
int s;
@@ -1101,6 +1148,7 @@ hilqunmap(hilp, qnum, device, p)
* per loop. There may be other keyboards, but they will always be "raw".
*/
+void
kbdbell(unit)
int unit;
{
@@ -1109,18 +1157,19 @@ kbdbell(unit)
hilbeep(hilp, &default_bell);
}
+void
kbdenable(unit)
int unit;
{
struct hil_softc *hilp = &hil_softc[unit];
- register struct hil_dev *hildevice = hilp->hl_addr;
+ struct hil_dev *hildevice = hilp->hl_addr;
char db;
- /* Set the autorepeat rate register */
+ /* Set the autorepeat rate */
db = ar_format(KBD_ARR);
send_hil_cmd(hildevice, HIL_SETARR, &db, 1, NULL);
- /* Set the autorepeat delay register */
+ /* Set the autorepeat delay */
db = ar_format(KBD_ARD);
send_hil_cmd(hildevice, HIL_SETARD, &db, 1, NULL);
@@ -1128,6 +1177,7 @@ kbdenable(unit)
send_hil_cmd(hildevice, HIL_INTON, NULL, 0, NULL);
}
+void
kbddisable(unit)
int unit;
{
@@ -1152,7 +1202,7 @@ int
kbdgetc(statp)
int *statp;
{
- register int c, stat;
+ int c, stat;
int s;
if (hilkbd_cn_device == NULL)
@@ -1222,18 +1272,14 @@ kbdcninit()
* interrupt reoccuring. Note that we issue the CNMT command twice.
* This seems to be needed, once is not always enough!?!
*/
-kbdnmi(unit)
- int unit;
+int
+kbdnmi()
{
-#ifdef hp300
struct hil_softc *hilp = &hil_softc[0]; /* XXX how do we know on 300? */
-#else
- struct hil_softc *hilp = &hil_softc[unit];
-#endif
-#ifdef hp300
+
if ((*KBDNMISTAT & KBDNMI) == 0)
return(0);
-#endif
+
HILWAIT(hilp->hl_addr);
WRITEHILCMD(hilp->hl_addr, HIL_CNMT);
HILWAIT(hilp->hl_addr);
@@ -1249,12 +1295,13 @@ kbdnmi(unit)
/*
* Called at boot time to print out info about interesting devices
*/
+void
hilinfo(unit)
int unit;
{
- register struct hil_softc *hilp = &hil_softc[unit];
- register int id, len;
- register struct kbdmap *km;
+ struct hil_softc *hilp = &hil_softc[unit];
+ int id, len;
+ struct kbdmap *km;
/*
* Keyboard info.
@@ -1309,8 +1356,9 @@ hilinfo(unit)
* they are closed. This is a little too brutal for my tastes,
* we prefer to just assume people won't move things around.
*/
+void
hilconfig(hilp)
- register struct hil_softc *hilp;
+ struct hil_softc *hilp;
{
u_char db;
int s;
@@ -1420,15 +1468,16 @@ hilconfig(hilp)
splx(s);
}
+void
hilreset(hilp)
struct hil_softc *hilp;
{
- register struct hil_dev *hildevice = hilp->hl_addr;
+ struct hil_dev *hildevice = hilp->hl_addr;
u_char db;
#ifdef DEBUG
if (hildebug & HDB_FOLLOW)
- printf("hilreset(%x)\n", hilp);
+ printf("hilreset(%p)\n", hilp);
#endif
/*
* Initialize the loop: reconfigure, don't report errors,
@@ -1438,7 +1487,7 @@ hilreset(hilp)
send_hil_cmd(hildevice, HIL_WRITELPCTRL, &db, 1, NULL);
/*
* Delay one second for reconfiguration and then read the the
- * data register to clear the interrupt (if the loop reconfigured).
+ * data to clear the interrupt (if the loop reconfigured).
*/
DELAY(1000000);
if (READHILSTAT(hildevice) & HIL_DATA_RDY)
@@ -1460,9 +1509,10 @@ hilreset(hilp)
send_hil_cmd(hildevice, HIL_INTON, NULL, 0, NULL);
}
+void
hilbeep(hilp, bp)
struct hil_softc *hilp;
- register struct _hilbell *bp;
+ struct _hilbell *bp;
{
u_char buf[2];
@@ -1474,14 +1524,15 @@ hilbeep(hilp, bp)
/*
* Locate and return the address of the first ID module, 0 if none present.
*/
+int
hiliddev(hilp)
- register struct hil_softc *hilp;
+ struct hil_softc *hilp;
{
- register int i, len;
+ int i, len;
#ifdef DEBUG
if (hildebug & HDB_IDMODULE)
- printf("hiliddev(%x): max %d, looking for idmodule...",
+ printf("hiliddev(%p): max %d, looking for idmodule...",
hilp, hilp->hl_maxdev);
#endif
for (i = 1; i <= hilp->hl_maxdev; i++) {
@@ -1517,6 +1568,7 @@ hiliddev(hilp)
/*
* XXX map devno as expected by HP-UX
*/
+int
hildevno(dev)
dev_t dev;
{
@@ -1547,8 +1599,9 @@ hildevno(dev)
* We run at splimp() to make the transaction as atomic as
* possible without blocking the clock (is this necessary?)
*/
+void
send_hil_cmd(hildevice, cmd, data, dlen, rdata)
- register struct hil_dev *hildevice;
+ struct hil_dev *hildevice;
u_char cmd, *data, dlen;
u_char *rdata;
{
@@ -1582,11 +1635,12 @@ send_hil_cmd(hildevice, cmd, data, dlen, rdata)
* splhigh is extremely conservative but insures atomic operation,
* splimp (clock only interrupts) seems to be good enough in practice.
*/
+void
send_hildev_cmd(hilp, device, cmd)
- register struct hil_softc *hilp;
+ struct hil_softc *hilp;
char device, cmd;
{
- register struct hil_dev *hildevice = hilp->hl_addr;
+ struct hil_dev *hildevice = hilp->hl_addr;
u_char status, c;
int s = splimp();
@@ -1624,10 +1678,11 @@ send_hildev_cmd(hilp, device, cmd)
* Turn auto-polling off and on.
* Also disables and enable auto-repeat. Why?
*/
+void
polloff(hildevice)
- register struct hil_dev *hildevice;
+ struct hil_dev *hildevice;
{
- register char db;
+ char db;
/*
* Turn off auto repeat
@@ -1659,10 +1714,11 @@ polloff(hildevice)
} while (db & BSY_LOOPBUSY);
}
+void
pollon(hildevice)
- register struct hil_dev *hildevice;
+ struct hil_dev *hildevice;
{
- register char db;
+ char db;
/*
* Turn on auto polling
@@ -1686,11 +1742,12 @@ pollon(hildevice)
}
#ifdef DEBUG
+void
printhilpollbuf(hilp)
- register struct hil_softc *hilp;
+ struct hil_softc *hilp;
{
- register u_char *cp;
- register int i, len;
+ u_char *cp;
+ int i, len;
cp = hilp->hl_pollbuf;
len = hilp->hl_pollbp - cp;
@@ -1699,11 +1756,12 @@ printhilpollbuf(hilp)
printf("\n");
}
+void
printhilcmdbuf(hilp)
- register struct hil_softc *hilp;
+ struct hil_softc *hilp;
{
- register u_char *cp;
- register int i, len;
+ u_char *cp;
+ int i, len;
cp = hilp->hl_cmdbuf;
len = hilp->hl_cmdbp - cp;
@@ -1712,10 +1770,11 @@ printhilcmdbuf(hilp)
printf("\n");
}
+void
hilreport(hilp)
- register struct hil_softc *hilp;
+ struct hil_softc *hilp;
{
- register int i, len;
+ int i, len;
int s = splhil();
for (i = 1; i <= hilp->hl_maxdev; i++) {
diff --git a/sys/arch/hp300/dev/hil_keymaps.c b/sys/arch/hp300/dev/hil_keymaps.c
index a9b65e5b91f..514b9222806 100644
--- a/sys/arch/hp300/dev/hil_keymaps.c
+++ b/sys/arch/hp300/dev/hil_keymaps.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: hil_keymaps.c,v 1.3 1997/01/12 15:12:42 downsj Exp $ */
-/* $NetBSD: hil_keymaps.c,v 1.6 1995/12/06 22:13:23 thorpej Exp $ */
+/* $OpenBSD: hil_keymaps.c,v 1.4 1997/04/16 11:56:07 downsj Exp $ */
+/* $NetBSD: hil_keymaps.c,v 1.7 1997/03/31 07:34:22 scottr Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -322,23 +322,18 @@ char se_ctrlshiftmap[] = {
* Lookup is by hardware returned language code.
*/
struct kbdmap kbd_map[] = {
- KBD_US, "US ASCII",
- us_keymap, us_shiftmap, us_ctrlmap, us_ctrlshiftmap,
- us_stringmap,
+ { KBD_US, "US ASCII",
+ us_keymap, us_shiftmap, us_ctrlmap, us_ctrlshiftmap, us_stringmap },
#ifdef UK_KEYBOARD
- KBD_UK, "United Kingdom",
- uk_keymap, uk_shiftmap, uk_ctrlmap, uk_ctrlshiftmap,
- us_stringmap,
+ { KBD_UK, "United Kingdom",
+ uk_keymap, uk_shiftmap, uk_ctrlmap, uk_ctrlshiftmap, us_stringmap },
#endif
#ifdef SE_KEYBOARD
- KBD_SE, "Swedish",
- se_keymap, se_shiftmap, se_ctrlmap, se_ctrlshiftmap,
- us_stringmap,
+ { KBD_SE, "Swedish",
+ se_keymap, se_shiftmap, se_ctrlmap, se_ctrlshiftmap, us_stringmap },
#endif
- 0, NULL,
- NULL, NULL, NULL, NULL,
- NULL,
+ { 0, NULL, NULL, NULL, NULL, NULL, NULL },
};
diff --git a/sys/arch/hp300/dev/hilvar.h b/sys/arch/hp300/dev/hilvar.h
index 6db06e20042..c0fe74432db 100644
--- a/sys/arch/hp300/dev/hilvar.h
+++ b/sys/arch/hp300/dev/hilvar.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: hilvar.h,v 1.3 1997/01/12 15:12:44 downsj Exp $ */
-/* $NetBSD: hilvar.h,v 1.11 1995/12/11 19:41:47 thorpej Exp $ */
+/* $OpenBSD: hilvar.h,v 1.4 1997/04/16 11:56:08 downsj Exp $ */
+/* $NetBSD: hilvar.h,v 1.14 1997/04/01 19:29:10 scottr Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -118,3 +118,28 @@ struct hil_softc {
#define KBD_RAW 0x01 /* keyboard is raw */
#define KBD_AR1 0x02 /* keyboard auto-repeat rate 1 */
#define KBD_AR2 0x04 /* keyboard auto-repeat rate 2 */
+
+#ifdef _KERNEL
+void kbdbell __P((int));
+void kbdenable __P((int));
+void kbddisable __P((int));
+int kbdgetc __P((int *));
+void kbdcninit __P((void));
+
+int kbdnmi __P((void));
+
+void hilsoftinit __P((int, struct hil_dev *));
+void hilinit __P((int, struct hil_dev *));
+
+void send_hil_cmd __P((struct hil_dev *, u_char,
+ u_char *, u_char, u_char *));
+void send_hildev_cmd __P((struct hil_softc *, char, char));
+
+void polloff __P((struct hil_dev *));
+void pollon __P((struct hil_dev *));
+
+#ifdef COMPAT_HPUX
+int hpuxhilioctl __P((dev_t, int, caddr_t, int));
+int hildevno __P((dev_t));
+#endif /* COMPAT_HPUX */
+#endif /* _KERNEL */
diff --git a/sys/arch/hp300/dev/hpib.c b/sys/arch/hp300/dev/hpib.c
index a55c7f44ca9..a15e590f1cd 100644
--- a/sys/arch/hp300/dev/hpib.c
+++ b/sys/arch/hp300/dev/hpib.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: hpib.c,v 1.6 1997/02/03 04:47:33 downsj Exp $ */
-/* $NetBSD: hpib.c,v 1.13 1997/01/30 09:06:51 thorpej Exp $ */
+/* $OpenBSD: hpib.c,v 1.7 1997/04/16 11:56:09 downsj Exp $ */
+/* $NetBSD: hpib.c,v 1.15 1997/04/14 02:31:33 thorpej Exp $ */
/*
* Copyright (c) 1996, 1997 Jason R. Thorpe. All rights reserved.
@@ -52,7 +52,6 @@
#include <hp300/dev/hpibvar.h>
#include <machine/cpu.h>
-#include <hp300/hp300/isr.h>
int hpibbusmatch __P((struct device *, void *, void *));
void hpibbusattach __P((struct device *, struct device *, void *));
@@ -247,7 +246,7 @@ hpibdevprint(aux, pnp)
void
hpibreset(unit)
- register int unit;
+ int unit;
{
struct hpibbus_softc *sc = hpibbus_cd.cd_devs[unit];
@@ -329,7 +328,7 @@ hpibrecv(unit, slave, sec, addr, cnt)
int
hpibpptest(unit, slave)
- register int unit;
+ int unit;
int slave;
{
struct hpibbus_softc *sc = hpibbus_cd.cd_devs[unit];
@@ -346,6 +345,7 @@ hpibppclear(unit)
sc->sc_flags &= ~HPIBF_PPOLL;
}
+void
hpibawait(unit)
int unit;
{
@@ -357,12 +357,12 @@ hpibawait(unit)
int
hpibswait(unit, slave)
- register int unit;
+ int unit;
int slave;
{
struct hpibbus_softc *sc = hpibbus_cd.cd_devs[unit];
- register int timo = hpibtimeout;
- register int mask, (*ppoll) __P((struct hpibbus_softc *));
+ int timo = hpibtimeout;
+ int mask, (*ppoll) __P((struct hpibbus_softc *));
ppoll = sc->sc_ops->hpib_ppoll;
mask = 0x80 >> slave;
@@ -395,7 +395,7 @@ hpibstart(arg)
void *arg;
{
struct hpibbus_softc *sc = arg;
- register struct hpibqueue *hq;
+ struct hpibqueue *hq;
hq = sc->sc_queue.tqh_first;
(*hq->hq_go)(hq->hq_softc);
diff --git a/sys/arch/hp300/dev/hpibvar.h b/sys/arch/hp300/dev/hpibvar.h
index 310881a85de..e8f5336d8b0 100644
--- a/sys/arch/hp300/dev/hpibvar.h
+++ b/sys/arch/hp300/dev/hpibvar.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: hpibvar.h,v 1.5 1997/02/03 04:47:34 downsj Exp $ */
-/* $NetBSD: hpibvar.h,v 1.9 1997/01/30 09:06:52 thorpej Exp $ */
+/* $OpenBSD: hpibvar.h,v 1.6 1997/04/16 11:56:09 downsj Exp $ */
+/* $NetBSD: hpibvar.h,v 1.10 1997/03/31 07:34:25 scottr Exp $ */
/*
* Copyright (c) 1996, 1997 Jason R. Thorpe. All rights reserved.
@@ -176,11 +176,20 @@ extern int hpibdmathresh;
void hpibreset __P((int));
int hpibsend __P((int, int, int, void *, int));
int hpibrecv __P((int, int, int, void *, int));
+int hpibustart __P((int));
+void hpibstart __P((void *));
void hpibgo __P((int, int, int, void *, int, int, int));
+void hpibdone __P((void *));
+int hpibpptest __P((int, int));
void hpibppclear __P((int));
+void hpibawait __P((int));
+int hpibswait __P((int, int));
+int hpibid __P((int, int));
int hpibreq __P((struct device *, struct hpibqueue *));
void hpibfree __P((struct device *, struct hpibqueue *));
+int hpibbus_alloc __P((struct hpibbus_softc *, int, int));
+void hpibbus_free __P((struct hpibbus_softc *, int, int));
int hpibintr __P((void *));
int hpibdevprint __P((void *, const char *));
diff --git a/sys/arch/hp300/dev/if_le.c b/sys/arch/hp300/dev/if_le.c
index dc842554f08..602e03704f0 100644
--- a/sys/arch/hp300/dev/if_le.c
+++ b/sys/arch/hp300/dev/if_le.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: if_le.c,v 1.8 1997/03/07 23:44:40 downsj Exp $ */
-/* $NetBSD: if_le.c,v 1.37 1997/01/30 09:18:53 thorpej Exp $ */
+/* $OpenBSD: if_le.c,v 1.9 1997/04/16 11:56:10 downsj Exp $ */
+/* $NetBSD: if_le.c,v 1.41 1997/04/14 02:33:20 thorpej Exp $ */
/*-
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
@@ -58,9 +58,7 @@
#include <machine/autoconf.h>
#include <machine/cpu.h>
-#include <machine/mtpr.h>
-
-#include <hp300/hp300/isr.h>
+#include <machine/intr.h>
#ifdef USELEDS
#include <hp300/hp300/led.h>
@@ -95,8 +93,8 @@ lewrcsr(sc, port, val)
struct am7990_softc *sc;
u_int16_t port, val;
{
- register struct lereg0 *ler0 = ((struct le_softc *)sc)->sc_r0;
- register struct lereg1 *ler1 = ((struct le_softc *)sc)->sc_r1;
+ struct lereg0 *ler0 = ((struct le_softc *)sc)->sc_r0;
+ struct lereg1 *ler1 = ((struct le_softc *)sc)->sc_r1;
do {
ler1->ler1_rap = port;
@@ -111,8 +109,8 @@ lerdcsr(sc, port)
struct am7990_softc *sc;
u_int16_t port;
{
- register struct lereg0 *ler0 = ((struct le_softc *)sc)->sc_r0;
- register struct lereg1 *ler1 = ((struct le_softc *)sc)->sc_r1;
+ struct lereg0 *ler0 = ((struct le_softc *)sc)->sc_r0;
+ struct lereg1 *ler1 = ((struct le_softc *)sc)->sc_r1;
u_int16_t val;
do {
@@ -147,7 +145,7 @@ leattach(parent, self, aux)
struct device *parent, *self;
void *aux;
{
- register struct lereg0 *ler0;
+ struct lereg0 *ler0;
struct dio_attach_args *da = aux;
struct le_softc *lesc = (struct le_softc *)self;
caddr_t addr;
@@ -199,7 +197,7 @@ leattach(parent, self, aux)
am7990_config(sc);
/* Establish the interrupt handler. */
- (void) isrlink(leintr, sc, ipl, ISRPRI_NET);
+ (void) intr_establish(leintr, sc, ipl, IPL_NET);
ler0->ler0_status = LE_IE;
}
diff --git a/sys/arch/hp300/dev/if_levar.h b/sys/arch/hp300/dev/if_levar.h
index 1c07c11f143..29e401a890d 100644
--- a/sys/arch/hp300/dev/if_levar.h
+++ b/sys/arch/hp300/dev/if_levar.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: if_levar.h,v 1.4 1997/02/03 04:47:36 downsj Exp $ */
-/* $NetBSD: if_levar.h,v 1.6 1997/01/30 09:18:54 thorpej Exp $ */
+/* $OpenBSD: if_levar.h,v 1.5 1997/04/16 11:56:10 downsj Exp $ */
+/* $NetBSD: if_levar.h,v 1.8 1997/04/14 02:30:45 thorpej Exp $ */
/*-
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
@@ -50,7 +50,6 @@
struct le_softc {
struct am7990_softc sc_am7990; /* glue to MI code */
- struct isr sc_isr;
struct lereg0 *sc_r0; /* DIO registers */
struct lereg1 *sc_r1; /* LANCE registers */
};
diff --git a/sys/arch/hp300/dev/ite.c b/sys/arch/hp300/dev/ite.c
index e9261da7790..2c0a96f42f0 100644
--- a/sys/arch/hp300/dev/ite.c
+++ b/sys/arch/hp300/dev/ite.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: ite.c,v 1.9 1997/02/05 16:01:19 downsj Exp $ */
-/* $NetBSD: ite.c,v 1.37 1997/02/02 09:40:31 thorpej Exp $ */
+/* $OpenBSD: ite.c,v 1.10 1997/04/16 11:56:10 downsj Exp $ */
+/* $NetBSD: ite.c,v 1.38 1997/03/31 07:37:25 scottr Exp $ */
/*
* Copyright (c) 1996 Jason R. Thorpe. All rights reserved.
@@ -65,9 +65,14 @@
#include <hp300/dev/grfioctl.h>
#include <hp300/dev/grfvar.h>
+#include <hp300/dev/hilioctl.h>
+#include <hp300/dev/hilvar.h>
#include <hp300/dev/itevar.h>
#include <hp300/dev/kbdmap.h>
+/* prototypes for devsw entry points */
+cdev_decl(ite);
+
#define set_attr(ip, attr) ((ip)->attribute |= (attr))
#define clr_attr(ip, attr) ((ip)->attribute &= ~(attr))
@@ -392,7 +397,7 @@ itetty(dev)
int
iteioctl(dev, cmd, addr, flag, p)
dev_t dev;
- int cmd;
+ u_long cmd;
caddr_t addr;
int flag;
struct proc *p;
@@ -413,9 +418,9 @@ iteioctl(dev, cmd, addr, flag, p)
void
itestart(tp)
- register struct tty *tp;
+ struct tty *tp;
{
- register int cc, s;
+ int cc, s;
int hiwat = 0, hadcursor = 0;
struct ite_softc *sc;
struct ite_data *ip;
@@ -475,12 +480,12 @@ itestart(tp)
splx(s);
}
-void
+int
itestop(tp, flag)
struct tty *tp;
int flag;
{
-
+ return (0);
}
void
@@ -489,7 +494,7 @@ itefilter(stat, c)
{
static int capsmode = 0;
static int metamode = 0;
- register char code, *str;
+ char code, *str;
struct tty *kbd_tty = kbd_ite->tty;
if (kbd_tty == NULL)
@@ -513,7 +518,7 @@ itefilter(stat, c)
c &= KBD_CHARMASK;
switch ((stat>>KBD_SSHIFT) & KBD_SMASK) {
-
+ default:
case KBD_KEY:
if (!capsmode) {
code = kbd_keymap[c];
@@ -534,7 +539,7 @@ itefilter(stat, c)
break;
}
- if (code == NULL && (str = kbd_stringmap[c]) != NULL) {
+ if (code == '\0' && (str = kbd_stringmap[c]) != '\0') {
while (*str)
(*linesw[kbd_tty->t_line].l_rint)(*str++, kbd_tty);
} else {
@@ -926,6 +931,7 @@ ite_major()
/* locate the major number */
for (itemaj = 0; itemaj < nchrdev; itemaj++)
if (cdevsw[itemaj].d_open == iteopen)
+ break;
return (itemaj);
}
@@ -940,7 +946,6 @@ itecninit(gp, isw)
struct grf_data *gp;
struct itesw *isw;
{
- extern void kbdcninit __P((void)); /* XXX */
struct ite_data *ip = &ite_cn;
/*
@@ -965,7 +970,7 @@ int
itecngetc(dev)
dev_t dev;
{
- register int c;
+ int c;
int stat;
c = kbdgetc(&stat);
diff --git a/sys/arch/hp300/dev/ite_subr.c b/sys/arch/hp300/dev/ite_subr.c
index fdfba6aa83c..b30695517fa 100644
--- a/sys/arch/hp300/dev/ite_subr.c
+++ b/sys/arch/hp300/dev/ite_subr.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: ite_subr.c,v 1.3 1997/01/12 15:12:51 downsj Exp $ */
-/* $NetBSD: ite_subr.c,v 1.7 1996/12/17 08:41:17 thorpej Exp $ */
+/* $OpenBSD: ite_subr.c,v 1.4 1997/04/16 11:56:11 downsj Exp $ */
+/* $NetBSD: ite_subr.c,v 1.8 1997/03/31 07:37:26 scottr Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -130,7 +130,7 @@ ite_writeglyph(ip, fbmem, glyphp)
struct ite_data *ip;
u_char *fbmem, *glyphp;
{
- register int bn;
+ int bn;
int l, b;
for (l = 0; l < ip->ftheight; l++) {
diff --git a/sys/arch/hp300/dev/itevar.h b/sys/arch/hp300/dev/itevar.h
index b42ba47ebfe..0ef7dcc62da 100644
--- a/sys/arch/hp300/dev/itevar.h
+++ b/sys/arch/hp300/dev/itevar.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: itevar.h,v 1.8 1997/02/06 00:14:41 downsj Exp $ */
-/* $NetBSD: itevar.h,v 1.13 1997/01/30 09:18:57 thorpej Exp $ */
+/* $OpenBSD: itevar.h,v 1.9 1997/04/16 11:56:11 downsj Exp $ */
+/* $NetBSD: itevar.h,v 1.14 1997/03/31 07:37:27 scottr Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -205,6 +205,8 @@ int iteon __P((struct ite_data *, int));
void iteoff __P((struct ite_data *, int));
void itefilter __P((char, char));
void itecninit __P((struct grf_data *, struct itesw *));
+int itecngetc __P((dev_t));
+void itecnputc __P((dev_t, int));
int ite_major __P((void));
/* ite_subr.c prototypes */
diff --git a/sys/arch/hp300/dev/maskbits.h b/sys/arch/hp300/dev/maskbits.h
index 948197c36e1..db2f2e79380 100644
--- a/sys/arch/hp300/dev/maskbits.h
+++ b/sys/arch/hp300/dev/maskbits.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: maskbits.h,v 1.2 1997/01/12 15:12:53 downsj Exp $ */
-/* $NetBSD: maskbits.h,v 1.2 1994/10/26 07:24:43 cgd Exp $ */
+/* $OpenBSD: maskbits.h,v 1.3 1997/04/16 11:56:12 downsj Exp $ */
+/* $NetBSD: maskbits.h,v 1.3 1997/03/31 07:37:28 scottr Exp $ */
/*-
* Copyright (c) 1994
@@ -76,7 +76,7 @@ and the number of whole longwords between the ends.
#define getandputrop(psrc, srcbit, dstbit, width, pdst, rop) \
{ \
- register unsigned int _tmpsrc, _tmpdst; \
+ unsigned int _tmpsrc, _tmpdst; \
FASTGETBITS(pdst, dstbit, width, _tmpdst); \
FASTGETBITS(psrc, srcbit, width, _tmpsrc); \
DoRop(_tmpdst, rop, _tmpsrc, _tmpdst); \
@@ -87,7 +87,7 @@ and the number of whole longwords between the ends.
getandputrop(psrc, srcbit, 0, width, pdst, rop)
#define getunalignedword(psrc, x, dst) { \
- register int _tmp; \
+ int _tmp; \
FASTGETBITS(psrc, x, 32, _tmp); \
dst = _tmp; \
}
diff --git a/sys/arch/hp300/dev/mt.c b/sys/arch/hp300/dev/mt.c
index df2514a0171..678e0d0b9fe 100644
--- a/sys/arch/hp300/dev/mt.c
+++ b/sys/arch/hp300/dev/mt.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: mt.c,v 1.5 1997/02/03 04:47:39 downsj Exp $ */
-/* $NetBSD: mt.c,v 1.7 1997/01/30 09:14:14 thorpej Exp $ */
+/* $OpenBSD: mt.c,v 1.6 1997/04/16 11:56:13 downsj Exp $ */
+/* $NetBSD: mt.c,v 1.8 1997/03/31 07:37:29 scottr Exp $ */
/*
* Copyright (c) 1996, 1997 Jason R. Thorpe. All rights reserved.
@@ -55,10 +55,10 @@ struct mtinfo {
u_short hwid;
char *desc;
} mtinfo[] = {
- MT7978ID, "7978",
- MT7979AID, "7979A",
- MT7980ID, "7980",
- MT7974AID, "7974A",
+ { MT7978ID, "7978" },
+ { MT7979AID, "7979A" },
+ { MT7980ID, "7980" },
+ { MT7974AID, "7974A" },
};
int nmtinfo = sizeof(mtinfo) / sizeof(mtinfo[0]);
@@ -268,9 +268,9 @@ mtopen(dev, flag, mode, p)
int flag, mode;
struct proc *p;
{
- register int unit = UNIT(dev);
+ int unit = UNIT(dev);
struct mt_softc *sc;
- register int req_den;
+ int req_den;
int error;
if (unit >= mt_cd.cd_ndevs ||
@@ -425,12 +425,12 @@ mtcommand(dev, cmd, cnt)
*/
void
mtstrategy(bp)
- register struct buf *bp;
+ struct buf *bp;
{
- register struct mt_softc *sc;
- register struct buf *dp;
- register int unit;
- register int s;
+ struct mt_softc *sc;
+ struct buf *dp;
+ int unit;
+ int s;
unit = UNIT(bp->b_dev);
sc = mt_cd.cd_devs[unit];
@@ -460,9 +460,11 @@ mtstrategy(bp)
}
if (bp->b_bcount > s) {
tprintf(sc->sc_ttyp,
- "%s: write record (%d) too big: limit (%d)\n",
+ "%s: write record (%ld) too big: limit (%d)\n",
sc->sc_dev.dv_xname, bp->b_bcount, s);
+#if 0 /* XXX see above */
error:
+#endif
bp->b_flags |= B_ERROR;
bp->b_error = EIO;
iodone(bp);
@@ -519,7 +521,7 @@ mtstart(arg)
void *arg;
{
struct mt_softc *sc = arg;
- register struct buf *bp, *dp;
+ struct buf *bp, *dp;
short cmdcount = 1;
u_char cmdbuf[2];
@@ -651,7 +653,7 @@ mtstart(arg)
goto fatalerror;
}
timeout(spl_mtintr, sc, 4 * hz);
- hpibawait(sc->sc_hpibno, sc->sc_slave);
+ hpibawait(sc->sc_hpibno);
return;
case MTSET800BPI:
@@ -705,7 +707,7 @@ errdone:
done:
sc->sc_flags &= ~(MTF_HITEOF | MTF_HITBOF);
iodone(bp);
- if (dp = bp->b_actf)
+ if ((dp = bp->b_actf))
dp->b_actb = bp->b_actb;
else
sc->sc_tab.b_actb = bp->b_actb;
@@ -865,7 +867,8 @@ mtintr(arg)
} else {
i = hpibrecv(sc->sc_hpibno, sc->sc_slave, MTT_BCNT, cmdbuf, 2);
if (i != 2) {
- log(LOG_ERR, "mt%d intr: can't get xfer length\n");
+ log(LOG_ERR, "%s intr: can't get xfer length\n",
+ sc->sc_dev.dv_xname);
goto error;
}
i = (int) *((u_short *) cmdbuf);
@@ -873,11 +876,11 @@ mtintr(arg)
if (i == 0)
sc->sc_flags |= MTF_HITEOF;
bp->b_resid = bp->b_bcount - i;
- dlog(LOG_DEBUG, "%s intr: bcount %d, resid %d",
+ dlog(LOG_DEBUG, "%s intr: bcount %ld, resid %ld",
sc->sc_dev.dv_xname, bp->b_bcount, bp->b_resid);
} else {
tprintf(sc->sc_ttyp,
- "%s: record (%d) larger than wanted (%d)\n",
+ "%s: record (%d) larger than wanted (%ld)\n",
sc->sc_dev.dv_xname, i, bp->b_bcount);
error:
sc->sc_flags &= ~MTF_IO;
@@ -893,7 +896,7 @@ mtintr(arg)
(void) hpibsend(sc->sc_hpibno, sc->sc_slave, MTL_ECMD, cmdbuf, 1);
bp->b_flags &= ~B_CMD;
iodone(bp);
- if (dp = bp->b_actf)
+ if ((dp = bp->b_actf))
dp->b_actb = bp->b_actb;
else
sc->sc_tab.b_actb = bp->b_actb;
@@ -941,7 +944,7 @@ mtioctl(dev, cmd, data, flag, p)
int flag;
struct proc *p;
{
- register struct mtop *op;
+ struct mtop *op;
int cnt;
switch (cmd) {
diff --git a/sys/arch/hp300/dev/nhpib.c b/sys/arch/hp300/dev/nhpib.c
index ee635cceb2f..5860be568eb 100644
--- a/sys/arch/hp300/dev/nhpib.c
+++ b/sys/arch/hp300/dev/nhpib.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: nhpib.c,v 1.6 1997/02/03 04:47:40 downsj Exp $ */
-/* $NetBSD: nhpib.c,v 1.14 1997/01/30 09:06:54 thorpej Exp $ */
+/* $OpenBSD: nhpib.c,v 1.7 1997/04/16 11:56:13 downsj Exp $ */
+/* $NetBSD: nhpib.c,v 1.16 1997/04/14 02:33:21 thorpej Exp $ */
/*
* Copyright (c) 1996, 1997 Jason R. Thorpe. All rights reserved.
@@ -48,8 +48,7 @@
#include <sys/device.h>
#include <machine/autoconf.h>
-
-#include <hp300/hp300/isr.h>
+#include <machine/intr.h>
#include <hp300/dev/dioreg.h>
#include <hp300/dev/diovar.h>
@@ -178,7 +177,7 @@ nhpibattach(parent, self, aux)
printf(" ipl %d: %s\n", ipl, desc);
/* Establish the interrupt handler. */
- (void) isrlink(nhpibintr, sc, ipl, ISRPRI_BIO);
+ (void) intr_establish(nhpibintr, sc, ipl, IPL_BIO);
dmacomputeipl();
ha.ha_ops = &nhpib_controller;
@@ -217,7 +216,7 @@ nhpibreset(hs)
void
nhpibifc(hd)
- register struct nhpibdevice *hd;
+ struct nhpibdevice *hd;
{
hd->hpib_acr = AUX_TCA;
hd->hpib_acr = AUX_CSRE;
@@ -397,8 +396,8 @@ nhpibreadtimo(arg)
int s = splbio();
if (hs->sc_flags & HPIBF_IO) {
- register struct nhpibdevice *hd = sc->sc_regs;
- register struct hpibqueue *hq;
+ struct nhpibdevice *hd = sc->sc_regs;
+ struct hpibqueue *hq;
hd->hpib_mim = 0;
hd->hpib_acr = AUX_TCA;
@@ -512,10 +511,10 @@ int nhpibreporttimo = 0;
int
nhpibwait(hd, x)
- register struct nhpibdevice *hd;
+ struct nhpibdevice *hd;
int x;
{
- register int timo = hpibtimeout;
+ int timo = hpibtimeout;
while ((hd->hpib_mis & x) == 0 && --timo)
DELAY(1);
diff --git a/sys/arch/hp300/dev/ppi.c b/sys/arch/hp300/dev/ppi.c
index 318b1b9ebe0..043baab81bd 100644
--- a/sys/arch/hp300/dev/ppi.c
+++ b/sys/arch/hp300/dev/ppi.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: ppi.c,v 1.5 1997/02/03 04:47:41 downsj Exp $ */
-/* $NetBSD: ppi.c,v 1.11 1997/01/30 09:14:16 thorpej Exp $ */
+/* $OpenBSD: ppi.c,v 1.6 1997/04/16 11:56:14 downsj Exp $ */
+/* $NetBSD: ppi.c,v 1.13 1997/04/02 22:37:33 scottr Exp $ */
/*
* Copyright (c) 1996, 1997 Jason R. Thorpe. All rights reserved.
@@ -43,11 +43,12 @@
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/conf.h>
+#include <sys/device.h>
#include <sys/errno.h>
-#include <sys/uio.h>
#include <sys/malloc.h>
-#include <sys/device.h>
-#include <sys/conf.h>
+#include <sys/proc.h>
+#include <sys/uio.h>
#include <hp300/dev/hpibvar.h>
@@ -165,7 +166,7 @@ ppiopen(dev, flags, fmt, p)
int flags, fmt;
struct proc *p;
{
- register int unit = UNIT(dev);
+ int unit = UNIT(dev);
struct ppi_softc *sc;
if (unit >= ppi_cd.cd_ndevs ||
@@ -194,7 +195,7 @@ ppiclose(dev, flags, fmt, p)
int flags, fmt;
struct proc *p;
{
- register int unit = UNIT(dev);
+ int unit = UNIT(dev);
struct ppi_softc *sc = ppi_cd.cd_devs[unit];
#ifdef DEBUG
@@ -214,7 +215,7 @@ ppistart(arg)
#ifdef DEBUG
if (ppidebug & PDB_FOLLOW)
- printf("ppistart(%x)\n", unit);
+ printf("ppistart(%x)\n", sc->sc_dev.dv_unit);
#endif
sc->sc_flags &= ~PPIF_DELAY;
wakeup(sc);
@@ -243,7 +244,7 @@ ppiread(dev, uio, flags)
#ifdef DEBUG
if (ppidebug & PDB_FOLLOW)
- printf("ppiread(%x, %x)\n", dev, uio);
+ printf("ppiread(%x, %p)\n", dev, uio);
#endif
return (ppirw(dev, uio));
}
@@ -257,7 +258,7 @@ ppiwrite(dev, uio, flags)
#ifdef DEBUG
if (ppidebug & PDB_FOLLOW)
- printf("ppiwrite(%x, %x)\n", dev, uio);
+ printf("ppiwrite(%x, %p)\n", dev, uio);
#endif
return (ppirw(dev, uio));
}
@@ -265,12 +266,12 @@ ppiwrite(dev, uio, flags)
int
ppirw(dev, uio)
dev_t dev;
- register struct uio *uio;
+ struct uio *uio;
{
int unit = UNIT(dev);
struct ppi_softc *sc = ppi_cd.cd_devs[unit];
- register int s, len, cnt;
- register char *cp;
+ int s, len, cnt;
+ char *cp;
int error = 0, gotdata = 0;
int buflen, ctlr, slave;
char *buf;
@@ -283,7 +284,7 @@ ppirw(dev, uio)
#ifdef DEBUG
if (ppidebug & (PDB_FOLLOW|PDB_IO))
- printf("ppirw(%x, %x, %c): burst %d, timo %d, resid %x\n",
+ printf("ppirw(%x, %p, %c): burst %d, timo %d, resid %x\n",
dev, uio, uio->uio_rw == UIO_READ ? 'R' : 'W',
sc->sc_burst, sc->sc_timo, uio->uio_resid);
#endif
@@ -294,6 +295,7 @@ ppirw(dev, uio)
sc->sc_flags |= PPIF_TIMO;
timeout(ppitimo, sc, sc->sc_timo);
}
+ len = cnt = 0;
while (uio->uio_resid > 0) {
len = min(buflen, uio->uio_resid);
cp = buf;
@@ -336,7 +338,7 @@ again:
hpibfree(sc->sc_dev.dv_parent, &sc->sc_hq);
#ifdef DEBUG
if (ppidebug & PDB_IO)
- printf("ppirw: %s(%d, %d, %x, %x, %d) -> %d\n",
+ printf("ppirw: %s(%d, %d, %x, %p, %d) -> %d\n",
uio->uio_rw == UIO_READ ? "recv" : "send",
ctlr, slave, sc->sc_sec, cp, len, cnt);
#endif
@@ -373,7 +375,7 @@ again:
if (sc->sc_delay > 0) {
sc->sc_flags |= PPIF_DELAY;
timeout(ppistart, sc, sc->sc_delay);
- error = tsleep(sc, PCATCH|PZERO+1, "hpib", 0);
+ error = tsleep(sc, (PCATCH|PZERO) + 1, "hpib", 0);
if (error) {
splx(s);
break;
@@ -464,7 +466,7 @@ ppihztoms(h)
int h;
{
extern int hz;
- register int m = h;
+ int m = h;
if (m > 0)
m = m * 1000 / hz;
@@ -476,7 +478,7 @@ ppimstohz(m)
int m;
{
extern int hz;
- register int h = m;
+ int h = m;
if (h > 0) {
h = h * hz / 1000;
diff --git a/sys/arch/hp300/dev/scsi.c b/sys/arch/hp300/dev/scsi.c
index 43d20b000fe..fe3a955fa16 100644
--- a/sys/arch/hp300/dev/scsi.c
+++ b/sys/arch/hp300/dev/scsi.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: scsi.c,v 1.7 1997/03/11 09:54:09 downsj Exp $ */
-/* $NetBSD: scsi.c,v 1.16 1997/03/10 08:37:31 thorpej Exp $ */
+/* $OpenBSD: scsi.c,v 1.8 1997/04/16 11:56:14 downsj Exp $ */
+/* $NetBSD: scsi.c,v 1.19 1997/04/14 02:33:22 thorpej Exp $ */
/*
* Copyright (c) 1996, 1997 Jason R. Thorpe. All rights reserved.
@@ -52,7 +52,9 @@
#include <sys/buf.h>
#include <sys/device.h>
+#include <machine/autoconf.h>
#include <machine/cpu.h>
+#include <machine/intr.h>
#include <hp300/dev/dioreg.h>
#include <hp300/dev/diovar.h>
@@ -60,10 +62,8 @@
#include <hp300/dev/dmavar.h>
-#include <hp300/dev/scsivar.h>
#include <hp300/dev/scsireg.h>
-
-#include <hp300/hp300/isr.h>
+#include <hp300/dev/scsivar.h>
struct scsi_softc {
struct device sc_dev; /* generic device glue */
@@ -95,12 +95,28 @@ struct scsi_softc {
#define SCSI_DATA_WAIT 10000 /* wait per data in/out step */
#define SCSI_INIT_WAIT 50000 /* wait per step (both) during init */
-void scsidone __P((void *));
-void scsistart __P((void *));
-int scsiintr __P((void *));
+static void scsiabort __P((int, struct scsi_softc *,
+ volatile struct scsidevice *, char *));
+static void scsierror __P((struct scsi_softc *,
+ volatile struct scsidevice *, u_char));
+static int issue_select __P((volatile struct scsidevice *,
+ u_char, u_char));
+static int wait_for_select __P((volatile struct scsidevice *));
+static int ixfer_start __P((volatile struct scsidevice *,
+ int, u_char, int));
+static int ixfer_out __P((volatile struct scsidevice *, int, u_char *));
+static void ixfer_in __P((volatile struct scsidevice *, int, u_char *));
+static int mxfer_in __P((volatile struct scsidevice *,
+ int, u_char *, u_char));
+static int scsiicmd __P((struct scsi_softc *, int, u_char *, int,
+ u_char *, int, u_char));
+static void finishxfer __P((struct scsi_softc *,
+ volatile struct scsidevice *, int));
int scsimatch __P((struct device *, void *, void *));
void scsiattach __P((struct device *, struct device *, void *));
+void scsi_attach_children __P((struct scsi_softc *));
+int scsisubmatch __P((struct device *, void *, void *));
struct cfattach oscsi_ca = {
sizeof(struct scsi_softc), scsimatch, scsiattach
@@ -110,9 +126,6 @@ struct cfdriver oscsi_cd = {
NULL, "oscsi", DV_DULL
};
-int scsisubmatch __P((struct device *, void *, void *));
-void scsi_attach_children __P((struct scsi_softc *));
-
int scsi_cmd_wait = SCSI_CMD_WAIT;
int scsi_data_wait = SCSI_DATA_WAIT;
int scsi_init_wait = SCSI_INIT_WAIT;
@@ -145,8 +158,8 @@ u_int sgo_wait[MAXWAIT+2];
static void
scsiabort(target, hs, hd, where)
int target;
- register struct scsi_softc *hs;
- volatile register struct scsidevice *hd;
+ struct scsi_softc *hs;
+ volatile struct scsidevice *hd;
char *where;
{
int len;
@@ -305,7 +318,7 @@ scsiattach(parent, self, aux)
hs->sc_regs = hd;
/* Establish the interrupt handler. */
- (void) isrlink(scsiintr, hs, ipl, ISRPRI_BIO);
+ (void) intr_establish(scsiintr, hs, ipl, IPL_BIO);
dmacomputeipl();
/* Reset the controller. */
@@ -463,7 +476,7 @@ scsireset(unit)
int unit;
{
struct scsi_softc *hs = oscsi_cd.cd_devs[unit];
- volatile register struct scsidevice *hd = hs->sc_regs;
+ volatile struct scsidevice *hd = hs->sc_regs;
u_int i;
if (hs->sc_flags & SCSI_ALIVE)
@@ -531,11 +544,10 @@ scsireset(unit)
static void
scsierror(hs, hd, ints)
- register struct scsi_softc *hs;
- volatile register struct scsidevice *hd;
+ struct scsi_softc *hs;
+ volatile struct scsidevice *hd;
u_char ints;
{
- int unit = hs->sc_dev.dv_unit;
char *sep = "";
printf("%s: ", hs->sc_dev.dv_xname);
@@ -590,7 +602,7 @@ scsierror(hs, hd, ints)
static int
issue_select(hd, target, our_addr)
- volatile register struct scsidevice *hd;
+ volatile struct scsidevice *hd;
u_char target, our_addr;
{
if (hd->scsi_ssts & (SSTS_INITIATOR|SSTS_TARGET|SSTS_BUSY))
@@ -612,7 +624,7 @@ issue_select(hd, target, our_addr)
static int
wait_for_select(hd)
- volatile register struct scsidevice *hd;
+ volatile struct scsidevice *hd;
{
u_char ints;
@@ -624,10 +636,10 @@ wait_for_select(hd)
static int
ixfer_start(hd, len, phase, wait)
- volatile register struct scsidevice *hd;
+ volatile struct scsidevice *hd;
int len;
u_char phase;
- register int wait;
+ int wait;
{
hd->scsi_tch = len >> 16;
@@ -656,11 +668,11 @@ ixfer_start(hd, len, phase, wait)
static int
ixfer_out(hd, len, buf)
- volatile register struct scsidevice *hd;
+ volatile struct scsidevice *hd;
int len;
- register u_char *buf;
+ u_char *buf;
{
- register int wait = scsi_data_wait;
+ int wait = scsi_data_wait;
for (; len > 0; --len) {
while (hd->scsi_ssts & SSTS_DREG_FULL) {
@@ -683,11 +695,11 @@ ixfer_out(hd, len, buf)
static void
ixfer_in(hd, len, buf)
- volatile register struct scsidevice *hd;
+ volatile struct scsidevice *hd;
int len;
- register u_char *buf;
+ u_char *buf;
{
- register int wait = scsi_data_wait;
+ int wait = scsi_data_wait;
for (; len > 0; --len) {
while (hd->scsi_ssts & SSTS_DREG_EMPTY) {
@@ -713,13 +725,13 @@ ixfer_in(hd, len, buf)
static int
mxfer_in(hd, len, buf, phase)
- volatile register struct scsidevice *hd;
- register int len;
- register u_char *buf;
- register u_char phase;
+ volatile struct scsidevice *hd;
+ int len;
+ u_char *buf;
+ u_char phase;
{
- register int wait = scsi_cmd_wait;
- register int i;
+ int wait = scsi_cmd_wait;
+ int i;
hd->scsi_tmod = 0;
for (i = 0; i < len; ++i) {
@@ -799,9 +811,9 @@ scsiicmd(hs, target, cbuf, clen, buf, len, xferphase)
int len;
u_char xferphase;
{
- volatile register struct scsidevice *hd = hs->sc_regs;
+ volatile struct scsidevice *hd = hs->sc_regs;
u_char phase, ints;
- register int wait;
+ int wait;
/* select the SCSI bus (it's an error if bus isn't free) */
if (issue_select(hd, target, hs->sc_scsi_addr))
@@ -906,7 +918,7 @@ out:
static void
finishxfer(hs, hd, target)
struct scsi_softc *hs;
- volatile register struct scsidevice *hd;
+ volatile struct scsidevice *hd;
int target;
{
u_char phase, ints;
@@ -958,14 +970,14 @@ finishxfer(hs, hd, target)
switch (phase) {
case STATUS_PHASE:
- if (mxfer_in(hd, sizeof(hs->sc_stat), hs->sc_stat,
- phase) <= 0)
+ if (mxfer_in(hd, sizeof(hs->sc_stat),
+ (u_char *)hs->sc_stat, phase) <= 0)
goto abort;
break;
case MESG_IN_PHASE:
- if (mxfer_in(hd, sizeof(hs->sc_msg), hs->sc_msg,
- phase) < 0)
+ if (mxfer_in(hd, sizeof(hs->sc_msg),
+ (u_char *)hs->sc_msg, phase) < 0)
goto abort;
break;
@@ -977,7 +989,7 @@ finishxfer(hs, hd, target)
hs->sc_dev.dv_xname, phase, target);
goto abort;
}
- if (ints = hd->scsi_ints) {
+ if ((ints = hd->scsi_ints)) {
hd->scsi_ints = ints;
if (ints & INTS_DISCON)
return;
@@ -1002,22 +1014,23 @@ scsi_test_unit_rdy(ctlr, slave, unit)
static struct scsi_cdb6 cdb = { CMD_TEST_UNIT_READY };
cdb.lun = unit;
- return (scsiicmd(hs, slave, &cdb, sizeof(cdb), (u_char *)0, 0,
- STATUS_PHASE));
+ return (scsiicmd(hs, slave, (u_char *)&cdb, sizeof(cdb),
+ (u_char *)0, 0, STATUS_PHASE));
}
int
scsi_request_sense(ctlr, slave, unit, buf, len)
int ctlr, slave, unit;
u_char *buf;
- unsigned len;
+ u_int len;
{
struct scsi_softc *hs = oscsi_cd.cd_devs[ctlr];
static struct scsi_cdb6 cdb = { CMD_REQUEST_SENSE };
cdb.lun = unit;
cdb.len = len;
- return (scsiicmd(hs, slave, &cdb, sizeof(cdb), buf, len, DATA_IN_PHASE));
+ return (scsiicmd(hs, slave, (u_char *)&cdb, sizeof(cdb),
+ buf, len, DATA_IN_PHASE));
}
int
@@ -1064,7 +1077,8 @@ scsi_tt_read(ctlr, slave, unit, buf, len, blk, bshift)
cdb.lbal = blk;
cdb.lenh = len >> (8 + DEV_BSHIFT + bshift);
cdb.lenl = len >> (DEV_BSHIFT + bshift);
- stat = scsiicmd(hs, slave, &cdb, sizeof(cdb), buf, len, DATA_IN_PHASE);
+ stat = scsiicmd(hs, slave, (u_char *)&cdb, sizeof(cdb),
+ buf, len, DATA_IN_PHASE);
scsi_data_wait = old_wait;
return (stat);
}
@@ -1094,7 +1108,8 @@ scsi_tt_write(ctlr, slave, unit, buf, len, blk, bshift)
cdb.lbal = blk;
cdb.lenh = len >> (8 + DEV_BSHIFT + bshift);
cdb.lenl = len >> (DEV_BSHIFT + bshift);
- stat = scsiicmd(hs, slave, &cdb, sizeof(cdb), buf, len, DATA_OUT_PHASE);
+ stat = scsiicmd(hs, slave, (u_char *)&cdb, sizeof(cdb),
+ buf, len, DATA_OUT_PHASE);
scsi_data_wait = old_wait;
return (stat);
}
@@ -1149,7 +1164,7 @@ scsigo(ctlr, slave, unit, bp, cdb, pad)
int pad;
{
struct scsi_softc *hs = oscsi_cd.cd_devs[ctlr];
- volatile register struct scsidevice *hd = hs->sc_regs;
+ volatile struct scsidevice *hd = hs->sc_regs;
int i, dmaflags;
u_char phase, ints, cmd;
@@ -1177,7 +1192,7 @@ scsigo(ctlr, slave, unit, bp, cdb, pad)
*/
phase = CMD_PHASE;
while (1) {
- register int wait = scsi_cmd_wait;
+ int wait = scsi_cmd_wait;
switch (phase) {
@@ -1278,7 +1293,7 @@ out:
#ifdef DEBUG
hs->sc_flags |= SCSI_PAD;
if (i & 1)
- printf("%s: odd byte count: %d bytes @ %d\n",
+ printf("%s: odd byte count: %d bytes @ %ld\n",
hs->sc_dev.dv_xname, i, bp->b_cylin);
#endif
} else
@@ -1303,7 +1318,7 @@ scsidone(arg)
void *arg;
{
struct scsi_softc *hs = arg;
- volatile register struct scsidevice *hd = hs->sc_regs;
+ volatile struct scsidevice *hd = hs->sc_regs;
#ifdef DEBUG
if (scsi_debug)
@@ -1317,11 +1332,10 @@ int
scsiintr(arg)
void *arg;
{
- register struct scsi_softc *hs = arg;
- volatile register struct scsidevice *hd = hs->sc_regs;
- register u_char ints;
- register struct scsiqueue *sq;
- int unit = hs->sc_dev.dv_unit;
+ struct scsi_softc *hs = arg;
+ volatile struct scsidevice *hd = hs->sc_regs;
+ u_char ints;
+ struct scsiqueue *sq;
if ((hd->scsi_csr & (CSR_IE|CSR_IR)) != (CSR_IE|CSR_IR))
return (0);
@@ -1396,8 +1410,8 @@ scsi_tt_oddio(ctlr, slave, unit, buf, len, b_flags, freedma)
int stat;
#ifdef DEBUG
- if (freedma && (hs->sc_flags & SCSI_HAVEDMA) == 0 ||
- !freedma && (hs->sc_flags & SCSI_HAVEDMA))
+ if ((freedma && (hs->sc_flags & SCSI_HAVEDMA) == 0) ||
+ (!freedma && (hs->sc_flags & SCSI_HAVEDMA)))
printf("oddio: freedma (%d) inconsistency (flags=%x)\n",
freedma, hs->sc_flags);
#endif
@@ -1407,7 +1421,7 @@ scsi_tt_oddio(ctlr, slave, unit, buf, len, b_flags, freedma)
*/
if (freedma) {
hs->sc_flags &=~ SCSI_HAVEDMA;
- dmafree(hs->sc_dq);
+ dmafree(&hs->sc_dq);
}
/*
* Initialize command block
@@ -1433,7 +1447,8 @@ scsi_tt_oddio(ctlr, slave, unit, buf, len, b_flags, freedma)
* Perform command (with very long delays)
*/
scsi_delay(30000000);
- stat = scsiicmd(hs, slave, &cdb, sizeof(cdb), buf, len, iphase);
+ stat = scsiicmd(hs, slave, (u_char *)&cdb, sizeof(cdb),
+ buf, len, iphase);
scsi_delay(0);
return (stat);
}
@@ -1469,7 +1484,7 @@ scsi_probe_device(ctlr, targ, lun, inqbuf, inqlen)
int inqlen;
{
static struct scsi_fmt_cdb inq = {
- 6, CMD_INQUIRY, 0, 0, 0, 0, 0
+ 6, { CMD_INQUIRY, 0, 0, 0, 0, 0 }
};
int i, tries = 10, isrm = 0;
@@ -1492,7 +1507,7 @@ scsi_probe_device(ctlr, targ, lun, inqbuf, inqlen)
struct scsi_xsense *sp =
(struct scsi_xsense *)sensebuf;
- scsi_request_sense(ctlr, targ, lun, sensebuf,
+ scsi_request_sense(ctlr, targ, lun, (u_char *)sensebuf,
sizeof(sensebuf));
if (sp->class == 7) {
switch (sp->key) {
diff --git a/sys/arch/hp300/dev/scsivar.h b/sys/arch/hp300/dev/scsivar.h
index ecc618d4de3..76ca923085c 100644
--- a/sys/arch/hp300/dev/scsivar.h
+++ b/sys/arch/hp300/dev/scsivar.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: scsivar.h,v 1.4 1997/02/03 04:47:45 downsj Exp $ */
-/* $NetBSD: scsivar.h,v 1.6 1997/01/30 09:08:56 thorpej Exp $ */
+/* $OpenBSD: scsivar.h,v 1.5 1997/04/16 11:56:15 downsj Exp $ */
+/* $NetBSD: scsivar.h,v 1.7 1997/03/31 07:40:05 scottr Exp $ */
/*
* Copyright (c) 1997 Jason R. Thorpe. All rights reserved.
@@ -70,18 +70,26 @@ struct oscsi_attach_args {
struct scsi_inquiry *osa_inqbuf;
};
-int scsi_probe_device __P((int, int, int, struct scsi_inquiry *, int));
+#ifdef _KERNEL
int scsi_print __P((void *, const char *));
+void scsi_delay __P((int));
+void scsistart __P((void *));
void scsireset __P((int));
-int scsireq __P((struct device *, struct scsiqueue *));
-void scsifree __P((struct device *, struct scsiqueue *));
-int scsigo __P((int, int, int, struct buf *, struct scsi_fmt_cdb *, int));
+int scsi_test_unit_rdy __P((int, int, int));
int scsi_request_sense __P((int, int, int, u_char *, u_int));
-int scsiustart __P((int));
+int scsi_immed_command __P((int, int, int, struct scsi_fmt_cdb *,
+ u_char *, u_int, int));
+int scsi_tt_read __P((int, int, int, u_char *, u_int, daddr_t, int));
int scsi_tt_write __P((int, int, int, u_char *, u_int, daddr_t, int));
+int scsireq __P((struct device *, struct scsiqueue *));
+int scsiustart __P((int));
+void scsistart __P((void *));
+int scsigo __P((int, int, int, struct buf *, struct scsi_fmt_cdb *, int));
+void scsidone __P((void *));
+int scsiintr __P((void *));
+void scsifree __P((struct device *, struct scsiqueue *));
int scsi_tt_oddio __P((int, int, int, u_char *, u_int, int, int));
-int scsi_immed_command __P((int, int, int, struct scsi_fmt_cdb *,
- u_char *, u_int, int));
void scsi_str __P((char *, char *, size_t));
-int scsi_test_unit_rdy __P((int, int, int));
+int scsi_probe_device __P((int, int, int, struct scsi_inquiry *, int));
+#endif
diff --git a/sys/arch/hp300/dev/sd.c b/sys/arch/hp300/dev/sd.c
index 1ce13bda0d5..ec0a5846610 100644
--- a/sys/arch/hp300/dev/sd.c
+++ b/sys/arch/hp300/dev/sd.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: sd.c,v 1.9 1997/02/10 06:43:34 downsj Exp $ */
-/* $NetBSD: sd.c,v 1.29 1997/01/30 09:14:20 thorpej Exp $ */
+/* $OpenBSD: sd.c,v 1.10 1997/04/16 11:56:15 downsj Exp $ */
+/* $NetBSD: sd.c,v 1.31 1997/04/02 22:37:36 scottr Exp $ */
/*
* Copyright (c) 1996, 1997 Jason R. Thorpe. All rights reserved.
@@ -47,20 +47,18 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/buf.h>
-#include <sys/stat.h>
-#include <sys/disklabel.h>
+#include <sys/device.h>
#include <sys/disk.h>
+#include <sys/disklabel.h>
+#include <sys/fcntl.h>
+#include <sys/ioctl.h>
#include <sys/malloc.h>
#include <sys/proc.h>
-#include <sys/ioctl.h>
-#include <sys/fcntl.h>
-#include <sys/device.h>
+#include <sys/stat.h>
#include <hp300/dev/scsireg.h>
#include <hp300/dev/scsivar.h>
-
#include <hp300/dev/sdvar.h>
-
#ifdef USELEDS
#include <hp300/hp300/led.h>
#endif
@@ -70,10 +68,12 @@
#include <vm/vm_prot.h>
#include <vm/pmap.h>
+/*
extern void disksort();
extern void biodone();
extern int physio();
extern void TBIS();
+*/
int sdmatch __P((struct device *, void *, void *));
void sdattach __P((struct device *, struct device *, void *));
@@ -86,17 +86,6 @@ struct cfdriver sd_cd = {
NULL, "sd", DV_DISK
};
-void sdstrategy __P((struct buf *));
-void sdustart __P((int));
-
-void sdstart __P((void *));
-void sdgo __P((void *));
-void sdintr __P((void *, int));
-
-int sdgetcapacity __P((struct sd_softc *, dev_t));
-
-static void sdgetgeom __P((struct sd_softc *));
-
#ifdef DEBUG
int sddebug = 1;
#define SDB_ERROR 0x01
@@ -104,8 +93,8 @@ int sddebug = 1;
#define SDB_CAPACITY 0x04
#endif
-static struct scsi_fmt_cdb sd_read_cmd = { 10, CMD_READ_EXT };
-static struct scsi_fmt_cdb sd_write_cmd = { 10, CMD_WRITE_EXT };
+static struct scsi_fmt_cdb sd_read_cmd = { 10, { CMD_READ_EXT } };
+static struct scsi_fmt_cdb sd_write_cmd = { 10, { CMD_WRITE_EXT } };
/*
* Table of scsi commands users are allowed to access via "format"
@@ -132,6 +121,26 @@ static char legal_cmds[256] = {
/*f0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
+/* bdev_decl(sd); */
+/* cdev_decl(sd); */
+/* XXX we should use macros to do these... */
+int sdopen __P((dev_t, int, int, struct proc *));
+int sdclose __P((dev_t, int, int, struct proc *));
+
+int sdioctl __P((dev_t, u_long, caddr_t, int, struct proc *));
+int sdread __P((dev_t, struct uio *, int));
+void sdreset __P((struct sd_softc *));
+int sdwrite __P((dev_t, struct uio *, int));
+
+void sdstrategy __P((struct buf *));
+int sddump __P((dev_t, daddr_t, caddr_t, size_t));
+int sdsize __P((dev_t));
+
+static void sdgetgeom __P((struct sd_softc *));
+static void sdlblkstrat __P((struct buf *, int));
+static int sderror __P((struct sd_softc *, int));
+static void sdfinish __P((struct sd_softc *, struct buf *));
+
/*
* Perform a mode-sense on page 0x04 (rigid geometry).
*/
@@ -145,7 +154,7 @@ sdgetgeom(sc)
} sensebuf;
struct scsi_fmt_cdb modesense_geom = {
6,
- CMD_MODE_SENSE, 0, 0x04, 0, sizeof(sensebuf), 0
+ { CMD_MODE_SENSE, 0, 0x04, 0, sizeof(sensebuf), 0 }
};
int ctlr, slave, unit;
@@ -260,7 +269,7 @@ sdattach(parent, self, aux)
void
sdreset(sc)
- register struct sd_softc *sc;
+ struct sd_softc *sc;
{
sc->sc_stats.sdresets++;
}
@@ -277,7 +286,7 @@ sdgetcapacity(sc, dev)
{
static struct scsi_fmt_cdb cap = {
10,
- CMD_READ_CAPACITY, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ { CMD_READ_CAPACITY, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
u_char *capbuf;
int i, capbufsize;
@@ -377,9 +386,9 @@ sdgetinfo(dev)
{
int unit = sdunit(dev);
struct sd_softc *sc = sd_cd.cd_devs[unit];
- register struct disklabel *lp = sc->sc_dkdev.dk_label;
- register struct partition *pi;
- char *msg, *readdisklabel();
+ struct disklabel *lp = sc->sc_dkdev.dk_label;
+ struct partition *pi;
+ char *msg;
bzero((caddr_t)lp, sizeof *lp);
msg = NULL;
@@ -450,7 +459,7 @@ sdopen(dev, flags, mode, p)
int flags, mode;
struct proc *p;
{
- register int unit = sdunit(dev);
+ int unit = sdunit(dev);
struct sd_softc *sc;
int error, mask, part;
@@ -511,7 +520,7 @@ sdclose(dev, flag, mode, p)
{
int unit = sdunit(dev);
struct sd_softc *sc = sd_cd.cd_devs[unit];
- register struct disk *dk = &sc->sc_dkdev;
+ struct disk *dk = &sc->sc_dkdev;
int mask, s;
mask = 1 << sdpart(dev);
@@ -553,15 +562,15 @@ sdclose(dev, flag, mode, p)
*/
static void
sdlblkstrat(bp, bsize)
- register struct buf *bp;
- register int bsize;
+ struct buf *bp;
+ int bsize;
{
struct sd_softc *sc = sd_cd.cd_devs[sdunit(bp->b_dev)];
- register struct buf *cbp = (struct buf *)malloc(sizeof(struct buf),
+ struct buf *cbp = (struct buf *)malloc(sizeof(struct buf),
M_DEVBUF, M_WAITOK);
caddr_t cbuf = (caddr_t)malloc(bsize, M_DEVBUF, M_WAITOK);
- register int bn, resid;
- register caddr_t addr;
+ int bn, resid;
+ caddr_t addr;
bzero((caddr_t)cbp, sizeof(*cbp));
cbp->b_proc = curproc; /* XXX */
@@ -571,13 +580,13 @@ sdlblkstrat(bp, bsize)
addr = bp->b_un.b_addr;
#ifdef DEBUG
if (sddebug & SDB_PARTIAL)
- printf("sdlblkstrat: bp %x flags %x bn %x resid %x addr %x\n",
+ printf("sdlblkstrat: bp %p flags %lx bn %x resid %x addr %p\n",
bp, bp->b_flags, bn, resid, addr);
#endif
while (resid > 0) {
- register int boff = dbtob(bn) & (bsize - 1);
- register int count;
+ int boff = dbtob(bn) & (bsize - 1);
+ int count;
if (boff || resid < bsize) {
sc->sc_stats.sdpartials++;
@@ -588,7 +597,7 @@ sdlblkstrat(bp, bsize)
cbp->b_bcount = bsize;
#ifdef DEBUG
if (sddebug & SDB_PARTIAL)
- printf(" readahead: bn %x cnt %x off %x addr %x\n",
+ printf(" readahead: bn %x cnt %x off %x addr %p\n",
cbp->b_blkno, count, boff, addr);
#endif
sdstrategy(cbp);
@@ -605,7 +614,7 @@ sdlblkstrat(bp, bsize)
bcopy(addr, &cbuf[boff], count);
#ifdef DEBUG
if (sddebug & SDB_PARTIAL)
- printf(" writeback: bn %x cnt %x off %x addr %x\n",
+ printf(" writeback: bn %x cnt %x off %x addr %p\n",
cbp->b_blkno, count, boff, addr);
#endif
} else {
@@ -615,7 +624,7 @@ sdlblkstrat(bp, bsize)
cbp->b_bcount = count;
#ifdef DEBUG
if (sddebug & SDB_PARTIAL)
- printf(" fulltrans: bn %x cnt %x addr %x\n",
+ printf(" fulltrans: bn %x cnt %x addr %p\n",
cbp->b_blkno, count, addr);
#endif
}
@@ -633,7 +642,7 @@ done:
addr += count;
#ifdef DEBUG
if (sddebug & SDB_PARTIAL)
- printf(" done: bn %x resid %x addr %x\n",
+ printf(" done: bn %x resid %x addr %p\n",
bn, resid, addr);
#endif
}
@@ -643,14 +652,14 @@ done:
void
sdstrategy(bp)
- register struct buf *bp;
+ struct buf *bp;
{
int unit = sdunit(bp->b_dev);
struct sd_softc *sc = sd_cd.cd_devs[unit];
- register struct buf *dp = &sc->sc_tab;
- register struct partition *pinfo;
- register daddr_t bn;
- register int sz, s;
+ struct buf *dp = &sc->sc_tab;
+ struct partition *pinfo;
+ daddr_t bn;
+ int sz, s;
int offset;
if (sc->sc_format_pid >= 0) {
@@ -728,7 +737,7 @@ done:
void
sdustart(unit)
- register int unit;
+ int unit;
{
struct sd_softc *sc = sd_cd.cd_devs[unit];
@@ -801,7 +810,7 @@ sdfinish(sc, bp)
struct sd_softc *sc;
struct buf *bp;
{
- register struct buf *dp = &sc->sc_tab;
+ struct buf *dp = &sc->sc_tab;
dp->b_errcnt = 0;
dp->b_actf = bp->b_actf;
@@ -830,8 +839,8 @@ sdstart(arg)
* so check now.
*/
if (sc->sc_format_pid >= 0 && legal_cmds[sc->sc_cmdstore.cdb[0]] > 0) {
- register struct buf *bp = sc->sc_tab.b_actf;
- register int sts;
+ struct buf *bp = sc->sc_tab.b_actf;
+ int sts;
sc->sc_tab.b_errcnt = 0;
while (1) {
@@ -860,9 +869,9 @@ sdgo(arg)
void *arg;
{
struct sd_softc *sc = arg;
- register struct buf *bp = sc->sc_tab.b_actf;
- register int pad;
- register struct scsi_fmt_cdb *cmd;
+ struct buf *bp = sc->sc_tab.b_actf;
+ int pad;
+ struct scsi_fmt_cdb *cmd;
if (sc->sc_format_pid >= 0) {
cmd = &sc->sc_cmdstore;
@@ -884,7 +893,7 @@ sdgo(arg)
pad = (bp->b_bcount & (sc->sc_blksize - 1)) != 0;
#ifdef DEBUG
if (pad)
- printf("%s: partial block xfer -- %x bytes\n",
+ printf("%s: partial block xfer -- %lx bytes\n",
sc->sc_dev.dv_xname, bp->b_bcount);
#endif
sc->sc_stats.sdtransfers++;
@@ -902,7 +911,7 @@ sdgo(arg)
}
#ifdef DEBUG
if (sddebug & SDB_ERROR)
- printf("%s: sdstart: %s adr %d blk %d len %d ecnt %d\n",
+ printf("%s: sdstart: %s adr %p blk %ld len %ld ecnt %ld\n",
sc->sc_dev.dv_xname,
bp->b_flags & B_READ? "read" : "write",
bp->b_un.b_addr, bp->b_cylin, bp->b_bcount,
@@ -918,9 +927,8 @@ sdintr(arg, stat)
void *arg;
int stat;
{
- register struct sd_softc *sc = arg;
- int unit = sc->sc_dev.dv_unit;
- register struct buf *bp = sc->sc_tab.b_actf;
+ struct sd_softc *sc = arg;
+ struct buf *bp = sc->sc_tab.b_actf;
int cond;
if (bp == NULL) {
@@ -941,7 +949,7 @@ sdintr(arg, stat)
if (cond < 0 && sc->sc_tab.b_errcnt++ < SDRETRY) {
#ifdef DEBUG
if (sddebug & SDB_ERROR)
- printf("%s: retry #%d\n",
+ printf("%s: retry #%ld\n",
sc->sc_dev.dv_xname,
sc->sc_tab.b_errcnt);
#endif
@@ -961,9 +969,9 @@ sdread(dev, uio, flags)
struct uio *uio;
int flags;
{
- register int unit = sdunit(dev);
+ int unit = sdunit(dev);
struct sd_softc *sc = sd_cd.cd_devs[unit];
- register int pid;
+ int pid;
if ((pid = sc->sc_format_pid) >= 0 &&
pid != uio->uio_procp->p_pid)
@@ -978,9 +986,9 @@ sdwrite(dev, uio, flags)
struct uio *uio;
int flags;
{
- register int unit = sdunit(dev);
+ int unit = sdunit(dev);
struct sd_softc *sc = sd_cd.cd_devs[unit];
- register int pid;
+ int pid;
if ((pid = sc->sc_format_pid) >= 0 &&
pid != uio->uio_procp->p_pid)
@@ -992,14 +1000,14 @@ sdwrite(dev, uio, flags)
int
sdioctl(dev, cmd, data, flag, p)
dev_t dev;
- int cmd;
+ u_long cmd;
caddr_t data;
int flag;
struct proc *p;
{
int unit = sdunit(dev);
struct sd_softc *sc = sd_cd.cd_devs[unit];
- register struct disklabel *lp = sc->sc_dkdev.dk_label;
+ struct disklabel *lp = sc->sc_dkdev.dk_label;
int error, flags;
switch (cmd) {
@@ -1096,7 +1104,7 @@ int
sdsize(dev)
dev_t dev;
{
- register int unit = sdunit(dev);
+ int unit = sdunit(dev);
struct sd_softc *sc = sd_cd.cd_devs[unit];
int psize, didopen = 0;
@@ -1141,7 +1149,6 @@ sddump(dev, blkno, va, size)
int unit, part;
struct sd_softc *sc;
struct disklabel *lp;
- daddr_t baddr;
char stat;
/* Check for recursive dump; if so, punt. */
diff --git a/sys/arch/hp300/dev/sdvar.h b/sys/arch/hp300/dev/sdvar.h
index a23d9dccc6b..540cd804726 100644
--- a/sys/arch/hp300/dev/sdvar.h
+++ b/sys/arch/hp300/dev/sdvar.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: sdvar.h,v 1.7 1997/02/10 01:33:58 downsj Exp $ */
-/* $NetBSD: sdvar.h,v 1.6 1997/01/30 09:14:22 thorpej Exp $ */
+/* $OpenBSD: sdvar.h,v 1.8 1997/04/16 11:56:16 downsj Exp $ */
+/* $NetBSD: sdvar.h,v 1.7 1997/03/31 07:40:07 scottr Exp $ */
/*
* Copyright (c) 1990, 1993
@@ -81,3 +81,18 @@ struct sd_softc {
#define b_cylin b_resid
#define SDRETRY 2
+
+#ifdef _KERNEL
+/* sd.c */
+void sdustart __P((int));
+
+void sdstart __P((void *));
+void sdgo __P((void *));
+void sdintr __P((void *, int));
+
+int sdgetcapacity __P((struct sd_softc *, dev_t));
+int sdgetinfo __P((dev_t));
+
+/* sd_compat.c */
+void sdmakedisklabel __P((int, struct disklabel *));
+#endif /* _KERNEL */
diff --git a/sys/arch/hp300/dev/st.c b/sys/arch/hp300/dev/st.c
index 7b7b91ec524..15862c5d282 100644
--- a/sys/arch/hp300/dev/st.c
+++ b/sys/arch/hp300/dev/st.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: st.c,v 1.7 1997/03/26 08:41:42 downsj Exp $ */
-/* $NetBSD: st.c,v 1.20 1997/03/22 00:17:59 mycroft Exp $ */
+/* $OpenBSD: st.c,v 1.8 1997/04/16 11:56:17 downsj Exp $ */
+/* $NetBSD: st.c,v 1.22 1997/04/02 22:37:38 scottr Exp $ */
/*
* Copyright (c) 1996, 1997 Jason R. Thorpe. All rights reserved.
@@ -90,64 +90,8 @@
#include <hp300/dev/scsireg.h>
#include <hp300/dev/scsivar.h>
-
#include <hp300/dev/stvar.h>
-struct st_xsense {
- struct scsi_xsense sc_xsense; /* data from sense */
- struct exb_xsense exb_xsense; /* additional info from exabyte */
-};
-
-struct st_softc {
- struct device sc_dev;
- struct scsiqueue sc_sq;
- long sc_blkno; /* (possible block device support?) */
- long sc_resid; /* (possible block device support?) */
- int sc_flags;
- int sc_blklen; /* 0 = variable len records */
- int sc_filepos; /* file position on tape */
- long sc_numblks; /* number of blocks on tape */
- short sc_type; /* ansi scsi type */
- int sc_target;
- int sc_lun;
- short sc_tapeid; /* tape drive id */
- char sc_datalen[32]; /* additional data length on some commands */
- short sc_tticntdwn; /* interrupts between TTi display updates */
- tpr_t sc_ctty;
- struct buf *sc_bp;
- u_char sc_cmd;
- struct st_xsense sc_sense;
- struct scsi_fmt_cdb sc_cmdstore;
- struct buf sc_tab; /* buffer queue */
- struct buf sc_bufstore; /* XXX buffer storage */
-};
-
-/* softc flags */
-#define STF_ALIVE 0x0001
-#define STF_OPEN 0x0002
-#define STF_WMODE 0x0004
-#define STF_WRTTN 0x0008
-#define STF_CMD 0x0010
-#define STF_LEOT 0x0020
-#define STF_MOVED 0x0040
-
-int stmatch __P((struct device *, void *, void *));
-void stattach __P((struct device *, struct device *, void *));
-
-struct cfattach st_ca = {
- sizeof(struct st_softc), stmatch, stattach
-};
-
-struct cfdriver st_cd = {
- NULL, "st", DV_TAPE
-};
-
-void stustart __P((int));
-
-void ststart __P((void *));
-void stgo __P((void *));
-void stintr __P((void *, int));
-
static struct scsi_fmt_cdb st_read_cmd = { 6, CMD_READ };
static struct scsi_fmt_cdb st_write_cmd = { 6, CMD_WRITE };
@@ -218,7 +162,39 @@ int st_extti = 0x01; /* bitmask of unit numbers, do extra */
/* sensing so TTi display gets updated */
#endif
-int
+/* bdev_decl(st); */
+/* cdev_decl(st); */
+/* XXX we should use macros to do these... */
+int stopen __P((dev_t, int, int, struct proc *));
+int stclose __P((dev_t, int, int, struct proc *));
+
+int stioctl __P((dev_t, u_long, caddr_t, int, struct proc *));
+int stread __P((dev_t, struct uio *, int));
+int stwrite __P((dev_t, struct uio *, int));
+
+void ststrategy __P((struct buf *));
+int stdump __P((dev_t));
+
+#ifdef DEBUG
+void dumpxsense __P((struct st_xsense *));
+void prtmodsel __P((struct mode_select_data *, int));
+void prtmodstat __P((struct mode_sense *));
+#endif /* DEBUG */
+
+static void stfinish __P((struct st_softc *, struct buf *));
+static void sterror __P((struct st_softc *, int));
+static int stmatch __P((struct device *, void *, void *));
+static void stattach __P((struct device *, struct device *, void *));
+
+struct cfattach st_ca = {
+ sizeof(struct st_softc), stmatch, stattach
+};
+
+struct cfdriver st_cd = {
+ NULL, "st", DV_TAPE
+};
+
+static int
stmatch(parent, match, aux)
struct device *parent;
void *match, *aux;
@@ -243,7 +219,7 @@ stmatch(parent, match, aux)
return (1);
}
-void
+static void
stattach(parent, self, aux)
struct device *parent, *self;
void *aux;
@@ -343,15 +319,16 @@ stattach(parent, self, aux)
sc->sc_flags = STF_ALIVE;
}
+int
stopen(dev, flag, type, p)
dev_t dev;
int flag, type;
struct proc *p;
{
- register struct st_softc *sc;
- register struct st_xsense *xsense;
- register int count;
- register int stat;
+ struct st_softc *sc;
+ struct st_xsense *xsense;
+ int count;
+ int stat;
int ctlr, slave, unit;
struct mode_select_data msd;
struct mode_sense mode;
@@ -359,11 +336,11 @@ stopen(dev, flag, type, p)
int error;
static struct scsi_fmt_cdb modsel = {
6,
- CMD_MODE_SELECT, 0, 0, 0, sizeof(msd), 0
+ { CMD_MODE_SELECT, 0, 0, 0, sizeof(msd), 0 }
};
static struct scsi_fmt_cdb modsense = {
6,
- CMD_MODE_SENSE, 0, 0, 0, sizeof(mode), 0
+ { CMD_MODE_SENSE, 0, 0, 0, sizeof(mode), 0 }
};
if (UNIT(dev) > st_cd.cd_ndevs ||
@@ -527,8 +504,8 @@ retryselect:
uprintf("SCSI bus timeout\n");
return(EBUSY);
}
- if (error = tsleep((caddr_t)&lbolt, PZERO | PCATCH,
- "st_scsiwait", 0))
+ if ((error = tsleep((caddr_t)&lbolt, PZERO | PCATCH,
+ "st_scsiwait", 0)))
return (error);
goto retryselect;
}
@@ -640,12 +617,14 @@ retryselect:
}
/*ARGSUSED*/
-stclose(dev, flag)
+int
+stclose(dev, flag, mode, p)
dev_t dev;
- int flag;
+ int flag, mode;
+ struct proc *p;
{
struct st_softc *sc = st_cd.cd_devs[UNIT(dev)];
- register int hit = 0;
+ int hit = 0;
if ((sc->sc_flags & (STF_WMODE|STF_WRTTN)) == (STF_WMODE|STF_WRTTN)) {
/*
@@ -679,7 +658,7 @@ stclose(dev, flag)
void
ststrategy(bp)
- register struct buf *bp;
+ struct buf *bp;
{
struct st_softc *sc;
struct buf *dp;
@@ -726,8 +705,8 @@ stgo(arg)
void *arg;
{
struct st_softc *sc = arg;
- register struct scsi_fmt_cdb *cmd;
- register struct buf *bp = sc->sc_tab.b_actf;
+ struct scsi_fmt_cdb *cmd;
+ struct buf *bp = sc->sc_tab.b_actf;
int pad, stat;
long nblks;
@@ -780,7 +759,7 @@ stgo(arg)
if (bp->b_bcount & 1) {
#ifdef DEBUG
if (st_debug & ST_ODDIO)
- printf("%s: stgo: odd count %d using manual transfer\n",
+ printf("%s: stgo: odd count %ld using manual transfer\n",
sc->sc_dev.dv_xname, bp->b_bcount);
#endif
stat = scsi_tt_oddio(sc->sc_dev.dv_parent->dv_unit,
@@ -803,14 +782,15 @@ stgo(arg)
}
}
+static void
stfinish(sc, bp)
struct st_softc *sc;
struct buf *bp;
{
- register struct buf *dp;
+ struct buf *dp;
sc->sc_tab.b_errcnt = 0;
- if (dp = bp->b_actf)
+ if ((dp = bp->b_actf))
dp->b_actb = bp->b_actb;
else
sc->sc_tab.b_actb = bp->b_actb;
@@ -845,6 +825,7 @@ stwrite(dev, uio, flags)
}
/*ARGSUSED*/
+int
stdump(dev)
dev_t dev;
{
@@ -852,19 +833,20 @@ stdump(dev)
}
/*ARGSUSED*/
+int
stioctl(dev, cmd, data, flag, p)
dev_t dev;
- int cmd;
+ u_long cmd;
caddr_t data;
int flag;
struct proc *p;
{
struct st_softc *sc = st_cd.cd_devs[UNIT(dev)];
- register int cnt;
- register struct mtget *mtget;
- register struct st_xsense *xp = &sc->sc_sense;
- register struct mtop *op;
- long resid;
+ int cnt;
+ struct mtget *mtget;
+ struct st_xsense *xp = &sc->sc_sense;
+ struct mtop *op;
+ long resid = 0; /* XXX compiler complains needlessly :-( */
switch (cmd) {
@@ -944,10 +926,9 @@ stintr(arg, stat)
void *arg;
int stat;
{
- register struct st_softc *sc = arg;
- int unit = sc->sc_dev.dv_unit;
- register struct st_xsense *xp = &sc->sc_sense;
- register struct buf *bp = sc->sc_tab.b_actf;
+ struct st_softc *sc = arg;
+ struct st_xsense *xp = &sc->sc_sense;
+ struct buf *bp = sc->sc_tab.b_actf;
#ifdef DEBUG
if (bp == NULL) {
@@ -992,7 +973,7 @@ stintr(arg, stat)
*/
if (sc->sc_blklen) {
tprintf(sc->sc_ctty,
- "%s: Incorrect Length Indicator, blkcnt diff %d\n",
+ "%s: Incorrect Length Indicator, blkcnt diff %ld\n",
sc->sc_dev.dv_xname,
sc->sc_blklen - bp->b_resid);
bp->b_flags |= B_ERROR;
@@ -1019,7 +1000,7 @@ stintr(arg, stat)
*/
if (!st_dmaoddretry) {
tprintf(sc->sc_ctty,
- "%s: Odd length read %d\n",
+ "%s: Odd length read %ld\n",
sc->sc_dev.dv_xname,
bp->b_bcount - bp->b_resid);
bp->b_error = EIO;
@@ -1031,7 +1012,7 @@ stintr(arg, stat)
*/
#ifdef DEBUG
if (st_debug & ST_ODDIO)
- printf("%s: stintr odd count %d, do BSR then oddio\n",
+ printf("%s: stintr odd count %ld, do BSR then oddio\n",
sc->sc_dev.dv_xname,
bp->b_bcount - bp->b_resid);
#endif
@@ -1073,7 +1054,7 @@ stintr(arg, stat)
}
#ifdef DEBUG
if ((st_debug & ST_BRESID) && bp->b_resid != 0)
- printf("b_resid %d b_flags 0x%x b_error 0x%x\n",
+ printf("b_resid %ld b_flags 0x%lx b_error 0x%x\n",
bp->b_resid, bp->b_flags, bp->b_error);
#endif
/* asked for more filemarks then on tape */
@@ -1085,7 +1066,7 @@ stintr(arg, stat)
}
#ifdef TTI
- if (st_extti & (1<<unit) &&
+ if (st_extti & (1 << sc->sc_dev.dv_unit) &&
sc->sc_type == MT_ISEXABYTE) /* to make display lit up */
/*
* XXX severe performance penality for this.
@@ -1102,16 +1083,16 @@ stintr(arg, stat)
stfinish(sc, bp);
}
+void
stcommand(dev, command, cnt)
dev_t dev;
u_int command;
int cnt;
{
struct st_softc *sc = st_cd.cd_devs[UNIT(dev)];
- register struct buf *bp = &sc->sc_bufstore;
- register struct scsi_fmt_cdb *cmd = &sc->sc_cmdstore;
- register cmdcnt;
- int s;
+ struct buf *bp = &sc->sc_bufstore;
+ struct scsi_fmt_cdb *cmd = &sc->sc_cmdstore;
+ int cmdcnt, s;
cmd->len = 6; /* all tape commands are cdb6 */
cmd->cdb[1] = sc->sc_lun;
@@ -1224,6 +1205,7 @@ again:
sc->sc_flags &= ~(STF_CMD|STF_WRTTN);
}
+static void
sterror(sc, stat)
struct st_softc *sc;
int stat;
@@ -1240,22 +1222,22 @@ sterror(sc, stat)
sc->sc_filepos--;
}
+void
stxsense(ctlr, slave, unit, sc)
int ctlr, slave, unit;
struct st_softc *sc;
{
- u_char *sensebuf;
unsigned len;
- sensebuf = (u_char *)&sc->sc_sense;
len = sc->sc_datalen[CMD_REQUEST_SENSE];
- scsi_request_sense(ctlr, slave, unit, sensebuf, len);
+ scsi_request_sense(ctlr, slave, unit, (u_char *)&sc->sc_sense, len);
}
+void
prtkey(sc)
struct st_softc *sc;
{
- register struct st_xsense *xp = &sc->sc_sense;
+ struct st_xsense *xp = &sc->sc_sense;
switch (xp->sc_xsense.key) {
case XSK_NOSENCE:
@@ -1366,7 +1348,7 @@ prtkey(sc)
}
#ifdef DEBUG
-
+void
dumpxsense(sensebuf)
struct st_xsense *sensebuf;
{
@@ -1409,6 +1391,7 @@ dumpxsense(sensebuf)
(xp->exb_xsense.tplft0)) );
}
+void
prtmodsel(msd, modlen)
struct mode_select_data *msd;
int modlen;
@@ -1422,6 +1405,7 @@ prtmodsel(msd, modlen)
msd->vupb,msd->rsvd5,msd->p5,msd->motionthres,msd->reconthres,msd->gapthres);
}
+void
prtmodstat(mode)
struct mode_sense *mode;
{
diff --git a/sys/arch/hp300/dev/stvar.h b/sys/arch/hp300/dev/stvar.h
index 5c32757078d..f8c5a881e97 100644
--- a/sys/arch/hp300/dev/stvar.h
+++ b/sys/arch/hp300/dev/stvar.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: stvar.h,v 1.2 1997/01/12 15:13:06 downsj Exp $ */
-/* $NetBSD: stvar.h,v 1.4 1994/10/26 07:25:14 cgd Exp $ */
+/* $OpenBSD: stvar.h,v 1.3 1997/04/16 11:56:17 downsj Exp $ */
+/* $NetBSD: stvar.h,v 1.6 1997/04/02 22:37:40 scottr Exp $ */
/*
* Copyright (c) 1990 University of Utah.
@@ -44,7 +44,6 @@
/*
* stvar.h scsi tape driver
*/
-
struct exb_xsense {
u_char reserved8;
u_char reserved9;
@@ -174,3 +173,52 @@ struct mode_sense {
"\20\20VAL\17FMK\16EOM\15ILI\14KEY3\13KEY2\12KEY1\11KEY0\
\10RETRY7\7RETRY6\6RETRY5\5RETRY4\4RETRY3\3RETRY2\2RETRY1\1RETRY0"
+struct st_xsense {
+ struct scsi_xsense sc_xsense; /* data from sense */
+ struct exb_xsense exb_xsense; /* additional info from exabyte */
+};
+
+struct st_softc {
+ struct device sc_dev;
+ struct scsiqueue sc_sq;
+ long sc_blkno; /* (possible block device support?) */
+ long sc_resid; /* (possible block device support?) */
+ int sc_flags;
+ int sc_blklen; /* 0 = variable len records */
+ int sc_filepos; /* file position on tape */
+ long sc_numblks; /* number of blocks on tape */
+ short sc_type; /* ansi scsi type */
+ int sc_target;
+ int sc_lun;
+ short sc_tapeid; /* tape drive id */
+ char sc_datalen[32]; /* additional data length on some commands */
+ short sc_tticntdwn; /* interrupts between TTi display updates */
+ tpr_t sc_ctty;
+ struct buf *sc_bp;
+ u_char sc_cmd;
+ struct st_xsense sc_sense;
+ struct scsi_fmt_cdb sc_cmdstore;
+ struct buf sc_tab; /* buffer queue */
+ struct buf sc_bufstore; /* XXX buffer storage */
+};
+
+/* softc flags */
+#define STF_ALIVE 0x0001
+#define STF_OPEN 0x0002
+#define STF_WMODE 0x0004
+#define STF_WRTTN 0x0008
+#define STF_CMD 0x0010
+#define STF_LEOT 0x0020
+#define STF_MOVED 0x0040
+
+#ifdef _KERNEL
+void stcommand __P((dev_t, u_int, int));
+void stustart __P((int));
+
+void ststart __P((void *));
+void stgo __P((void *));
+void stintr __P((void *, int));
+
+void stxsense __P((int, int, int, struct st_softc *));
+void prtkey __P((struct st_softc *));
+#endif /* _KERNEL */
diff --git a/sys/arch/hp300/hp300/autoconf.c b/sys/arch/hp300/hp300/autoconf.c
index e4d5517fdcf..131c2b7b810 100644
--- a/sys/arch/hp300/hp300/autoconf.c
+++ b/sys/arch/hp300/hp300/autoconf.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: autoconf.c,v 1.14 1997/02/20 18:13:37 downsj Exp $ */
-/* $NetBSD: autoconf.c,v 1.33 1997/02/05 20:56:29 thorpej Exp $ */
+/* $OpenBSD: autoconf.c,v 1.15 1997/04/16 11:56:20 downsj Exp $ */
+/* $NetBSD: autoconf.c,v 1.36 1997/04/14 02:28:43 thorpej Exp $ */
/*
* Copyright (c) 1996 Jason R. Thorpe. All rights reserved.
@@ -66,33 +66,35 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/map.h>
-#include <sys/malloc.h>
#include <sys/buf.h>
-#include <sys/disklabel.h>
-#include <sys/device.h>
#include <sys/conf.h>
-#include <sys/dmap.h>
-#include <sys/reboot.h>
#include <sys/device.h>
+#include <sys/disklabel.h>
+#include <sys/dmap.h>
+#include <sys/malloc.h>
+#include <sys/map.h>
#include <sys/mount.h>
#include <sys/queue.h>
+#include <sys/reboot.h>
+#include <sys/tty.h>
#include <dev/cons.h>
#include <machine/autoconf.h>
#include <machine/vmparam.h>
#include <machine/cpu.h>
+#include <machine/intr.h>
#include <machine/pte.h>
-#include <hp300/hp300/isr.h>
-
#include <hp300/dev/dioreg.h>
#include <hp300/dev/diovar.h>
#include <hp300/dev/diodevs.h>
+#include <hp300/dev/dmavar.h>
#include <hp300/dev/grfreg.h>
#include <hp300/dev/hilreg.h>
+#include <hp300/dev/hilioctl.h>
+#include <hp300/dev/hilvar.h>
#include <hp300/dev/hpibvar.h>
#include <hp300/dev/scsivar.h>
@@ -245,9 +247,6 @@ configure()
LIST_INIT(&dev_data_list_hpib);
LIST_INIT(&dev_data_list_scsi);
- /* Initialize the interrupt system. */
- isrinit();
-
/*
* XXX Enable interrupts. We have to do this now so that the
* XXX HIL configures.
@@ -266,7 +265,7 @@ configure()
panic("no mainbus found");
(void)spl0();
- isrprintlevels();
+ intr_printlevels();
/*
* Find boot device.
diff --git a/sys/arch/hp300/hp300/clock.c b/sys/arch/hp300/hp300/clock.c
index f96a8f2ee3b..61d3ab2f263 100644
--- a/sys/arch/hp300/hp300/clock.c
+++ b/sys/arch/hp300/hp300/clock.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: clock.c,v 1.3 1997/01/12 15:13:11 downsj Exp $ */
-/* $NetBSD: clock.c,v 1.18 1996/10/13 03:14:27 christos Exp $ */
+/* $OpenBSD: clock.c,v 1.4 1997/04/16 11:56:21 downsj Exp $ */
+/* $NetBSD: clock.c,v 1.19 1997/04/01 03:12:09 scottr Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -52,12 +52,16 @@
*/
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/kernel.h>
+#include <sys/tty.h>
#include <machine/psl.h>
#include <machine/cpu.h>
#include <hp300/dev/hilreg.h>
+#include <hp300/dev/hilioctl.h>
+#include <hp300/dev/hilvar.h>
#include <hp300/hp300/clockreg.h>
#ifdef GPROF
@@ -84,12 +88,17 @@ static int statprev; /* previous value in stat timer */
static int month_days[12] = {
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
};
-struct bbc_tm *gmt_to_bbc();
u_char bbc_registers[13];
-u_char write_bbc_reg(), read_bbc_reg();
struct hil_dev *bbcaddr = NULL;
+void statintr __P((struct clockframe *));
+
void hp300_calibrate_delay __P((void));
+struct bbc_tm *gmt_to_bbc __P((long));
+int bbc_to_gmt __P((u_long *));
+void read_bbc __P((void));
+u_char read_bbc_reg __P((int));
+u_char write_bbc_reg __P((int, u_int));
/*
* Machine-dependent clock routines.
@@ -188,10 +197,11 @@ hp300_calibrate_delay()
* Set up the real-time and statistics clocks. Leave stathz 0 only if
* no alternative timer is available.
*/
+void
cpu_initclocks()
{
- register volatile struct clkreg *clk;
- register int intvl, statint, profint, minint;
+ volatile struct clkreg *clk;
+ int intvl, statint, profint, minint;
clkstd[0] = IIOV(0x5F8000); /* XXX grot */
clk = (volatile struct clkreg *)clkstd[0];
@@ -277,8 +287,8 @@ void
statintr(fp)
struct clockframe *fp;
{
- register volatile struct clkreg *clk;
- register int newint, r, var;
+ volatile struct clkreg *clk;
+ int newint, r, var;
clk = (volatile struct clkreg *)clkstd[0];
var = statvar;
@@ -307,10 +317,10 @@ statintr(fp)
*/
void
microtime(tvp)
- register struct timeval *tvp;
+ struct timeval *tvp;
{
- register volatile struct clkreg *clk;
- register int s, u, t, u2, s2;
+ volatile struct clkreg *clk;
+ int s, u, t, u2, s2;
/*
* Read registers from slowest-changing to fastest-changing,
@@ -345,6 +355,7 @@ microtime(tvp)
* Initialize the time of day register, based on the time base which is, e.g.
* from a filesystem.
*/
+void
inittodr(base)
time_t base;
{
@@ -383,10 +394,11 @@ inittodr(base)
/*
* Restore the time of day hardware after a time change.
*/
+void
resettodr()
{
- register int i;
- register struct bbc_tm *tmptr;
+ int i;
+ struct bbc_tm *tmptr;
tmptr = gmt_to_bbc(time.tv_sec);
@@ -413,8 +425,8 @@ struct bbc_tm *
gmt_to_bbc(tim)
long tim;
{
- register int i;
- register long hms, day;
+ int i;
+ long hms, day;
static struct bbc_tm rt;
day = tim / SECDAY;
@@ -444,11 +456,12 @@ gmt_to_bbc(tim)
return(&rt);
}
+int
bbc_to_gmt(timbuf)
u_long *timbuf;
{
- register int i;
- register u_long tmp;
+ int i;
+ u_long tmp;
int year, month, day, hour, min, sec;
read_bbc();
@@ -486,9 +499,10 @@ bbc_to_gmt(timbuf)
return(1);
}
+void
read_bbc()
{
- register int i, read_okay;
+ int i, read_okay;
read_okay = 0;
while (!read_okay) {
diff --git a/sys/arch/hp300/hp300/conf.c b/sys/arch/hp300/hp300/conf.c
index 736be6f3d6b..f4d88b1a692 100644
--- a/sys/arch/hp300/hp300/conf.c
+++ b/sys/arch/hp300/hp300/conf.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: conf.c,v 1.14 1997/02/16 14:37:11 downsj Exp $ */
-/* $NetBSD: conf.c,v 1.34 1996/12/17 08:41:20 thorpej Exp $ */
+/* $OpenBSD: conf.c,v 1.15 1997/04/16 11:56:21 downsj Exp $ */
+/* $NetBSD: conf.c,v 1.38 1997/04/01 03:12:10 scottr Exp $ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
@@ -207,6 +207,7 @@ dev_t swapdev = makedev(3, 0);
/*
* Returns true if dev is /dev/mem or /dev/kmem.
*/
+int
iskmemdev(dev)
dev_t dev;
{
@@ -217,6 +218,7 @@ iskmemdev(dev)
/*
* Returns true if dev is /dev/zero.
*/
+int
iszerodev(dev)
dev_t dev;
{
@@ -267,6 +269,7 @@ static int chrtoblktbl[] = {
/*
* Convert a character device number to a block device number.
*/
+dev_t
chrtoblk(dev)
dev_t dev;
{
diff --git a/sys/arch/hp300/hp300/db_memrw.c b/sys/arch/hp300/hp300/db_memrw.c
index fbe6458d70a..35f4804078e 100644
--- a/sys/arch/hp300/hp300/db_memrw.c
+++ b/sys/arch/hp300/hp300/db_memrw.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: db_memrw.c,v 1.1 1997/01/12 15:13:14 downsj Exp $ */
-/* $NetBSD: db_memrw.c,v 1.2 1996/12/09 17:38:27 thorpej Exp $ */
+/* $OpenBSD: db_memrw.c,v 1.2 1997/04/16 11:56:22 downsj Exp $ */
+/* $NetBSD: db_memrw.c,v 1.3 1997/04/01 03:12:12 scottr Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -78,10 +78,10 @@ static void db_write_text __P((vm_offset_t, size_t, char *));
void
db_read_bytes(addr, size, data)
vm_offset_t addr;
- register size_t size;
- register char *data;
+ size_t size;
+ char *data;
{
- register char *src = (char*)addr;
+ char *src = (char*)addr;
if (size == 4) {
*((int*)data) = *((int*)src);
@@ -107,10 +107,10 @@ db_read_bytes(addr, size, data)
static void
db_write_text(addr, size, data)
vm_offset_t addr;
- register size_t size;
- register char *data;
+ size_t size;
+ char *data;
{
- register char *dst, *odst;
+ char *dst, *odst;
pt_entry_t *pte, oldpte, tmppte;
vm_offset_t pgva;
int limit;
@@ -197,10 +197,10 @@ extern char kernel_text[], etext[];
void
db_write_bytes(addr, size, data)
vm_offset_t addr;
- register size_t size;
- register char *data;
+ size_t size;
+ char *data;
{
- register char *dst = (char *)addr;
+ char *dst = (char *)addr;
/* If any part is in kernel text, use db_write_text() */
if ((dst < etext) && ((dst + size) > kernel_text)) {
diff --git a/sys/arch/hp300/hp300/disksubr.c b/sys/arch/hp300/hp300/disksubr.c
index 1256d41c6d3..928f908c500 100644
--- a/sys/arch/hp300/hp300/disksubr.c
+++ b/sys/arch/hp300/hp300/disksubr.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: disksubr.c,v 1.4 1997/04/07 08:59:19 deraadt Exp $ */
-/* $NetBSD: disksubr.c,v 1.8 1996/02/02 19:50:26 scottr Exp $ */
+/* $OpenBSD: disksubr.c,v 1.5 1997/04/16 11:56:22 downsj Exp $ */
+/* $NetBSD: disksubr.c,v 1.9 1997/04/01 03:12:13 scottr Exp $ */
/*
* Copyright (c) 1982, 1986, 1988, 1993
@@ -44,6 +44,7 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/buf.h>
+#include <sys/disk.h>
#include <sys/disklabel.h>
#include <sys/syslog.h>
@@ -66,11 +67,11 @@ dk_establish(dk, dev)
char *
readdisklabel(dev, strat, lp, osdep)
dev_t dev;
- void (*strat)();
- register struct disklabel *lp;
+ void (*strat) __P((struct buf *));
+ struct disklabel *lp;
struct cpu_disklabel *osdep;
{
- register struct buf *bp;
+ struct buf *bp;
struct disklabel *dlp;
char *msg = NULL;
@@ -120,12 +121,12 @@ readdisklabel(dev, strat, lp, osdep)
*/
int
setdisklabel(olp, nlp, openmask, osdep)
- register struct disklabel *olp, *nlp;
+ struct disklabel *olp, *nlp;
u_long openmask;
struct cpu_disklabel *osdep;
{
- register i;
- register struct partition *opp, *npp;
+ int i;
+ struct partition *opp, *npp;
if (nlp->d_magic != DISKMAGIC || nlp->d_magic2 != DISKMAGIC ||
dkcksum(nlp) != 0)
@@ -162,8 +163,8 @@ setdisklabel(olp, nlp, openmask, osdep)
int
writedisklabel(dev, strat, lp, osdep)
dev_t dev;
- void (*strat)();
- register struct disklabel *lp;
+ void (*strat) __P((struct buf *));
+ struct disklabel *lp;
struct cpu_disklabel *osdep;
{
struct buf *bp;
@@ -183,7 +184,7 @@ writedisklabel(dev, strat, lp, osdep)
bp->b_bcount = lp->d_secsize;
bp->b_flags = B_READ;
(*strat)(bp);
- if (error = biowait(bp))
+ if ((error = biowait(bp)))
goto done;
for (dlp = (struct disklabel *)bp->b_data;
dlp <= (struct disklabel *)
diff --git a/sys/arch/hp300/hp300/dkbad.c b/sys/arch/hp300/hp300/dkbad.c
index f504e699b9b..50aea2df4a0 100644
--- a/sys/arch/hp300/hp300/dkbad.c
+++ b/sys/arch/hp300/hp300/dkbad.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: dkbad.c,v 1.2 1997/01/12 15:13:15 downsj Exp $ */
-/* $NetBSD: dkbad.c,v 1.4 1994/10/26 07:25:33 cgd Exp $ */
+/* $OpenBSD: dkbad.c,v 1.3 1997/04/16 11:56:23 downsj Exp $ */
+/* $NetBSD: dkbad.c,v 1.5 1997/04/01 03:12:15 scottr Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@@ -41,18 +41,21 @@
#include <sys/buf.h>
#include <sys/dkbad.h>
+int isbad __P((struct dkbad *, int, int, int));
+
/*
* Search the bad sector table looking for
* the specified sector. Return index if found.
* Return -1 if not found.
*/
+int
isbad(bt, cyl, trk, sec)
- register struct dkbad *bt;
+ struct dkbad *bt;
int cyl, trk, sec;
{
- register int i;
- register long blk, bblk;
+ int i;
+ long blk, bblk;
blk = ((long)cyl << 16) + (trk << 8) + sec;
for (i = 0; i < 126; i++) {
diff --git a/sys/arch/hp300/hp300/hpux_machdep.c b/sys/arch/hp300/hp300/hpux_machdep.c
index c7cb54e0a56..360b58fb6ce 100644
--- a/sys/arch/hp300/hp300/hpux_machdep.c
+++ b/sys/arch/hp300/hp300/hpux_machdep.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: hpux_machdep.c,v 1.4 1997/03/26 08:32:41 downsj Exp $ */
-/* $NetBSD: hpux_machdep.c,v 1.9 1997/03/16 10:00:45 thorpej Exp $ */
+/* $OpenBSD: hpux_machdep.c,v 1.5 1997/04/16 11:56:23 downsj Exp $ */
+/* $NetBSD: hpux_machdep.c,v 1.12 1997/04/02 22:41:34 scottr Exp $ */
/*
* Copyright (c) 1995, 1996, 1997 Jason R. Thorpe. All rights reserved.
@@ -45,27 +45,30 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/signalvar.h>
-#include <sys/kernel.h>
-#include <sys/filedesc.h>
-#include <sys/proc.h>
#include <sys/buf.h>
-#include <sys/wait.h>
-#include <sys/file.h>
+#include <sys/conf.h>
+#include <sys/device.h>
#include <sys/exec.h>
-#include <sys/namei.h>
-#include <sys/vnode.h>
+#include <sys/file.h>
+#include <sys/filedesc.h>
#include <sys/ioctl.h>
-#include <sys/ptrace.h>
-#include <sys/stat.h>
-#include <sys/syslog.h>
+#include <sys/ipc.h>
+#include <sys/kernel.h>
#include <sys/malloc.h>
+#include <sys/mman.h>
#include <sys/mount.h>
-#include <sys/ipc.h>
#include <sys/namei.h>
+#include <sys/namei.h>
+#include <sys/poll.h>
+#include <sys/proc.h>
+#include <sys/ptrace.h>
+#include <sys/signalvar.h>
+#include <sys/stat.h>
+#include <sys/syslog.h>
+#include <sys/tty.h>
#include <sys/user.h>
-#include <sys/mman.h>
-#include <sys/conf.h>
+#include <sys/vnode.h>
+#include <sys/wait.h>
#include <machine/cpu.h>
#include <machine/reg.h>
@@ -76,12 +79,17 @@
#include <vm/vm_param.h>
#include <vm/vm_map.h>
-#include <machine/cpu.h>
-#include <machine/reg.h>
+#include <arch/hp300/dev/grfreg.h>
+#include <arch/hp300/dev/grfioctl.h>
+#include <arch/hp300/dev/grfvar.h>
+#include <arch/hp300/dev/hilreg.h>
+#include <arch/hp300/dev/hilioctl.h>
+#include <arch/hp300/dev/hilvar.h>
#include <sys/syscallargs.h>
#include <compat/hpux/hpux.h>
+#include <compat/hpux/hpux_sig.h>
#include <compat/hpux/hpux_util.h>
#include <compat/hpux/hpux_syscall.h>
#include <compat/hpux/hpux_syscallargs.h>
@@ -156,11 +164,12 @@ hpux_cpu_makecmds(p, epp)
struct proc *p;
struct exec_package *epp;
{
- struct hpux_exec *hpux_ep = epp->ep_hdr;
+ /* struct hpux_exec *hpux_ep = epp->ep_hdr; */
/* set up command for exec header */
NEW_VMCMD(&epp->ep_vmcmds, hpux_cpu_vmcmd,
sizeof(struct hpux_exec), (long)epp->ep_hdr, NULLVP, 0, 0);
+ return (0);
}
/*
@@ -189,7 +198,7 @@ hpux_cpu_vmcmd(p, ev)
p->p_md.md_flags &= ~MDP_CCBDATA;
if (execp->ha_trsize & HPUXM_STKWT)
- p->p_md.md_flags & ~MDP_CCBSTACK;
+ p->p_md.md_flags &= ~MDP_CCBSTACK;
}
return (0);
@@ -313,7 +322,7 @@ hpux_sys_getcontext(p, v, retval)
{
struct hpux_sys_getcontext_args *uap = v;
int l, i, error = 0;
- register int len;
+ int len;
for (i = 0; context_table[i].str != NULL; i++)
if (context_table[i].val == fputype)
@@ -345,10 +354,10 @@ hpux_to_bsd_uoff(off, isps, p)
int *off, *isps;
struct proc *p;
{
- register int *ar0 = p->p_md.md_regs;
+ int *ar0 = p->p_md.md_regs;
struct hpux_fp *hp;
struct bsdfp *bp;
- register u_int raddr;
+ u_int raddr;
*isps = 0;
@@ -461,11 +470,11 @@ hpux_sendsig(catcher, sig, mask, code, type, val)
int type;
union sigval val;
{
- register struct proc *p = curproc;
- register struct hpuxsigframe *kfp, *fp;
- register struct frame *frame;
- register struct sigacts *psp = p->p_sigacts;
- register short ft;
+ struct proc *p = curproc;
+ struct hpuxsigframe *kfp, *fp;
+ struct frame *frame;
+ struct sigacts *psp = p->p_sigacts;
+ short ft;
int oonstack, fsize;
extern char sigcode[], esigcode[];
@@ -493,8 +502,8 @@ hpux_sendsig(catcher, sig, mask, code, type, val)
#ifdef DEBUG
if ((hpuxsigdebug & SDB_KSTACK) && p->p_pid == hpuxsigpid)
- printf("hpux_sendsig(%d): sig %d ssp %x usp %x scp %x ft %d\n",
- p->p_pid, sig, &oonstack, fp, &fp->sf_sc, ft);
+ printf("hpux_sendsig(%d): sig %d ssp %p usp %p scp %p ft %d\n",
+ p->p_pid, sig, &oonstack, fp, &fp->hsf_sc, ft);
#endif
if (useracc((caddr_t)fp, fsize, B_WRITE) == 0) {
@@ -569,10 +578,11 @@ hpux_sendsig(catcher, sig, mask, code, type, val)
}
#ifdef DEBUG
- if ((hpuxsigdebug & SDB_FPSTATE) && *(char *)&kfp->sf_state.ss_fpstate)
- printf("hpux_sendsig(%d): copy out FP state (%x) to %x\n",
- p->p_pid, *(u_int *)&kfp->sf_state.ss_fpstate,
- &kfp->sf_state.ss_fpstate);
+ if ((hpuxsigdebug & SDB_FPSTATE) &&
+ *(char *)&kfp->hsf_sigstate.hss_fpstate)
+ printf("hpux_sendsig(%d): copy out FP state (%x) to %p\n",
+ p->p_pid, *(u_int *)&kfp->hsf_sigstate.hss_fpstate,
+ &kfp->hsf_sigstate.hss_fpstate);
#endif
/*
@@ -597,9 +607,9 @@ hpux_sendsig(catcher, sig, mask, code, type, val)
#ifdef DEBUG
if (hpuxsigdebug & SDB_FOLLOW) {
printf(
- "hpux_sendsig(%d): sig %d scp %x fp %x sc_sp %x sc_ap %x\n",
- p->p_pid, sig, kfp->sf_scp, fp,
- kfp->sf_sc.sc_sp, kfp->sf_sc.sc_ap);
+ "hpux_sendsig(%d): sig %d scp %p fp %p sc_sp %x sc_ap %x\n",
+ p->p_pid, sig, kfp->hsf_scp, fp,
+ kfp->hsf_sc.hsc_sp, kfp->hsf_sc._hsc_ap);
}
#endif
@@ -635,9 +645,9 @@ hpux_sys_sigreturn(p, v, retval)
struct hpux_sys_sigreturn_args /* {
syscallarg(struct hpuxsigcontext *) sigcntxp;
} */ *uap = v;
- register struct hpuxsigcontext *scp;
- register struct frame *frame;
- register int rf;
+ struct hpuxsigcontext *scp;
+ struct frame *frame;
+ int rf;
struct hpuxsigcontext tsigc;
struct hpuxsigstate tstate;
int flags;
@@ -645,7 +655,7 @@ hpux_sys_sigreturn(p, v, retval)
scp = SCARG(uap, sigcntxp);
#ifdef DEBUG
if (hpuxsigdebug & SDB_FOLLOW)
- printf("sigreturn: pid %d, scp %x\n", p->p_pid, scp);
+ printf("sigreturn: pid %d, scp %p\n", p->p_pid, scp);
#endif
if ((int)scp & 1)
return (EINVAL);
@@ -702,9 +712,9 @@ hpux_sys_sigreturn(p, v, retval)
return (EJUSTRETURN);
#ifdef DEBUG
if ((hpuxsigdebug & SDB_KSTACK) && p->p_pid == hpuxsigpid)
- printf("sigreturn(%d): ssp %x usp %x scp %x ft %d\n",
- p->p_pid, &flags, scp->sc_sp, SCARG(uap, sigcntxp),
- (flags & HSS_RTEFRAME) ? tstate.ss_frame.f_format : -1);
+ printf("sigreturn(%d): ssp %p usp %x scp %p ft %d\n",
+ p->p_pid, &flags, scp->hsc_sp, SCARG(uap, sigcntxp),
+ (flags & HSS_RTEFRAME) ? tstate.hss_frame.f_format : -1);
#endif
/*
* Restore most of the users registers except for A6 and SP
@@ -720,7 +730,7 @@ hpux_sys_sigreturn(p, v, retval)
* the sigcontext structure.
*/
if (flags & HSS_RTEFRAME) {
- register int sz;
+ int sz;
/* grab frame type and validate */
sz = tstate.hss_frame.f_format;
@@ -734,7 +744,7 @@ hpux_sys_sigreturn(p, v, retval)
#ifdef DEBUG
if (hpuxsigdebug & SDB_FOLLOW)
printf("sigreturn(%d): copy in %d of frame type %d\n",
- p->p_pid, sz, tstate.ss_frame.f_format);
+ p->p_pid, sz, tstate.hss_frame.f_format);
#endif
}
@@ -745,10 +755,10 @@ hpux_sys_sigreturn(p, v, retval)
m68881_restore(&tstate.hss_fpstate);
#ifdef DEBUG
- if ((hpuxsigdebug & SDB_FPSTATE) && *(char *)&tstate.ss_fpstate)
- printf("sigreturn(%d): copied in FP state (%x) at %x\n",
- p->p_pid, *(u_int *)&tstate.ss_fpstate,
- &tstate.ss_fpstate);
+ if ((hpuxsigdebug & SDB_FPSTATE) && *(char *)&tstate.hss_fpstate)
+ printf("sigreturn(%d): copied in FP state (%x) at %p\n",
+ p->p_pid, *(u_int *)&tstate.hss_fpstate,
+ &tstate.hss_fpstate);
if ((hpuxsigdebug & SDB_FOLLOW) ||
((hpuxsigdebug & SDB_KSTACK) && p->p_pid == hpuxsigpid))
@@ -763,7 +773,7 @@ hpux_sys_sigreturn(p, v, retval)
*/
void
hpux_setregs(p, pack, stack, retval)
- register struct proc *p;
+ struct proc *p;
struct exec_package *pack;
u_long stack;
register_t *retval;
diff --git a/sys/arch/hp300/hp300/isr.c b/sys/arch/hp300/hp300/intr.c
index 62a42ed8ee9..3785d3cb314 100644
--- a/sys/arch/hp300/hp300/isr.c
+++ b/sys/arch/hp300/hp300/intr.c
@@ -1,8 +1,8 @@
-/* $OpenBSD: isr.c,v 1.2 1997/01/12 15:13:17 downsj Exp $ */
-/* $NetBSD: isr.c,v 1.5 1996/12/09 17:38:25 thorpej Exp $ */
+/* $OpenBSD: intr.c,v 1.1 1997/04/16 11:56:24 downsj Exp $ */
+/* $NetBSD: intr.c,v 1.1 1997/04/14 02:28:44 thorpej Exp $ */
/*-
- * Copyright (c) 1996 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -41,15 +41,17 @@
* Link and dispatch interrupts.
*/
+#define _HP300_INTR_H_PRIVATE
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/malloc.h>
#include <sys/vmmeter.h>
+
#include <net/netisr.h>
#include <machine/cpu.h>
-
-#include <hp300/hp300/isr.h>
+#include <machine/intr.h>
typedef LIST_HEAD(, isr) isr_list_t;
isr_list_t isr_list[NISR];
@@ -58,17 +60,16 @@ u_short hp300_bioipl, hp300_netipl, hp300_ttyipl, hp300_impipl;
extern int intrcnt[]; /* from locore.s */
-void isrcomputeipl __P((void));
+void intr_computeipl __P((void));
void
-isrinit()
+intr_init()
{
int i;
/* Initialize the ISR lists. */
- for (i = 0; i < NISR; ++i) {
+ for (i = 0; i < NISR; ++i)
LIST_INIT(&isr_list[i]);
- }
/* Default interrupt priorities. */
hp300_bioipl = hp300_netipl = hp300_ttyipl = hp300_impipl =
@@ -80,7 +81,7 @@ isrinit()
* calls. This doesn't have to be fast.
*/
void
-isrcomputeipl()
+intr_computeipl()
{
struct isr *isr;
int ipl;
@@ -97,25 +98,25 @@ isrcomputeipl()
* if necessary.
*/
switch (isr->isr_priority) {
- case ISRPRI_BIO:
+ case IPL_BIO:
if (ipl > PSLTOIPL(hp300_bioipl))
hp300_bioipl = IPLTOPSL(ipl);
break;
- case ISRPRI_NET:
+ case IPL_NET:
if (ipl > PSLTOIPL(hp300_netipl))
hp300_netipl = IPLTOPSL(ipl);
break;
- case ISRPRI_TTY:
- case ISRPRI_TTYNOBUF:
+ case IPL_TTY:
+ case IPL_TTYNOBUF:
if (ipl > PSLTOIPL(hp300_ttyipl))
hp300_ttyipl = IPLTOPSL(ipl);
break;
default:
printf("priority = %d\n", isr->isr_priority);
- panic("isrcomputeipl: bad priority");
+ panic("intr_computeipl: bad priority");
}
}
}
@@ -135,7 +136,7 @@ isrcomputeipl()
}
void
-isrprintlevels()
+intr_printlevels()
{
#ifdef DEBUG
@@ -153,7 +154,7 @@ isrprintlevels()
* Called by driver attach functions.
*/
void *
-isrlink(func, arg, ipl, priority)
+intr_establish(func, arg, ipl, priority)
int (*func) __P((void *));
void *arg;
int ipl;
@@ -163,11 +164,11 @@ isrlink(func, arg, ipl, priority)
isr_list_t *list;
if ((ipl < 0) || (ipl >= NISR))
- panic("isrlink: bad ipl %d", ipl);
+ panic("intr_establish: bad ipl %d", ipl);
newisr = (struct isr *)malloc(sizeof(struct isr), M_DEVBUF, M_NOWAIT);
if (newisr == NULL)
- panic("isrlink: can't allocate space for isr");
+ panic("intr_establish: can't allocate space for isr");
/* Fill in the new entry. */
newisr->isr_func = func;
@@ -225,7 +226,7 @@ isrlink(func, arg, ipl, priority)
compute:
/* Compute new interrupt levels. */
- isrcomputeipl();
+ intr_computeipl();
return (newisr);
}
@@ -233,14 +234,14 @@ isrlink(func, arg, ipl, priority)
* Disestablish an interrupt handler.
*/
void
-isrunlink(arg)
+intr_disestablish(arg)
void *arg;
{
struct isr *isr = arg;
LIST_REMOVE(isr, isr_link);
free(isr, M_DEVBUF);
- isrcomputeipl();
+ intr_computeipl();
}
/*
@@ -248,7 +249,7 @@ isrunlink(arg)
* assembly language interrupt routine.
*/
void
-isrdispatch(evec)
+intr_dispatch(evec)
int evec; /* format | vector offset */
{
struct isr *isr;
@@ -258,7 +259,7 @@ isrdispatch(evec)
vec = (evec & 0xfff) >> 2;
if ((vec < ISRLOC) || (vec >= (ISRLOC + NISR)))
- panic("isrdispatch: bad vec 0x%x\n");
+ panic("isrdispatch: bad vec 0x%x\n", vec);
ipl = vec - ISRLOC;
intrcnt[ipl]++;
@@ -266,12 +267,13 @@ isrdispatch(evec)
list = &isr_list[ipl];
if (list->lh_first == NULL) {
- printf("intrhand: ipl %d unexpected\n", ipl);
+ printf("intr_dispatch: ipl %d unexpected\n", ipl);
if (++unexpected > 10)
- panic("isrdispatch: too many unexpected interrupts");
+ panic("intr_dispatch: too many unexpected interrupts");
return;
}
+ handled = 0;
/* Give all the handlers a chance. */
for (isr = list->lh_first ; isr != NULL; isr = isr->isr_link.le_next)
handled |= (*isr->isr_func)(isr->isr_arg);
@@ -279,14 +281,23 @@ isrdispatch(evec)
if (handled)
straycount = 0;
else if (++straycount > 50)
- panic("isrdispatch: too many stray interrupts");
+ panic("intr_dispatch: too many stray interrupts");
else
- printf("isrdispatch: stray level %d interrupt\n", ipl);
+ printf("intr_dispatch: stray level %d interrupt\n", ipl);
}
/*
* XXX Why on earth isn't this in a common file?!
*/
+void netintr __P((void));
+void arpintr __P((void));
+void atintr __P((void));
+void ipintr __P((void));
+void nsintr __P((void));
+void clnintr __P((void));
+void ccittintr __P((void));
+void pppintr __P((void));
+
void
netintr()
{
@@ -300,6 +311,12 @@ netintr()
ipintr();
}
#endif
+#ifdef NETATALK
+ if (netisr & (1 << NETISR_ATALK)) {
+ netisr &= ~(1 << NETISR_ATALK);
+ atintr();
+ }
+#endif
#ifdef NS
if (netisr & (1 << NETISR_NS)) {
netisr &= ~(1 << NETISR_NS);
diff --git a/sys/arch/hp300/hp300/kgdb_glue.c b/sys/arch/hp300/hp300/kgdb_glue.c
index 2b22e83025e..5b849e05fb4 100644
--- a/sys/arch/hp300/hp300/kgdb_glue.c
+++ b/sys/arch/hp300/hp300/kgdb_glue.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: kgdb_glue.c,v 1.2 1997/01/12 15:13:18 downsj Exp $ */
-/* $NetBSD: kgdb_glue.c,v 1.2 1994/10/26 07:25:39 cgd Exp $ */
+/* $OpenBSD: kgdb_glue.c,v 1.3 1997/04/16 11:56:26 downsj Exp $ */
+/* $NetBSD: kgdb_glue.c,v 1.3 1997/04/01 03:12:19 scottr Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -57,7 +57,7 @@
#include <machine/reg.h>
#ifndef lint
-static char rcsid[] = "$NetBSD: kgdb_glue.c,v 1.2 1994/10/26 07:25:39 cgd Exp $";
+static char rcsid[] = "$NetBSD: kgdb_glue.c,v 1.3 1997/04/01 03:12:19 scottr Exp $";
#endif
#define KGDB_STACKSIZE 0x800
@@ -70,8 +70,8 @@ u_long kgdb_stack[KGDB_STACKWORDS];
static inline void
copywords(src, dst, nbytes)
- register u_long *src, *dst;
- register u_int nbytes;
+ u_long *src, *dst;
+ u_int nbytes;
{
u_long *limit = src + (nbytes / sizeof(u_long));
diff --git a/sys/arch/hp300/hp300/kgdb_stub.c b/sys/arch/hp300/hp300/kgdb_stub.c
index 00dfa2bfa82..891ecc407b2 100644
--- a/sys/arch/hp300/hp300/kgdb_stub.c
+++ b/sys/arch/hp300/hp300/kgdb_stub.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: kgdb_stub.c,v 1.2 1997/01/12 15:13:20 downsj Exp $ */
-/* $NetBSD: kgdb_stub.c,v 1.6 1996/10/13 03:14:30 christos Exp $ */
+/* $OpenBSD: kgdb_stub.c,v 1.3 1997/04/16 11:56:26 downsj Exp $ */
+/* $NetBSD: kgdb_stub.c,v 1.7 1997/04/01 03:12:20 scottr Exp $ */
/*
* Copyright (c) 1990, 1993
@@ -50,7 +50,7 @@
*/
#ifdef KGDB
#ifndef lint
-static char rcsid[] = "$NetBSD: kgdb_stub.c,v 1.6 1996/10/13 03:14:30 christos Exp $";
+static char rcsid[] = "$NetBSD: kgdb_stub.c,v 1.7 1997/04/01 03:12:20 scottr Exp $";
#endif
#include <sys/param.h>
@@ -108,12 +108,12 @@ static int (*kgdb_putc)();
*/
static void
kgdb_send(type, bp, len)
- register u_char type;
- register u_char *bp;
- register int len;
+ u_char type;
+ u_char *bp;
+ int len;
{
- register u_char csum;
- register u_char *ep = bp + len;
+ u_char csum;
+ u_char *ep = bp + len;
PUTC(FRAME_START);
PUTESC(type);
@@ -134,9 +134,9 @@ kgdb_recv(bp, lenp)
u_char *bp;
int *lenp;
{
- register u_char c, csum;
- register int escape, len;
- register int type;
+ u_char c, csum;
+ int escape, len;
+ int type;
restart:
csum = len = escape = 0;
@@ -286,10 +286,10 @@ kgdb_panic()
static inline void
kgdb_copy(src, dst, nbytes)
- register u_char *src, *dst;
- register u_int nbytes;
+ u_char *src, *dst;
+ u_int nbytes;
{
- register u_char *ep = src + nbytes;
+ u_char *ep = src + nbytes;
while (src < ep)
*dst++ = *src++;
@@ -332,11 +332,11 @@ kgdb_trap(type, frame)
int type;
struct frame *frame;
{
- register u_long len;
+ u_long len;
u_char *addr;
- register u_char *cp;
- register u_char out, in;
- register int outlen;
+ u_char *cp;
+ u_char out, in;
+ int outlen;
int inlen;
u_long gdb_regs[NUM_REGS];
@@ -460,7 +460,7 @@ kgdb_trap(type, frame)
case KGDB_REG_W | KGDB_DELTA:
cp = inbuffer;
for (len = 0; len < inlen; len += 5) {
- register int j = cp[len];
+ int j = cp[len];
kgdb_copy(&cp[len + 1],
(u_char *)&gdb_regs[j], 4);
diff --git a/sys/arch/hp300/hp300/locore.s b/sys/arch/hp300/hp300/locore.s
index f491e6f8316..d3a0736a552 100644
--- a/sys/arch/hp300/hp300/locore.s
+++ b/sys/arch/hp300/hp300/locore.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.s,v 1.13 1997/03/26 08:32:41 downsj Exp $ */
+/* $OpenBSD: locore.s,v 1.14 1997/04/16 11:56:27 downsj Exp $ */
/* $NetBSD: locore.s,v 1.67 1997/03/16 10:49:43 thorpej Exp $ */
/*
@@ -411,7 +411,7 @@ Lenab2:
orl #MMU_CEN,a0@(MMUCMD) | turn on external cache
Lnocache0:
/* Final setup for call to main(). */
- jbsr _isrinit | initialize interrupt handlers
+ jbsr _intr_init | initialize interrupt handlers
jbsr _hp300_calibrate_delay | calibrate delay() loop
/*
@@ -945,7 +945,7 @@ Lbrkpt3:
#define INTERRUPT_RESTOREREG moveml sp@+,#0x0303
/* Externs. */
- .globl _hilint, _isrdispatch, _nmihand
+ .globl _hilint, _intr_dispatch, _nmihand
.globl _hardclock, _statintr
_spurintr: /* Level 0 */
@@ -965,7 +965,7 @@ _intrhand: /* Levels 2 through 5 */
INTERRUPT_SAVEREG
movw sp@(22),sp@- | push exception vector info
clrw sp@-
- jbsr _isrdispatch | call dispatch routine
+ jbsr _intr_dispatch | call dispatch routine
addql #4,sp
INTERRUPT_RESTOREREG
jra rei | all done
diff --git a/sys/arch/hp300/hp300/machdep.c b/sys/arch/hp300/hp300/machdep.c
index 51dc747bbe5..86258f2d5cf 100644
--- a/sys/arch/hp300/hp300/machdep.c
+++ b/sys/arch/hp300/hp300/machdep.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: machdep.c,v 1.21 1997/03/26 08:32:43 downsj Exp $ */
-/* $NetBSD: machdep.c,v 1.83 1997/03/16 09:12:13 thorpej Exp $ */
+/* $OpenBSD: machdep.c,v 1.22 1997/04/16 11:56:28 downsj Exp $ */
+/* $NetBSD: machdep.c,v 1.89 1997/04/09 20:05:20 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -45,24 +45,27 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/signalvar.h>
-#include <sys/kernel.h>
-#include <sys/map.h>
-#include <sys/proc.h>
#include <sys/buf.h>
-#include <sys/reboot.h>
+#include <sys/callout.h>
+#include <sys/clist.h>
#include <sys/conf.h>
+#include <sys/exec.h>
#include <sys/file.h>
-#include <sys/clist.h>
-#include <sys/callout.h>
+#include <sys/ioctl.h>
+#include <sys/kernel.h>
#include <sys/malloc.h>
+#include <sys/map.h>
#include <sys/mbuf.h>
+#include <sys/mount.h>
#include <sys/msgbuf.h>
-#include <sys/ioctl.h>
+#include <sys/proc.h>
+#include <sys/reboot.h>
+#include <sys/signalvar.h>
#include <sys/tty.h>
-#include <sys/mount.h>
#include <sys/user.h>
#include <sys/exec.h>
+#include <sys/core.h>
+#include <sys/kcore.h>
#include <sys/vnode.h>
#include <sys/sysctl.h>
#include <sys/syscallargs.h>
@@ -76,18 +79,33 @@
#include <sys/shm.h>
#endif
+#include <machine/db_machdep.h>
+#include <ddb/db_sym.h>
+#include <ddb/db_extern.h>
+
#include <machine/autoconf.h>
#include <machine/cpu.h>
#include <machine/reg.h>
#include <machine/psl.h>
#include <machine/pte.h>
+#ifdef notyet
+#include <machine/kcore.h> /* XXX should be pulled in by sys/kcore.h */
+#endif
+
#include <dev/cons.h>
#define MAXMEM 64*1024*CLSIZE /* XXX - from cmap.h */
#include <vm/vm_kern.h>
#include <vm/vm_param.h>
+#include <arch/hp300/dev/hilreg.h>
+#include <arch/hp300/dev/hilioctl.h>
+#include <arch/hp300/dev/hilvar.h>
+#ifdef USELEDS
+#include <arch/hp300/hp300/led.h>
+#endif /* USELEDS */
+
/* the following is used externally (sysctl_hw) */
char machine[] = "hp300"; /* cpu "architecture" */
@@ -207,8 +225,8 @@ void
cpu_startup()
{
extern char *etext;
- register unsigned i;
- register caddr_t v;
+ unsigned i;
+ caddr_t v;
int base, residual, sz;
vm_offset_t minaddr, maxaddr;
vm_size_t size;
@@ -306,7 +324,7 @@ cpu_startup()
#ifdef DEBUG
pmapdebug = opmapdebug;
#endif
- printf("avail mem = %d\n", ptoa(cnt.v_free_count));
+ printf("avail mem = %ld\n", ptoa(cnt.v_free_count));
printf("using %d buffers containing %d bytes of memory\n",
nbuf, bufpages * CLBYTES);
@@ -365,7 +383,7 @@ cpu_startup()
*/
caddr_t
allocsys(v)
- register caddr_t v;
+ caddr_t v;
{
#define valloc(name, type, num) \
@@ -426,7 +444,7 @@ allocsys(v)
*/
void
setregs(p, pack, stack, retval)
- register struct proc *p;
+ struct proc *p;
struct exec_package *pack;
u_long stack;
register_t *retval;
@@ -555,10 +573,11 @@ identifycpu()
#ifndef HP330
case HP_330:
#endif
-#if !defined(HP340) && !defined(HP360) && !defined(HP370)
+#if !defined(HP340) && !defined(HP360) && !defined(HP370) && !defined(HP375)
case HP_340:
case HP_360:
case HP_370:
+ case HP_375:
#endif
#if !defined(HP380)
case HP_380:
@@ -604,8 +623,6 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
}
#ifdef USELEDS
-#include <hp300/hp300/led.h>
-
int inledcontrol = 0; /* 1 if we are in ledcontrol already, cheap mutex */
char *ledaddr;
@@ -633,10 +650,10 @@ ledinit()
*/
void
ledcontrol(ons, offs, togs)
- register int ons, offs, togs;
+ int ons, offs, togs;
{
static char currentleds;
- register char leds;
+ char leds;
inledcontrol = 1;
leds = currentleds;
@@ -656,13 +673,16 @@ int waittime = -1;
void
boot(howto)
- register int howto;
+ int howto;
{
extern int cold;
+#if __GNUC__ /* XXX work around lame compiler problem (gcc 2.7.2) */
+ (void)&howto;
+#endif
/* take a snap shot before clobbering any registers */
if (curproc && curproc->p_addr)
- savectx(curproc->p_addr);
+ savectx(&curproc->p_addr->u_pcb);
/* If system is cold, just halt. */
if (cold) {
@@ -778,6 +798,10 @@ dumpsys()
vm_offset_t maddr; /* PA being dumped */
int error; /* error code from (*dump)() */
+ /* XXX initialized here because of gcc lossage */
+ maddr = lowram;
+ pg = 0;
+
/* Don't put dump messages in msgbuf. */
msgbufmapped = 0;
@@ -794,7 +818,7 @@ dumpsys()
dump = bdevsw[major(dumpdev)].d_dump;
blkno = dumplo;
- printf("\ndumping to dev 0x%x, offset %d\n", dumpdev, dumplo);
+ printf("\ndumping to dev 0x%x, offset %ld\n", dumpdev, dumplo);
printf("dump ");
maddr = lowram;
@@ -878,9 +902,9 @@ int *nofault;
int
badaddr(addr)
- register caddr_t addr;
+ caddr_t addr;
{
- register int i;
+ int i;
label_t faultbuf;
nofault = (int *) &faultbuf;
@@ -895,9 +919,9 @@ badaddr(addr)
int
badbaddr(addr)
- register caddr_t addr;
+ caddr_t addr;
{
- register int i;
+ int i;
label_t faultbuf;
nofault = (int *) &faultbuf;
@@ -1065,8 +1089,8 @@ parityerrorfind()
static label_t parcatch;
static int looking = 0;
volatile int pg, o, s;
- register volatile int *ip;
- register int i;
+ volatile int *ip;
+ int i;
int found;
#ifdef lint
diff --git a/sys/arch/hp300/hp300/mem.c b/sys/arch/hp300/hp300/mem.c
index 54b87225093..725c10b6768 100644
--- a/sys/arch/hp300/hp300/mem.c
+++ b/sys/arch/hp300/hp300/mem.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: mem.c,v 1.4 1997/03/26 08:32:43 downsj Exp $ */
-/* $NetBSD: mem.c,v 1.15 1997/03/15 23:30:12 thorpej Exp $ */
+/* $OpenBSD: mem.c,v 1.5 1997/04/16 11:56:29 downsj Exp $ */
+/* $NetBSD: mem.c,v 1.16 1997/04/01 03:12:25 scottr Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -46,11 +46,12 @@
*/
#include <sys/param.h>
-#include <sys/conf.h>
-#include <sys/buf.h>
#include <sys/systm.h>
-#include <sys/uio.h>
+#include <sys/buf.h>
+#include <sys/conf.h>
#include <sys/malloc.h>
+#include <sys/proc.h>
+#include <sys/uio.h>
#include <machine/cpu.h>
@@ -60,6 +61,11 @@ extern u_int lowram;
extern char *extiobase;
static caddr_t devzeropage;
+int mmopen __P((dev_t, int, int));
+int mmclose __P((dev_t, int, int));
+int mmrw __P((dev_t, struct uio *, int));
+int mmmmap __P((dev_t, int, int));
+
/*ARGSUSED*/
int
mmopen(dev, flag, mode)
@@ -87,9 +93,9 @@ mmrw(dev, uio, flags)
struct uio *uio;
int flags;
{
- register vm_offset_t o, v;
- register int c;
- register struct iovec *iov;
+ vm_offset_t o, v;
+ int c;
+ struct iovec *iov;
int error = 0;
static int physlock;
diff --git a/sys/arch/hp300/hp300/pmap.c b/sys/arch/hp300/hp300/pmap.c
index 9bb24aba9ea..02f4fd57397 100644
--- a/sys/arch/hp300/hp300/pmap.c
+++ b/sys/arch/hp300/hp300/pmap.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: pmap.c,v 1.6 1997/03/26 08:32:44 downsj Exp $ */
-/* $NetBSD: pmap.c,v 1.30 1997/03/18 14:13:55 mycroft Exp $ */
+/* $OpenBSD: pmap.c,v 1.7 1997/04/16 11:56:30 downsj Exp $ */
+/* $NetBSD: pmap.c,v 1.32 1997/04/02 22:41:39 scottr Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -289,13 +289,23 @@ int pmap_aliasmask; /* seperation at which VA aliasing ok */
int protostfree; /* prototype (default) free ST map */
#endif
+struct pv_entry *pmap_alloc_pv __P((void));
+void pmap_free_pv __P((struct pv_entry *));
+void pmap_collect_pv __P((void));
+void pmap_activate __P((pmap_t, struct pcb *));
+void pmap_deactivate __P((pmap_t, struct pcb *));
+#ifdef COMPAT_HPUX
+int pmap_mapmulti __P((pmap_t, vm_offset_t));
+#endif /* COMPAT_HPUX */
+
/*
* Internal routines
*/
-void pmap_remove_mapping __P((pmap_t, vm_offset_t, pt_entry_t *, int));
+void pmap_remove_mapping __P((pmap_t, vm_offset_t, pt_entry_t *, int));
boolean_t pmap_testbit __P((vm_offset_t, int));
-void pmap_changebit __P((vm_offset_t, int, boolean_t));
-void pmap_enter_ptpage __P((pmap_t, vm_offset_t));
+void pmap_changebit __P((vm_offset_t, int, boolean_t));
+void pmap_enter_ptpage __P((pmap_t, vm_offset_t));
+
#ifdef DEBUG
void pmap_pvdump __P((vm_offset_t));
void pmap_check_wiring __P((char *, vm_offset_t));
@@ -351,7 +361,7 @@ pmap_init(phys_start, phys_end)
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_init(%x, %x)\n", phys_start, phys_end);
+ printf("pmap_init(%lx, %lx)\n", phys_start, phys_end);
#endif
/*
* Now that kernel map has been allocated, we can mark as
@@ -377,9 +387,9 @@ bogons:
#ifdef DEBUG
if (pmapdebug & PDB_INIT) {
- printf("pmap_init: Sysseg %x, Sysmap %x, Sysptmap %x\n",
+ printf("pmap_init: Sysseg %p, Sysmap %p, Sysptmap %p\n",
Sysseg, Sysmap, Sysptmap);
- printf(" pstart %x, pend %x, vstart %x, vend %x\n",
+ printf(" pstart %lx, pend %lx, vstart %lx, vend %lx\n",
avail_start, avail_end, virtual_avail, virtual_end);
}
#endif
@@ -400,7 +410,7 @@ bogons:
pmap_attributes = (char *) addr;
#ifdef DEBUG
if (pmapdebug & PDB_INIT)
- printf("pmap_init: %x bytes: npages %x s0 %x(%x) tbl %x atr %x\n",
+ printf("pmap_init: %lx bytes: npages %x s0 %p(%p) tbl %p atr %p\n",
s, npages, Segtabzero, Segtabzeropa,
pv_table, pmap_attributes);
#endif
@@ -443,7 +453,7 @@ bogons:
#endif
#ifdef DEBUG
if (pmapdebug & PDB_INIT)
- printf("pmap_init: KPT: %d pages from %x to %x\n",
+ printf("pmap_init: KPT: %ld pages from %lx to %lx\n",
atop(s), addr, addr + s);
#endif
@@ -482,7 +492,7 @@ bogons:
panic("pmap_init: cannot map range to pt_map");
#ifdef DEBUG
if (pmapdebug & PDB_INIT)
- printf("pmap_init: pt_map [%x - %x)\n", addr, addr2);
+ printf("pmap_init: pt_map [%lx - %lx)\n", addr, addr2);
#endif
#if defined(M68040)
@@ -539,8 +549,7 @@ void
pmap_free_pv(pv)
struct pv_entry *pv;
{
- register struct pv_page *pvp;
- register int i;
+ struct pv_page *pvp;
pvp = (struct pv_page *) trunc_page(pv);
switch (++pvp->pvp_pgi.pgi_nfree) {
@@ -631,7 +640,7 @@ pmap_map(va, spa, epa, prot)
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_map(%x, %x, %x, %x)\n", va, spa, epa, prot);
+ printf("pmap_map(%lx, %lx, %lx, %x)\n", va, spa, epa, prot);
#endif
while (spa < epa) {
@@ -658,11 +667,11 @@ pmap_t
pmap_create(size)
vm_size_t size;
{
- register pmap_t pmap;
+ pmap_t pmap;
#ifdef DEBUG
if (pmapdebug & (PDB_FOLLOW|PDB_CREATE))
- printf("pmap_create(%x)\n", size);
+ printf("pmap_create(%lx)\n", size);
#endif
/*
@@ -688,12 +697,12 @@ pmap_create(size)
*/
void
pmap_pinit(pmap)
- register struct pmap *pmap;
+ struct pmap *pmap;
{
#ifdef DEBUG
if (pmapdebug & (PDB_FOLLOW|PDB_CREATE))
- printf("pmap_pinit(%x)\n", pmap);
+ printf("pmap_pinit(%p)\n", pmap);
#endif
/*
@@ -720,7 +729,7 @@ pmap_pinit(pmap)
*/
void
pmap_destroy(pmap)
- register pmap_t pmap;
+ pmap_t pmap;
{
int count;
@@ -729,7 +738,7 @@ pmap_destroy(pmap)
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_destroy(%x)\n", pmap);
+ printf("pmap_destroy(%p)\n", pmap);
#endif
simple_lock(&pmap->pm_lock);
@@ -748,12 +757,12 @@ pmap_destroy(pmap)
*/
void
pmap_release(pmap)
- register struct pmap *pmap;
+ struct pmap *pmap;
{
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_release(%x)\n", pmap);
+ printf("pmap_release(%p)\n", pmap);
#endif
#ifdef notdef /* DIAGNOSTIC */
@@ -784,7 +793,7 @@ pmap_reference(pmap)
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_reference(%x)\n", pmap);
+ printf("pmap_reference(%p)\n", pmap);
#endif
simple_lock(&pmap->pm_lock);
@@ -794,7 +803,7 @@ pmap_reference(pmap)
void
pmap_activate(pmap, pcb)
- register pmap_t pmap;
+ pmap_t pmap;
struct pcb *pcb;
{
@@ -803,7 +812,7 @@ pmap_activate(pmap, pcb)
#ifdef DEBUG
if (pmapdebug & (PDB_FOLLOW|PDB_SEGTAB))
- printf("pmap_activate(%x, %x)\n", pmap, pcb);
+ printf("pmap_activate(%p, %p)\n", pmap, pcb);
#endif
PMAP_ACTIVATE(pmap, pcb, pmap == curproc->p_vmspace->vm_map.pmap);
@@ -811,7 +820,7 @@ pmap_activate(pmap, pcb)
void
pmap_deactivate(pmap, pcb)
- register pmap_t pmap;
+ pmap_t pmap;
struct pcb *pcb;
{
}
@@ -824,17 +833,17 @@ pmap_deactivate(pmap, pcb)
*/
void
pmap_remove(pmap, sva, eva)
- register pmap_t pmap;
- register vm_offset_t sva, eva;
+ pmap_t pmap;
+ vm_offset_t sva, eva;
{
- register vm_offset_t nssva;
- register pt_entry_t *pte;
+ vm_offset_t nssva;
+ pt_entry_t *pte;
boolean_t firstpage, needcflush;
int flags;
#ifdef DEBUG
if (pmapdebug & (PDB_FOLLOW|PDB_REMOVE|PDB_PROTECT))
- printf("pmap_remove(%x, %x, %x)\n", pmap, sva, eva);
+ printf("pmap_remove(%p, %lx, %lx)\n", pmap, sva, eva);
#endif
if (pmap == NULL)
@@ -946,13 +955,13 @@ pmap_page_protect(pa, prot)
vm_offset_t pa;
vm_prot_t prot;
{
- register struct pv_entry *pv;
+ struct pv_entry *pv;
int s;
#ifdef DEBUG
if ((pmapdebug & (PDB_FOLLOW|PDB_PROTECT)) ||
- prot == VM_PROT_NONE && (pmapdebug & PDB_REMOVE))
- printf("pmap_page_protect(%x, %x)\n", pa, prot);
+ (prot == VM_PROT_NONE && (pmapdebug & PDB_REMOVE)))
+ printf("pmap_page_protect(%lx, %x)\n", pa, prot);
#endif
if (pa < vm_first_phys || pa >= vm_last_phys)
return;
@@ -973,7 +982,7 @@ pmap_page_protect(pa, prot)
pv = pa_to_pvh(pa);
s = splimp();
while (pv->pv_pmap != NULL) {
- register pt_entry_t *pte;
+ pt_entry_t *pte;
pte = pmap_pte(pv->pv_pmap, pv->pv_va);
#ifdef DEBUG
@@ -988,7 +997,7 @@ pmap_page_protect(pa, prot)
pv = pv->pv_next;
#ifdef DEBUG
if (pmapdebug & PDB_PARANOIA)
- printf("%s wired mapping for %x not removed\n",
+ printf("%s wired mapping for %lx not removed\n",
"pmap_page_protect:", pa);
#endif
}
@@ -1002,18 +1011,18 @@ pmap_page_protect(pa, prot)
*/
void
pmap_protect(pmap, sva, eva, prot)
- register pmap_t pmap;
- register vm_offset_t sva, eva;
+ pmap_t pmap;
+ vm_offset_t sva, eva;
vm_prot_t prot;
{
- register vm_offset_t nssva;
- register pt_entry_t *pte;
+ vm_offset_t nssva;
+ pt_entry_t *pte;
boolean_t firstpage, needtflush;
int isro;
#ifdef DEBUG
if (pmapdebug & (PDB_FOLLOW|PDB_PROTECT))
- printf("pmap_protect(%x, %x, %x, %x)\n", pmap, sva, eva, prot);
+ printf("pmap_protect(%p, %lx, %lx, %x)\n", pmap, sva, eva, prot);
#endif
if (pmap == NULL)
@@ -1121,21 +1130,21 @@ pmap_protect(pmap, sva, eva, prot)
*/
void
pmap_enter(pmap, va, pa, prot, wired)
- register pmap_t pmap;
+ pmap_t pmap;
vm_offset_t va;
- register vm_offset_t pa;
+ vm_offset_t pa;
vm_prot_t prot;
boolean_t wired;
{
- register pt_entry_t *pte;
- register int npte;
+ pt_entry_t *pte;
+ int npte;
vm_offset_t opa;
boolean_t cacheable = TRUE;
boolean_t checkpv = TRUE;
#ifdef DEBUG
if (pmapdebug & (PDB_FOLLOW|PDB_ENTER))
- printf("pmap_enter(%x, %x, %x, %x, %x)\n",
+ printf("pmap_enter(%p, %lx, %lx, %x, %x)\n",
pmap, va, pa, prot, wired);
#endif
if (pmap == NULL)
@@ -1165,7 +1174,7 @@ pmap_enter(pmap, va, pa, prot, wired)
opa = pmap_pte_pa(pte);
#ifdef DEBUG
if (pmapdebug & PDB_ENTER)
- printf("enter: pte %x, *pte %x\n", pte, *pte);
+ printf("enter: pte %p, *pte %x\n", pte, *pte);
#endif
/*
@@ -1217,7 +1226,7 @@ pmap_enter(pmap, va, pa, prot, wired)
if (opa) {
#ifdef DEBUG
if (pmapdebug & PDB_ENTER)
- printf("enter: removing old mapping %x\n", va);
+ printf("enter: removing old mapping %lx\n", va);
#endif
pmap_remove_mapping(pmap, va, pte, PRM_TFLUSH|PRM_CFLUSH);
#ifdef PMAPSTATS
@@ -1240,7 +1249,7 @@ pmap_enter(pmap, va, pa, prot, wired)
* since pmap_enter can be called at interrupt time.
*/
if (pa >= vm_first_phys && pa < vm_last_phys) {
- register struct pv_entry *pv, *npv;
+ struct pv_entry *pv, *npv;
int s;
#ifdef PMAPSTATS
@@ -1250,7 +1259,7 @@ pmap_enter(pmap, va, pa, prot, wired)
s = splimp();
#ifdef DEBUG
if (pmapdebug & PDB_ENTER)
- printf("enter: pv at %x: %x/%x/%x\n",
+ printf("enter: pv at %p: %lx/%p/%p\n",
pv, pv->pv_va, pv->pv_pmap, pv->pv_next);
#endif
/*
@@ -1316,7 +1325,7 @@ pmap_enter(pmap, va, pa, prot, wired)
if (pv->pv_flags & PV_CI) {
#ifdef DEBUG
if (pmapdebug & PDB_CACHE)
- printf("enter: pa %x already CI'ed\n",
+ printf("enter: pa %lx already CI'ed\n",
pa);
#endif
checkpv = cacheable = FALSE;
@@ -1328,7 +1337,7 @@ pmap_enter(pmap, va, pa, prot, wired)
(va & pmap_aliasmask)))) {
#ifdef DEBUG
if (pmapdebug & PDB_CACHE)
- printf("enter: pa %x CI'ing all\n",
+ printf("enter: pa %lx CI'ing all\n",
pa);
#endif
cacheable = FALSE;
@@ -1457,15 +1466,15 @@ validate:
*/
void
pmap_change_wiring(pmap, va, wired)
- register pmap_t pmap;
+ pmap_t pmap;
vm_offset_t va;
boolean_t wired;
{
- register pt_entry_t *pte;
+ pt_entry_t *pte;
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_change_wiring(%x, %x, %x)\n", pmap, va, wired);
+ printf("pmap_change_wiring(%p, %lx, %x)\n", pmap, va, wired);
#endif
if (pmap == NULL)
return;
@@ -1479,7 +1488,7 @@ pmap_change_wiring(pmap, va, wired)
*/
if (!pmap_ste_v(pmap, va)) {
if (pmapdebug & PDB_PARANOIA)
- printf("pmap_change_wiring: invalid STE for %x\n", va);
+ printf("pmap_change_wiring: invalid STE for %lx\n", va);
return;
}
/*
@@ -1488,7 +1497,7 @@ pmap_change_wiring(pmap, va, wired)
*/
if (!pmap_pte_v(pte)) {
if (pmapdebug & PDB_PARANOIA)
- printf("pmap_change_wiring: invalid PTE for %x\n", va);
+ printf("pmap_change_wiring: invalid PTE for %lx\n", va);
}
#endif
/*
@@ -1514,14 +1523,14 @@ pmap_change_wiring(pmap, va, wired)
vm_offset_t
pmap_extract(pmap, va)
- register pmap_t pmap;
+ pmap_t pmap;
vm_offset_t va;
{
- register vm_offset_t pa;
+ vm_offset_t pa;
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_extract(%x, %x) -> ", pmap, va);
+ printf("pmap_extract(%p, %lx) -> ", pmap, va);
#endif
pa = 0;
if (pmap && pmap_ste_v(pmap, va))
@@ -1530,7 +1539,7 @@ pmap_extract(pmap, va)
pa = (pa & PG_FRAME) | (va & ~PG_FRAME);
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("%x\n", pa);
+ printf("%lx\n", pa);
#endif
return(pa);
}
@@ -1551,7 +1560,7 @@ void pmap_copy(dst_pmap, src_pmap, dst_addr, len, src_addr)
{
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_copy(%x, %x, %x, %x, %x)\n",
+ printf("pmap_copy(%p, %p, %lx, %lx, %lx)\n",
dst_pmap, src_pmap, dst_addr, len, src_addr);
#endif
}
@@ -1588,29 +1597,29 @@ void
pmap_collect(pmap)
pmap_t pmap;
{
- register vm_offset_t pa;
- register struct pv_entry *pv;
- register pt_entry_t *pte;
+ vm_offset_t pa;
+ struct pv_entry *pv;
+ pt_entry_t *pte;
vm_offset_t kpa;
int s;
#ifdef DEBUG
st_entry_t *ste;
- int opmapdebug;
+ int opmapdebug = 0 /* XXX initialize to quiet gcc -Wall */;
#endif
if (pmap != pmap_kernel())
return;
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_collect(%x)\n", pmap);
+ printf("pmap_collect(%p)\n", pmap);
#endif
#ifdef PMAPSTATS
kpt_stats.collectscans++;
#endif
s = splimp();
for (pa = vm_first_phys; pa < vm_last_phys; pa += NBPG) {
- register struct kpt_page *kpt, **pkpt;
+ struct kpt_page *kpt, **pkpt;
/*
* Locate physical pages which are being used as kernel
@@ -1622,7 +1631,7 @@ pmap_collect(pmap)
do {
if (pv->pv_ptste && pv->pv_ptpmap == pmap_kernel())
break;
- } while (pv = pv->pv_next);
+ } while ((pv = pv->pv_next));
if (pv == NULL)
continue;
#ifdef DEBUG
@@ -1643,7 +1652,7 @@ ok:
#ifdef DEBUG
if (pmapdebug & (PDB_PTPAGE|PDB_COLLECT)) {
- printf("collect: freeing KPT page at %x (ste %x@%x)\n",
+ printf("collect: freeing KPT page at %lx (ste %x@%p)\n",
pv->pv_va, *pv->pv_ptste, pv->pv_ptste);
opmapdebug = pmapdebug;
pmapdebug |= PDB_PTPAGE;
@@ -1673,7 +1682,7 @@ ok:
if (kpt == (struct kpt_page *)0)
panic("pmap_collect: lost a KPT page");
if (pmapdebug & (PDB_PTPAGE|PDB_COLLECT))
- printf("collect: %x (%x) to free list\n",
+ printf("collect: %lx (%lx) to free list\n",
kpt->kpt_va, kpa);
#endif
*pkpt = kpt->kpt_next;
@@ -1688,11 +1697,11 @@ ok:
pmapdebug = opmapdebug;
if (*ste != SG_NV)
- printf("collect: kernel STE at %x still valid (%x)\n",
+ printf("collect: kernel STE at %p still valid (%x)\n",
ste, *ste);
ste = &Sysptmap[ste - pmap_ste(pmap_kernel(), 0)];
if (*ste != SG_NV)
- printf("collect: kernel PTmap at %x still valid (%x)\n",
+ printf("collect: kernel PTmap at %p still valid (%x)\n",
ste, *ste);
#endif
}
@@ -1715,12 +1724,12 @@ void
pmap_zero_page(phys)
vm_offset_t phys;
{
- register vm_offset_t kva;
+ vm_offset_t kva;
extern caddr_t CADDR1;
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_zero_page(%x)\n", phys);
+ printf("pmap_zero_page(%lx)\n", phys);
#endif
kva = (vm_offset_t) CADDR1;
pmap_enter(pmap_kernel(), kva, phys, VM_PROT_READ|VM_PROT_WRITE, TRUE);
@@ -1746,12 +1755,12 @@ void
pmap_copy_page(src, dst)
vm_offset_t src, dst;
{
- register vm_offset_t skva, dkva;
+ vm_offset_t skva, dkva;
extern caddr_t CADDR1, CADDR2;
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_copy_page(%x, %x)\n", src, dst);
+ printf("pmap_copy_page(%lx, %lx)\n", src, dst);
#endif
skva = (vm_offset_t) CADDR1;
dkva = (vm_offset_t) CADDR2;
@@ -1784,7 +1793,7 @@ pmap_pageable(pmap, sva, eva, pageable)
{
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_pageable(%x, %x, %x, %x)\n",
+ printf("pmap_pageable(%p, %lx, %lx, %x)\n",
pmap, sva, eva, pageable);
#endif
/*
@@ -1796,12 +1805,12 @@ pmap_pageable(pmap, sva, eva, pageable)
* - PT pages have only one pv_table entry
*/
if (pmap == pmap_kernel() && pageable && sva + NBPG == eva) {
- register struct pv_entry *pv;
- register vm_offset_t pa;
+ struct pv_entry *pv;
+ vm_offset_t pa;
#ifdef DEBUG
if ((pmapdebug & (PDB_FOLLOW|PDB_PTPAGE)) == PDB_PTPAGE)
- printf("pmap_pageable(%x, %x, %x, %x)\n",
+ printf("pmap_pageable(%p, %lx, %lx, %x)\n",
pmap, sva, eva, pageable);
#endif
if (!pmap_ste_v(pmap, sva))
@@ -1814,7 +1823,7 @@ pmap_pageable(pmap, sva, eva, pageable)
return;
#ifdef DEBUG
if (pv->pv_va != sva || pv->pv_next) {
- printf("pmap_pageable: bad PT page va %x next %x\n",
+ printf("pmap_pageable: bad PT page va %lx next %p\n",
pv->pv_va, pv->pv_next);
return;
}
@@ -1825,12 +1834,12 @@ pmap_pageable(pmap, sva, eva, pageable)
pmap_changebit(pa, PG_M, FALSE);
#ifdef DEBUG
if ((PHYS_TO_VM_PAGE(pa)->flags & PG_CLEAN) == 0) {
- printf("pa %x: flags=%x: not clean\n",
+ printf("pa %lx: flags=%x: not clean\n",
pa, PHYS_TO_VM_PAGE(pa)->flags);
PHYS_TO_VM_PAGE(pa)->flags |= PG_CLEAN;
}
if (pmapdebug & PDB_PTPAGE)
- printf("pmap_pageable: PT page %x(%x) unmodified\n",
+ printf("pmap_pageable: PT page %lx(%x) unmodified\n",
sva, *pmap_pte(pmap, sva));
if (pmapdebug & PDB_WIRING)
pmap_check_wiring("pageable", sva);
@@ -1848,7 +1857,7 @@ pmap_clear_modify(pa)
{
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_clear_modify(%x)\n", pa);
+ printf("pmap_clear_modify(%lx)\n", pa);
#endif
pmap_changebit(pa, PG_M, FALSE);
}
@@ -1864,7 +1873,7 @@ void pmap_clear_reference(pa)
{
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_clear_reference(%x)\n", pa);
+ printf("pmap_clear_reference(%lx)\n", pa);
#endif
pmap_changebit(pa, PG_U, FALSE);
}
@@ -1883,7 +1892,7 @@ pmap_is_referenced(pa)
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW) {
boolean_t rv = pmap_testbit(pa, PG_U);
- printf("pmap_is_referenced(%x) -> %c\n", pa, "FT"[rv]);
+ printf("pmap_is_referenced(%lx) -> %c\n", pa, "FT"[rv]);
return(rv);
}
#endif
@@ -1904,7 +1913,7 @@ pmap_is_modified(pa)
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW) {
boolean_t rv = pmap_testbit(pa, PG_M);
- printf("pmap_is_modified(%x) -> %c\n", pa, "FT"[rv]);
+ printf("pmap_is_modified(%lx) -> %c\n", pa, "FT"[rv]);
return(rv);
}
#endif
@@ -1927,6 +1936,7 @@ pmap_phys_address(ppn)
* We implement this at the segment table level, the machine independent
* VM knows nothing about it.
*/
+int
pmap_mapmulti(pmap, va)
pmap_t pmap;
vm_offset_t va;
@@ -1936,10 +1946,10 @@ pmap_mapmulti(pmap, va)
#ifdef DEBUG
if (pmapdebug & PDB_MULTIMAP) {
ste = pmap_ste(pmap, HPMMBASEADDR(va));
- printf("pmap_mapmulti(%x, %x): bste %x(%x)",
+ printf("pmap_mapmulti(%p, %lx): bste %p(%x)",
pmap, va, ste, *ste);
ste = pmap_ste(pmap, va);
- printf(" ste %x(%x)\n", ste, *ste);
+ printf(" ste %p(%x)\n", ste, *ste);
}
#endif
bste = pmap_ste(pmap, HPMMBASEADDR(va));
@@ -1966,13 +1976,13 @@ pmap_mapmulti(pmap, va)
/* static */
void
pmap_remove_mapping(pmap, va, pte, flags)
- register pmap_t pmap;
- register vm_offset_t va;
- register pt_entry_t *pte;
+ pmap_t pmap;
+ vm_offset_t va;
+ pt_entry_t *pte;
int flags;
{
- register vm_offset_t pa;
- register struct pv_entry *pv, *npv;
+ vm_offset_t pa;
+ struct pv_entry *pv, *npv;
pmap_t ptpmap;
st_entry_t *ste;
int s, bits;
@@ -1980,7 +1990,7 @@ pmap_remove_mapping(pmap, va, pte, flags)
pt_entry_t opte;
if (pmapdebug & (PDB_FOLLOW|PDB_REMOVE|PDB_PROTECT))
- printf("pmap_remove_mapping(%x, %x, %x, %x)\n",
+ printf("pmap_remove_mapping(%p, %lx, %p, %x)\n",
pmap, va, pte, flags);
#endif
@@ -2034,7 +2044,7 @@ pmap_remove_mapping(pmap, va, pte, flags)
*/
#ifdef DEBUG
if (pmapdebug & PDB_REMOVE)
- printf("remove: invalidating pte at %x\n", pte);
+ printf("remove: invalidating pte at %p\n", pte);
#endif
bits = *pte & (PG_U|PG_M);
*pte = PG_NV;
@@ -2113,7 +2123,7 @@ pmap_remove_mapping(pmap, va, pte, flags)
pv->pv_pmap && pv->pv_next == NULL && (pv->pv_flags & PV_CI)) {
#ifdef DEBUG
if (pmapdebug & PDB_CACHE)
- printf("remove: clearing CI for pa %x\n", pa);
+ printf("remove: clearing CI for pa %lx\n", pa);
#endif
pv->pv_flags &= ~PV_CI;
pmap_changebit(pa, PG_CI, FALSE);
@@ -2134,7 +2144,7 @@ pmap_remove_mapping(pmap, va, pte, flags)
#endif
#ifdef DEBUG
if (pmapdebug & (PDB_REMOVE|PDB_PTPAGE))
- printf("remove: ste was %x@%x pte was %x@%x\n",
+ printf("remove: ste was %x@%p pte was %x@%p\n",
*ste, ste, opte, pmap_pte(pmap, va));
#endif
#if defined(M68040)
@@ -2157,7 +2167,7 @@ pmap_remove_mapping(pmap, va, pte, flags)
if (ptpmap != pmap_kernel()) {
#ifdef DEBUG
if (pmapdebug & (PDB_REMOVE|PDB_SEGTAB))
- printf("remove: stab %x, refcnt %d\n",
+ printf("remove: stab %p, refcnt %d\n",
ptpmap->pm_stab, ptpmap->pm_sref - 1);
if ((pmapdebug & PDB_PARANOIA) &&
ptpmap->pm_stab != (st_entry_t *)trunc_page(ste))
@@ -2166,7 +2176,7 @@ pmap_remove_mapping(pmap, va, pte, flags)
if (--(ptpmap->pm_sref) == 0) {
#ifdef DEBUG
if (pmapdebug&(PDB_REMOVE|PDB_SEGTAB))
- printf("remove: free stab %x\n",
+ printf("remove: free stab %p\n",
ptpmap->pm_stab);
#endif
kmem_free_wakeup(st_map,
@@ -2216,11 +2226,11 @@ pmap_remove_mapping(pmap, va, pte, flags)
/* static */
boolean_t
pmap_testbit(pa, bit)
- register vm_offset_t pa;
+ vm_offset_t pa;
int bit;
{
- register struct pv_entry *pv;
- register pt_entry_t *pte;
+ struct pv_entry *pv;
+ pt_entry_t *pte;
int s;
if (pa < vm_first_phys || pa >= vm_last_phys)
@@ -2262,12 +2272,12 @@ pmap_testbit(pa, bit)
/* static */
void
pmap_changebit(pa, bit, setem)
- register vm_offset_t pa;
+ vm_offset_t pa;
int bit;
boolean_t setem;
{
- register struct pv_entry *pv;
- register pt_entry_t *pte, npte;
+ struct pv_entry *pv;
+ pt_entry_t *pte, npte;
vm_offset_t va;
int s;
boolean_t firstpage = TRUE;
@@ -2277,7 +2287,7 @@ pmap_changebit(pa, bit, setem)
#ifdef DEBUG
if (pmapdebug & PDB_BITS)
- printf("pmap_changebit(%x, %x, %s)\n",
+ printf("pmap_changebit(%lx, %x, %s)\n",
pa, bit, setem ? "set" : "clear");
#endif
if (pa < vm_first_phys || pa >= vm_last_phys)
@@ -2344,8 +2354,8 @@ pmap_changebit(pa, bit, setem)
* flushed (but only once).
*/
if (firstpage && mmutype == MMU_68040 &&
- (bit == PG_RO && setem ||
- (bit & PG_CMASK))) {
+ ((bit == PG_RO && setem) ||
+ (bit & PG_CMASK))) {
firstpage = FALSE;
DCFP(pa);
ICPP(pa);
@@ -2387,17 +2397,17 @@ pmap_changebit(pa, bit, setem)
/* static */
void
pmap_enter_ptpage(pmap, va)
- register pmap_t pmap;
- register vm_offset_t va;
+ pmap_t pmap;
+ vm_offset_t va;
{
- register vm_offset_t ptpa;
- register struct pv_entry *pv;
+ vm_offset_t ptpa;
+ struct pv_entry *pv;
st_entry_t *ste;
int s;
#ifdef DEBUG
if (pmapdebug & (PDB_FOLLOW|PDB_ENTER|PDB_PTPAGE))
- printf("pmap_enter_ptpage: pmap %x, va %x\n", pmap, va);
+ printf("pmap_enter_ptpage: pmap %p, va %lx\n", pmap, va);
#endif
#ifdef PMAPSTATS
enter_stats.ptpneeded++;
@@ -2432,7 +2442,7 @@ pmap_enter_ptpage(pmap, va)
PMAP_ACTIVATE(pmap, &curproc->p_addr->u_pcb, 1);
#ifdef DEBUG
if (pmapdebug & (PDB_ENTER|PDB_PTPAGE|PDB_SEGTAB))
- printf("enter: pmap %x stab %x(%x)\n",
+ printf("enter: pmap %p stab %p(%p)\n",
pmap, pmap->pm_stab, pmap->pm_stpa);
#endif
}
@@ -2457,7 +2467,7 @@ pmap_enter_ptpage(pmap, va)
*ste = (u_int)addr | SG_RW | SG_U | SG_V;
#ifdef DEBUG
if (pmapdebug & (PDB_ENTER|PDB_PTPAGE|PDB_SEGTAB))
- printf("enter: alloc ste2 %d(%x)\n", ix, addr);
+ printf("enter: alloc ste2 %d(%p)\n", ix, addr);
#endif
}
ste = pmap_ste2(pmap, va);
@@ -2472,7 +2482,7 @@ pmap_enter_ptpage(pmap, va)
ste = (st_entry_t *)((int)ste & ~(NBPG/SG4_LEV3SIZE-1));
#ifdef DEBUG
if (pmapdebug & (PDB_ENTER|PDB_PTPAGE|PDB_SEGTAB))
- printf("enter: ste2 %x (%x)\n",
+ printf("enter: ste2 %p (%p)\n",
pmap_ste2(pmap, va), ste);
#endif
}
@@ -2485,7 +2495,7 @@ pmap_enter_ptpage(pmap, va)
* pmap_enter).
*/
if (pmap == pmap_kernel()) {
- register struct kpt_page *kpt;
+ struct kpt_page *kpt;
s = splimp();
if ((kpt = kpt_free_list) == (struct kpt_page *)0) {
@@ -2515,7 +2525,7 @@ pmap_enter_ptpage(pmap, va)
if (pmapdebug & (PDB_ENTER|PDB_PTPAGE)) {
int ix = pmap_ste(pmap, va) - pmap_ste(pmap, 0);
- printf("enter: add &Sysptmap[%d]: %x (KPT page %x)\n",
+ printf("enter: add &Sysptmap[%d]: %x (KPT page %lx)\n",
ix, Sysptmap[ix], kpt->kpt_va);
}
#endif
@@ -2533,11 +2543,11 @@ pmap_enter_ptpage(pmap, va)
pmap->pm_sref++;
#ifdef DEBUG
if (pmapdebug & (PDB_ENTER|PDB_PTPAGE))
- printf("enter: about to fault UPT pg at %x\n", va);
+ printf("enter: about to fault UPT pg at %lx\n", va);
#endif
s = vm_fault(pt_map, va, VM_PROT_READ|VM_PROT_WRITE, FALSE);
if (s != KERN_SUCCESS) {
- printf("vm_fault(pt_map, %x, RW, 0) -> %d\n", va, s);
+ printf("vm_fault(pt_map, %lx, RW, 0) -> %d\n", va, s);
panic("pmap_enter: vm_fault failed");
}
ptpa = pmap_extract(pmap_kernel(), va);
@@ -2560,10 +2570,10 @@ pmap_enter_ptpage(pmap, va)
if (dowriteback && dokwriteback)
#endif
if (mmutype == MMU_68040) {
- pt_entry_t *pte = pmap_pte(pmap_kernel(), va);
#ifdef DEBUG
+ pt_entry_t *pte = pmap_pte(pmap_kernel(), va);
if ((pmapdebug & PDB_PARANOIA) && (*pte & PG_CCB) == 0)
- printf("%s PT no CCB: kva=%x ptpa=%x pte@%x=%x\n",
+ printf("%s PT no CCB: kva=%lx ptpa=%lx pte@%p=%x\n",
pmap == pmap_kernel() ? "Kernel" : "User",
va, ptpa, pte, *pte);
#endif
@@ -2582,7 +2592,7 @@ pmap_enter_ptpage(pmap, va)
do {
if (pv->pv_pmap == pmap_kernel() && pv->pv_va == va)
break;
- } while (pv = pv->pv_next);
+ } while ((pv = pv->pv_next));
}
#ifdef DEBUG
if (pv == NULL)
@@ -2592,7 +2602,7 @@ pmap_enter_ptpage(pmap, va)
pv->pv_ptpmap = pmap;
#ifdef DEBUG
if (pmapdebug & (PDB_ENTER|PDB_PTPAGE))
- printf("enter: new PT page at PA %x, ste at %x\n", ptpa, ste);
+ printf("enter: new PT page at PA %lx, ste at %p\n", ptpa, ste);
#endif
/*
@@ -2617,7 +2627,7 @@ pmap_enter_ptpage(pmap, va)
if (pmap != pmap_kernel()) {
#ifdef DEBUG
if (pmapdebug & (PDB_ENTER|PDB_PTPAGE|PDB_SEGTAB))
- printf("enter: stab %x refcnt %d\n",
+ printf("enter: stab %p refcnt %d\n",
pmap->pm_stab, pmap->pm_sref);
#endif
}
@@ -2640,11 +2650,11 @@ void
pmap_pvdump(pa)
vm_offset_t pa;
{
- register struct pv_entry *pv;
+ struct pv_entry *pv;
- printf("pa %x", pa);
+ printf("pa %lx", pa);
for (pv = pa_to_pvh(pa); pv; pv = pv->pv_next)
- printf(" -> pmap %x, va %x, ptste %x, ptpmap %x, flags %x",
+ printf(" -> pmap %p, va %lx, ptste %p, ptpmap %p, flags %x",
pv->pv_pmap, pv->pv_va, pv->pv_ptste, pv->pv_ptpmap,
pv->pv_flags);
printf("\n");
@@ -2657,8 +2667,8 @@ pmap_check_wiring(str, va)
vm_offset_t va;
{
vm_map_entry_t entry;
- register int count;
- register pt_entry_t *pte;
+ int count;
+ pt_entry_t *pte;
va = trunc_page(va);
if (!pmap_ste_v(pmap_kernel(), va) ||
@@ -2666,7 +2676,7 @@ pmap_check_wiring(str, va)
return;
if (!vm_map_lookup_entry(pt_map, va, &entry)) {
- printf("wired_check: entry for %x not found\n", va);
+ printf("wired_check: entry for %lx not found\n", va);
return;
}
count = 0;
@@ -2674,7 +2684,7 @@ pmap_check_wiring(str, va)
if (*pte)
count++;
if (entry->wired_count != count)
- printf("*%s*: %x: w%d/a%d\n",
+ printf("*%s*: %lx: w%d/a%d\n",
str, va, entry->wired_count, count);
}
#endif
diff --git a/sys/arch/hp300/hp300/pmap_bootstrap.c b/sys/arch/hp300/hp300/pmap_bootstrap.c
index 09239664880..63df63ec17f 100644
--- a/sys/arch/hp300/hp300/pmap_bootstrap.c
+++ b/sys/arch/hp300/hp300/pmap_bootstrap.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: pmap_bootstrap.c,v 1.3 1997/01/12 15:13:26 downsj Exp $ */
-/* $NetBSD: pmap_bootstrap.c,v 1.10 1996/10/14 08:05:37 thorpej Exp $ */
+/* $OpenBSD: pmap_bootstrap.c,v 1.4 1997/04/16 11:56:31 downsj Exp $ */
+/* $NetBSD: pmap_bootstrap.c,v 1.11 1997/04/01 03:12:29 scottr Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -42,12 +42,17 @@
#include <sys/param.h>
#include <sys/msgbuf.h>
+#include <sys/proc.h>
+
+#include <machine/frame.h>
+#include <machine/cpu.h>
+#include <machine/vmparam.h>
#include <machine/pte.h>
+
#include <hp300/hp300/clockreg.h>
-#include <machine/vmparam.h>
-#include <machine/cpu.h>
#include <vm/vm.h>
+#include <vm/pmap.h>
#define RELOC(v, t) *((t*)((u_int)&(v) + firstpa))
@@ -67,6 +72,8 @@ extern int protection_codes[];
extern int pmap_aliasmask;
#endif
+void pmap_bootstrap __P((vm_offset_t, vm_offset_t));
+
/*
* Special purpose kernel virtual addresses, used for mapping
* physical pages for a variety of temporary or permanent purposes:
@@ -93,12 +100,12 @@ struct msgbuf *msgbufp;
void
pmap_bootstrap(nextpa, firstpa)
vm_offset_t nextpa;
- register vm_offset_t firstpa;
+ vm_offset_t firstpa;
{
vm_offset_t kstpa, kptpa, iiopa, eiopa, kptmpa, lkptpa, p0upa;
u_int nptpages, kstsize;
- register st_entry_t protoste, *ste;
- register pt_entry_t protopte, *pte, *epte;
+ st_entry_t protoste, *ste;
+ pt_entry_t protopte, *pte, *epte;
/*
* Calculate important physical addresses:
@@ -176,7 +183,7 @@ pmap_bootstrap(nextpa, firstpa)
* likely be insufficient in the future (at least for the kernel).
*/
if (RELOC(mmutype, int) == MMU_68040) {
- register int num;
+ int num;
/*
* First invalidate the entire "segment table" pages
@@ -453,7 +460,7 @@ pmap_bootstrap(nextpa, firstpa)
* absolute "jmp" table.
*/
{
- register int *kp;
+ int *kp;
kp = &RELOC(protection_codes, int);
kp[VM_PROT_NONE|VM_PROT_NONE|VM_PROT_NONE] = 0;
@@ -486,7 +493,7 @@ pmap_bootstrap(nextpa, firstpa)
* MAXKL2SIZE-1: maps last-page page table
*/
if (RELOC(mmutype, int) == MMU_68040) {
- register int num;
+ int num;
kpm->pm_stfree = ~l2tobm(0);
num = roundup((nptpages + 1) * (NPTEPG / SG4_LEV3SIZE),
diff --git a/sys/arch/hp300/hp300/sys_machdep.c b/sys/arch/hp300/hp300/sys_machdep.c
index 89852d1ed5c..30f17f56bd7 100644
--- a/sys/arch/hp300/hp300/sys_machdep.c
+++ b/sys/arch/hp300/hp300/sys_machdep.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: sys_machdep.c,v 1.3 1997/01/12 15:13:27 downsj Exp $ */
-/* $NetBSD: sys_machdep.c,v 1.13 1995/12/11 17:09:17 thorpej Exp $ */
+/* $OpenBSD: sys_machdep.c,v 1.4 1997/04/16 11:56:31 downsj Exp $ */
+/* $NetBSD: sys_machdep.c,v 1.15 1997/04/06 21:40:38 mycroft Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@@ -61,7 +61,7 @@ sys_vtrace(p, v, retval)
void *v;
register_t *retval;
{
- register struct sys_vtrace_args /* {
+ struct sys_vtrace_args /* {
syscallarg(int) request;
syscallarg(int) value;
} */ *uap = v;
@@ -101,8 +101,8 @@ sys_vtrace(p, v, retval)
vdoualarm(arg)
void *arg;
{
- register int pid = (int)arg;
- register struct proc *p;
+ int pid = (int)arg;
+ struct proc *p;
p = pfind(pid);
if (p)
@@ -131,6 +131,7 @@ vdoualarm(arg)
* do pages, above that we do the entire cache.
*/
/*ARGSUSED1*/
+int
cachectl(req, addr, len)
int req;
caddr_t addr;
@@ -140,9 +141,9 @@ cachectl(req, addr, len)
#if defined(M68040)
if (mmutype == MMU_68040) {
- register int inc = 0;
+ int inc = 0;
int pa = 0, doall = 0;
- caddr_t end;
+ caddr_t end = 0;
#ifdef COMPAT_HPUX
extern struct emul emul_hpux;
@@ -152,7 +153,7 @@ cachectl(req, addr, len)
#endif
if (addr == 0 ||
- (req & ~CC_EXTPURGE) != CC_PURGE && len > 2*NBPG)
+ ((req & ~CC_EXTPURGE) != CC_PURGE && len > 2*NBPG))
doall = 1;
if (!doall) {
@@ -228,7 +229,7 @@ cachectl(req, addr, len)
switch (req) {
case CC_EXTPURGE|CC_PURGE:
case CC_EXTPURGE|CC_FLUSH:
-#if defined(HP370)
+#if defined(HP340) || defined(HP360) || defined(HP370) || defined(HP375)
if (ectype == EC_PHYS)
PCIA();
/* fall into... */
@@ -238,7 +239,7 @@ cachectl(req, addr, len)
DCIU();
break;
case CC_EXTPURGE|CC_IPURGE:
-#if defined(HP370)
+#if defined(HP340) || defined(HP360) || defined(HP370) || defined(HP375)
if (ectype == EC_PHYS)
PCIA();
else
@@ -261,10 +262,12 @@ sys_sysarch(p, v, retval)
void *v;
register_t *retval;
{
+#if 0 /* unused */
struct sys_sysarch_args /* {
syscallarg(int) op;
syscallarg(char *) parms;
} */ *uap = v;
+#endif
return ENOSYS;
}
diff --git a/sys/arch/hp300/hp300/trap.c b/sys/arch/hp300/hp300/trap.c
index 74deb73d028..fd121bad97a 100644
--- a/sys/arch/hp300/hp300/trap.c
+++ b/sys/arch/hp300/hp300/trap.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: trap.c,v 1.9 1997/03/26 08:32:45 downsj Exp $ */
-/* $NetBSD: trap.c,v 1.48 1997/03/15 23:34:32 thorpej Exp $ */
+/* $OpenBSD: trap.c,v 1.10 1997/04/16 11:56:32 downsj Exp $ */
+/* $NetBSD: trap.c,v 1.52 1997/04/14 02:28:48 thorpej Exp $ */
/*
* Copyright (c) 1997 Theo de Raadt
@@ -86,15 +86,20 @@
#include <sys/ktrace.h>
#endif
+#include <m68k/frame.h>
+
+#include <machine/db_machdep.h>
#include <machine/psl.h>
#include <machine/trap.h>
#include <machine/cpu.h>
#include <machine/reg.h>
-#include <machine/mtpr.h>
+#include <machine/intr.h>
#include <vm/vm.h>
#include <vm/pmap.h>
+#include <dev/cons.h>
+
#ifdef COMPAT_HPUX
#include <compat/hpux/hpux.h>
extern struct emul emul_hpux;
@@ -108,6 +113,7 @@ extern struct emul emul_sunos;
int writeback __P((struct frame *fp, int docachepush));
void trap __P((int type, u_int code, u_int v, struct frame frame));
void syscall __P((register_t code, struct frame frame));
+void child_return __P((struct proc *, struct frame));
#ifdef DEBUG
void dumpssw __P((u_short));
@@ -199,8 +205,8 @@ int mmupid = -1;
*/
static inline void
userret(p, fp, oticks, faultaddr, fromtrap)
- register struct proc *p;
- register struct frame *fp;
+ struct proc *p;
+ struct frame *fp;
u_quad_t oticks;
u_int faultaddr;
int fromtrap;
@@ -260,7 +266,7 @@ again:
"pid %d(%s): writeback aborted in sigreturn, pc=%x\n",
p->p_pid, p->p_comm, fp->f_pc, faultaddr);
#endif
- } else if (sig = writeback(fp, fromtrap)) {
+ } else if ((sig = writeback(fp, fromtrap))) {
beenhere = 1;
oticks = p->p_sticks;
trapsignal(p, sig, T_MMUFLT, SEGV_MAPERR,
@@ -282,14 +288,14 @@ void
trap(type, code, v, frame)
int type;
unsigned code;
- register unsigned v;
+ unsigned v;
struct frame frame;
{
extern char fubail[], subail[];
- register struct proc *p;
- register int i, s;
+ struct proc *p;
+ int i, s;
u_int ucode;
- u_quad_t sticks;
+ u_quad_t sticks = 0 /* XXX initializer works around compiler bug */;
int typ = 0;
cnt.v_trap++;
@@ -328,9 +334,11 @@ trap(type, code, v, frame)
goto kgdb_cont;
#endif
#ifdef DDB
- (void) kdb_trap(type, &frame);
+ (void)kdb_trap(type, (db_regs_t *)&frame);
#endif
+#ifdef KGDB
kgdb_cont:
+#endif
splx(s);
if (panicstr) {
printf("trap during panic!\n");
@@ -403,12 +411,12 @@ trap(type, code, v, frame)
case T_FPERR|T_USER: /* 68881 exceptions */
/*
- * We pass along the 68881 status register which locore stashed
+ * We pass along the 68881 status which locore stashed
* in code for us. Note that there is a possibility that the
- * bit pattern of this register will conflict with one of the
+ * bit pattern of this will conflict with one of the
* FPE_* codes defined in signal.h. Fortunately for us, the
* only such codes we use are all in the range 1-7 and the low
- * 3 bits of the status register are defined as 0 so there is
+ * 3 bits of the status are defined as 0 so there is
* no clash.
*/
typ = FPE_FLTRES;
@@ -562,6 +570,7 @@ trap(type, code, v, frame)
case T_SSIR: /* software interrupt */
case T_SSIR|T_USER:
if (ssir & SIR_NET) {
+ void netintr __P((void));
siroff(SIR_NET);
cnt.v_soft++;
netintr();
@@ -597,9 +606,9 @@ trap(type, code, v, frame)
case T_MMUFLT|T_USER: /* page fault */
{
- register vm_offset_t va;
- register struct vmspace *vm = p->p_vmspace;
- register vm_map_t map;
+ vm_offset_t va;
+ struct vmspace *vm = p->p_vmspace;
+ vm_map_t map;
int rv;
vm_prot_t ftype, vftype;
extern vm_map_t kernel_map;
@@ -640,6 +649,7 @@ trap(type, code, v, frame)
#ifdef COMPAT_HPUX
if (ISHPMMADDR(va)) {
+ int pmap_mapmulti __P((pmap_t, vm_offset_t));
vm_offset_t bva;
rv = pmap_mapmulti(map->pmap, va);
@@ -654,7 +664,7 @@ trap(type, code, v, frame)
rv = vm_fault(map, va, ftype, FALSE);
#ifdef DEBUG
if (rv && MDB_ISPID(p->p_pid))
- printf("vm_fault(%x, %x, %x, 0) -> %x\n",
+ printf("vm_fault(%p, %lx, %x, 0) -> %x\n",
map, va, ftype, rv);
#endif
/*
@@ -688,7 +698,7 @@ trap(type, code, v, frame)
if (type == T_MMUFLT) {
if (p->p_addr->u_pcb.pcb_onfault)
goto copyfault;
- printf("vm_fault(%x, %x, %x, 0) -> %x\n",
+ printf("vm_fault(%p, %lx, %x, 0) -> %x\n",
map, va, ftype, rv);
printf(" type %x, code [mmu,,ssw]: %x\n",
type, code);
@@ -731,8 +741,8 @@ writeback(fp, docachepush)
struct frame *fp;
int docachepush;
{
- register struct fmt7 *f = &fp->f_fmt7;
- register struct proc *p = curproc;
+ struct fmt7 *f = &fp->f_fmt7;
+ struct proc *p = curproc;
int err = 0;
u_int fa;
caddr_t oonfault = p->p_addr->u_pcb.pcb_onfault;
@@ -815,8 +825,8 @@ writeback(fp, docachepush)
* Writeback #1.
* Position the "memory-aligned" data and write it out.
*/
- register u_int wb1d = f->f_wb1d;
- register int off;
+ u_int wb1d = f->f_wb1d;
+ int off;
#ifdef DEBUG
if ((mmudebug & MDB_WBFOLLOW) || MDB_ISPID(p->p_pid))
@@ -963,7 +973,7 @@ writeback(fp, docachepush)
#ifdef DEBUG
void
dumpssw(ssw)
- register u_short ssw;
+ u_short ssw;
{
printf(" SSW: %x: ", ssw);
if (ssw & SSW4_CP)
@@ -994,7 +1004,7 @@ dumpwb(num, s, a, d)
u_short s;
u_int a, d;
{
- register struct proc *p = curproc;
+ struct proc *p = curproc;
vm_offset_t pa;
printf(" writeback #%d: VA %x, data %x, SZ=%s, TT=%s, TM=%s\n",
@@ -1005,7 +1015,7 @@ dumpwb(num, s, a, d)
if (pa == 0)
printf("<invalid address>");
else
- printf("%x, current value %x", pa, fuword((caddr_t)a));
+ printf("%lx, current value %lx", pa, fuword((caddr_t)a));
printf("\n");
}
#endif
@@ -1019,9 +1029,9 @@ syscall(code, frame)
register_t code;
struct frame frame;
{
- register caddr_t params;
- register struct sysent *callp;
- register struct proc *p;
+ caddr_t params;
+ struct sysent *callp;
+ struct proc *p;
int error, opc, nsys;
size_t argsize;
register_t args[8], rval[2];
diff --git a/sys/arch/hp300/hp300/vm_machdep.c b/sys/arch/hp300/hp300/vm_machdep.c
index e22fbf4e006..862f58f65dc 100644
--- a/sys/arch/hp300/hp300/vm_machdep.c
+++ b/sys/arch/hp300/hp300/vm_machdep.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: vm_machdep.c,v 1.8 1997/03/26 08:32:45 downsj Exp $ */
-/* $NetBSD: vm_machdep.c,v 1.34 1997/03/16 09:59:40 thorpej Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.9 1997/04/16 11:56:32 downsj Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.35 1997/04/01 03:12:33 scottr Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -53,13 +53,16 @@
#include <sys/core.h>
#include <sys/exec.h>
-#include <vm/vm.h>
-#include <vm/vm_kern.h>
-
+#include <machine/frame.h>
#include <machine/cpu.h>
#include <machine/pte.h>
#include <machine/reg.h>
+#include <vm/vm.h>
+#include <vm/vm_kern.h>
+
+void setredzone __P((pt_entry_t *, caddr_t));
+
/*
* Finish a fork operation, with process p2 nearly set up.
* Copy and update the kernel stack and pcb, making the child
@@ -71,13 +74,13 @@
*/
void
cpu_fork(p1, p2)
- register struct proc *p1, *p2;
+ struct proc *p1, *p2;
{
- register struct pcb *pcb = &p2->p_addr->u_pcb;
- register struct trapframe *tf;
- register struct switchframe *sf;
+ void child_return __P((struct proc *, struct frame));
+ struct pcb *pcb = &p2->p_addr->u_pcb;
+ struct trapframe *tf;
+ struct switchframe *sf;
extern struct pcb *curpcb;
- extern void proc_trampoline(), child_return();
p2->p_md.md_flags = p1->p_md.md_flags;
@@ -196,10 +199,10 @@ cpu_coredump(p, vp, cred, chdr)
*/
void
pagemove(from, to, size)
- register caddr_t from, to;
+ caddr_t from, to;
size_t size;
{
- register vm_offset_t pa;
+ vm_offset_t pa;
#ifdef DEBUG
if (size & CLOFSET)
@@ -228,12 +231,13 @@ pagemove(from, to, size)
* kernel VA space at `vaddr'. Read/write and cache-inhibit status
* are specified by `prot'.
*/
+void
physaccess(vaddr, paddr, size, prot)
caddr_t vaddr, paddr;
- register int size, prot;
+ int size, prot;
{
- register pt_entry_t *pte;
- register u_int page;
+ pt_entry_t *pte;
+ u_int page;
pte = kvtopte(vaddr);
page = (u_int)paddr & PG_FRAME;
@@ -244,11 +248,12 @@ physaccess(vaddr, paddr, size, prot)
TBIAS();
}
+void
physunaccess(vaddr, size)
caddr_t vaddr;
- register int size;
+ int size;
{
- register pt_entry_t *pte;
+ pt_entry_t *pte;
pte = kvtopte(vaddr);
for (size = btoc(size); size; size--)
@@ -268,6 +273,7 @@ physunaccess(vaddr, size)
* Look at _lev6intr in locore.s for more details.
*/
/*ARGSUSED*/
+void
setredzone(pte, vaddr)
pt_entry_t *pte;
caddr_t vaddr;
@@ -277,8 +283,9 @@ setredzone(pte, vaddr)
/*
* Convert kernel VA to physical address
*/
+int
kvtop(addr)
- register caddr_t addr;
+ caddr_t addr;
{
vm_offset_t va;
@@ -301,16 +308,16 @@ extern vm_map_t phys_map;
/*ARGSUSED*/
void
vmapbuf(bp, sz)
- register struct buf *bp;
+ struct buf *bp;
vm_size_t sz;
{
- register int npf;
- register caddr_t addr;
- register long flags = bp->b_flags;
+ int npf;
+ caddr_t addr;
+ long flags = bp->b_flags;
struct proc *p;
int off;
vm_offset_t kva;
- register vm_offset_t pa;
+ vm_offset_t pa;
if ((flags & B_PHYS) == 0)
panic("vmapbuf");
@@ -338,11 +345,11 @@ vmapbuf(bp, sz)
/*ARGSUSED*/
void
vunmapbuf(bp, sz)
- register struct buf *bp;
+ struct buf *bp;
vm_size_t sz;
{
- register caddr_t addr;
- register int npf;
+ caddr_t addr;
+ int npf;
vm_offset_t kva;
if ((bp->b_flags & B_PHYS) == 0)
diff --git a/sys/arch/hp300/include/autoconf.h b/sys/arch/hp300/include/autoconf.h
index 039c70ffc1b..4dfc2583426 100644
--- a/sys/arch/hp300/include/autoconf.h
+++ b/sys/arch/hp300/include/autoconf.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: autoconf.h,v 1.3 1997/02/03 04:48:00 downsj Exp $ */
-/* $NetBSD: autoconf.h,v 1.3 1996/03/03 16:49:17 thorpej Exp $ */
+/* $OpenBSD: autoconf.h,v 1.4 1997/04/16 11:56:33 downsj Exp $ */
+/* $NetBSD: autoconf.h,v 1.4 1997/04/01 03:03:56 scottr Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -44,6 +44,7 @@ extern caddr_t conaddr; /* KVA of console device */
extern int convasize; /* size of mapping at conaddr */
extern int conforced; /* console has been forced */
+void configure __P((void));
void hp300_cninit __P((void));
void console_scan __P((int (*)(int, caddr_t, void *), void *));
caddr_t iomap __P((caddr_t, int));
diff --git a/sys/arch/hp300/include/cpu.h b/sys/arch/hp300/include/cpu.h
index 495520dbc2d..d8217c91a33 100644
--- a/sys/arch/hp300/include/cpu.h
+++ b/sys/arch/hp300/include/cpu.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: cpu.h,v 1.5 1997/01/12 15:13:33 downsj Exp $ */
-/* $NetBSD: cpu.h,v 1.21 1996/10/07 06:29:30 thorpej Exp $ */
+/* $OpenBSD: cpu.h,v 1.6 1997/04/16 11:56:34 downsj Exp $ */
+/* $NetBSD: cpu.h,v 1.24 1997/04/14 02:28:50 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -56,6 +56,11 @@
#include <m68k/cpu.h>
/*
+ * Get interrupt glue.
+ */
+#include <machine/intr.h>
+
+/*
* definitions of cpu-dependent requirements
* referenced in generic code
*/
@@ -110,19 +115,6 @@ struct clockframe {
int astpending; /* need to trap before returning to user mode */
int want_resched; /* resched() was called */
-
-/*
- * simulated software interrupt register
- */
-extern unsigned char ssir;
-
-#define SIR_NET 0x1
-#define SIR_CLOCK 0x2
-
-#define siroff(x) ssir &= ~(x)
-#define setsoftnet() ssir |= SIR_NET
-#define setsoftclock() ssir |= SIR_CLOCK
-
/*
* CTL_MACHDEP definitions.
*/
@@ -209,9 +201,40 @@ extern int cpuspeed; /* CPU speed, in MHz */
extern char *intiobase, *intiolimit;
extern void (*vectab[]) __P((void));
-struct frame;
+struct frame;
+struct fpframe;
+struct pcb;
/* locore.s functions */
+void m68881_save __P((struct fpframe *));
+void m68881_restore __P((struct fpframe *));
+u_long getdfc __P((void));
+u_long getsfc __P((void));
+void DCIA __P((void));
+void DCIS __P((void));
+void DCIU __P((void));
+void ICIA __P((void));
+void ICPA __P((void));
+void PCIA __P((void));
+void TBIA __P((void));
+void TBIS __P((vm_offset_t));
+void TBIAS __P((void));
+void TBIAU __P((void));
+#if defined(M68040)
+void DCFA __P((void));
+void DCFP __P((vm_offset_t));
+void DCFL __P((vm_offset_t));
+void DCPL __P((vm_offset_t));
+void DCPP __P((vm_offset_t));
+void ICPL __P((vm_offset_t));
+void ICPP __P((vm_offset_t));
+#endif
+int suline __P((caddr_t, caddr_t));
+void savectx __P((struct pcb *));
+void switch_exit __P((struct proc *));
+void proc_trampoline __P((void));
+void loadustp __P((int));
+
void doboot __P((void))
__attribute__((__noreturn__));
void ecacheon __P((void));
@@ -221,6 +244,15 @@ void ecacheoff __P((void));
int badaddr __P((caddr_t));
int badbaddr __P((caddr_t));
void regdump __P((struct frame *, int));
+void dumpconf __P((void));
+
+/* sys_machdep.c functions */
+int cachectl __P((int, caddr_t, int));
+
+/* vm_machdep.c functions */
+void physaccess __P((caddr_t, caddr_t, int, int));
+void physunaccess __P((caddr_t, int));
+int kvtop __P((caddr_t));
/* what is this supposed to do? i.e. how is it different than startrtclock? */
#define enablertclock()
diff --git a/sys/arch/hp300/include/hpux_machdep.h b/sys/arch/hp300/include/hpux_machdep.h
index 7c6f14f1e9e..337986aa9fb 100644
--- a/sys/arch/hp300/include/hpux_machdep.h
+++ b/sys/arch/hp300/include/hpux_machdep.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: hpux_machdep.h,v 1.4 1997/03/26 08:32:46 downsj Exp $ */
-/* $NetBSD: hpux_machdep.h,v 1.6 1997/03/16 10:02:40 thorpej Exp $ */
+/* $OpenBSD: hpux_machdep.h,v 1.5 1997/04/16 11:56:34 downsj Exp $ */
+/* $NetBSD: hpux_machdep.h,v 1.7 1997/04/01 20:05:14 scottr Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -66,6 +66,10 @@ struct hpuxsigcontext {
int _hsc_ap; /* pointer to hpuxsigstate */
};
+#ifdef _KERNEL
+struct exec_package;
+struct exec_vmcmd;
+
int hpux_cpu_makecmds __P((struct proc *, struct exec_package *));
int hpux_cpu_vmcmd __P((struct proc *, struct exec_vmcmd *));
void hpux_cpu_bsd_to_hpux_stat __P((struct stat *, struct hpux_stat *));
@@ -76,5 +80,6 @@ int hpux_to_bsd_uoff __P((int *, int *, struct proc *));
void hpux_sendsig __P((sig_t, int, int, u_long, int, union sigval));
void hpux_setregs __P((struct proc *, struct exec_package *,
u_long, register_t *));
+#endif /* _KERNEL */
#endif /* ! _MACHINE_HPUX_MACHDEP_H_ */
diff --git a/sys/arch/hp300/include/intr.h b/sys/arch/hp300/include/intr.h
new file mode 100644
index 00000000000..af46f056d31
--- /dev/null
+++ b/sys/arch/hp300/include/intr.h
@@ -0,0 +1,176 @@
+/* $OpenBSD: intr.h,v 1.1 1997/04/16 11:56:35 downsj Exp $ */
+/* $NetBSD: intr.h,v 1.1 1997/04/14 02:28:51 thorpej Exp $ */
+
+/*-
+ * Copyright (c) 1996, 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.
+ */
+
+#ifndef _HP300_INTR_H_
+#define _HP300_INTR_H_
+
+#include <machine/psl.h>
+
+#ifdef _HP300_INTR_H_PRIVATE
+#include <sys/queue.h>
+
+/*
+ * The location and size of the autovectored interrupt portion
+ * of the vector table.
+ */
+#define ISRLOC 0x18
+#define NISR 8
+
+struct isr {
+ LIST_ENTRY(isr) isr_link;
+ int (*isr_func) __P((void *));
+ void *isr_arg;
+ int isr_ipl;
+ int isr_priority;
+};
+#endif /* _HP300_INTR_H_PRIVATE */
+
+/*
+ * Interrupt "levels". These are a more abstract representation
+ * of interrupt levels, and do not have the same meaning as m68k
+ * CPU interrupt levels. They serve two purposes:
+ *
+ * - properly order ISRs in the list for that CPU ipl
+ * - compute CPU PSL values for the spl*() calls.
+ */
+#define IPL_NONE 0 /* disable only this interrupt */
+#define IPL_BIO 1 /* disable block I/O interrupts */
+#define IPL_NET 2 /* disable network interrupts */
+#define IPL_TTY 3 /* disable terminal interrupts */
+#define IPL_TTYNOBUF 4 /* IPL_TTY + higher ISR priority */
+#define IPL_CLOCK 5 /* disable clock interrupts */
+#define IPL_HIGH 6 /* disable all interrupts */
+
+/*
+ * Convert PSL values to CPU IPLs and vice-versa.
+ */
+#define PSLTOIPL(x) (((x) >> 8) & 0xf)
+#define IPLTOPSL(x) ((((x) & 0xf) << 8) | PSL_S)
+
+#ifdef _KERNEL
+/*
+ * spl functions; all but spl0 are done in-line
+ */
+
+#define _spl(s) \
+({ \
+ register int _spl_r; \
+ \
+ __asm __volatile ("clrl %0; movew sr,%0; movew %1,sr" : \
+ "&=d" (_spl_r) : "di" (s)); \
+ _spl_r; \
+})
+
+#define _splraise(s) \
+({ \
+ register int _spl_r; \
+ \
+ __asm __volatile ("clrl %0; movew sr,%0;" : "&=d" (_spl_r) : ); \
+ if ((_spl_r & PSL_IPL) < ((s) & PSL_IPL)) \
+ __asm __volatile ("movew %0,sr;" : : "di" (s)); \
+ _spl_r; \
+})
+
+/* spl0 requires checking for software interrupts */
+#define spl1() _spl(PSL_S|PSL_IPL1)
+#define spl2() _spl(PSL_S|PSL_IPL2)
+#define spl3() _spl(PSL_S|PSL_IPL3)
+#define spl4() _spl(PSL_S|PSL_IPL4)
+#define spl5() _spl(PSL_S|PSL_IPL5)
+#define spl6() _spl(PSL_S|PSL_IPL6)
+#define spl7() _spl(PSL_S|PSL_IPL7)
+
+/*
+ * These four globals contain the appropriate PSL_S|PSL_IPL? values
+ * to raise interupt priority to the requested level.
+ */
+extern unsigned short hp300_bioipl;
+extern unsigned short hp300_netipl;
+extern unsigned short hp300_ttyipl;
+extern unsigned short hp300_impipl;
+
+/* These spl calls are _not_ to be used by machine-independent code. */
+#define splhil() _splraise(PSL_S|PSL_IPL1)
+#define splkbd() splhil()
+#define splsoft() spl1()
+
+/* These spl calls are used by machine-independent code. */
+#define splsoftclock() splsoft()
+#define splsoftnet() splsoft()
+#define splbio() _splraise(hp300_bioipl)
+#define splnet() _splraise(hp300_netipl)
+#define spltty() _splraise(hp300_ttyipl)
+#define splimp() _splraise(hp300_impipl)
+#define splclock() spl6()
+#define splstatclock() spl6()
+#define splvm() spl6()
+#define splhigh() spl7()
+#define splsched() spl7()
+
+/* watch out for side effects */
+#define splx(s) ((s) & PSL_IPL ? _spl((s)) : spl0())
+
+/*
+ * Simulated software interrupt register.
+ */
+extern volatile u_int8_t ssir;
+
+#define SIR_NET 0x01
+#define SIR_CLOCK 0x02
+
+#define siron(mask) \
+ __asm __volatile ( "orb %0,_ssir" : : "i" ((mask)))
+#define siroff(mask) \
+ __asm __volatile ( "andb %0,_ssir" : : "ir" (~(mask)));
+
+#define setsoftnet() siron(SIR_NET)
+#define setsoftclock() siron(SIR_CLOCK)
+
+/* locore.s */
+int spl0 __P((void));
+
+/* intr.c */
+void intr_init __P((void));
+void *intr_establish __P((int (*)(void *), void *, int, int));
+void intr_disestablish __P((void *));
+void intr_dispatch __P((int));
+void intr_printlevels __P((void));
+#endif /* _KERNEL */
+
+#endif /* _HP300_INTR_H_ */
diff --git a/sys/arch/hp300/include/param.h b/sys/arch/hp300/include/param.h
index a5c8ef1fe01..1d5f8e5baeb 100644
--- a/sys/arch/hp300/include/param.h
+++ b/sys/arch/hp300/include/param.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: param.h,v 1.6 1997/02/04 06:21:33 downsj Exp $ */
-/* $NetBSD: param.h,v 1.28 1997/02/02 09:34:26 thorpej Exp $ */
+/* $OpenBSD: param.h,v 1.7 1997/04/16 11:56:35 downsj Exp $ */
+/* $NetBSD: param.h,v 1.32 1997/04/14 02:28:51 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -53,6 +53,11 @@
#define MID_MACHINE MID_M68K
/*
+ * Interrupt glue.
+ */
+#include <machine/intr.h>
+
+/*
* Round p (pointer or byte index) up to a correctly-aligned value for all
* data types (int, long, ...). The result is u_int and must be cast to
* any desired pointer type.
@@ -141,74 +146,11 @@
#define hp300_btop(x) ((unsigned)(x) >> PGSHIFT)
#define hp300_ptob(x) ((unsigned)(x) << PGSHIFT)
-/*
- * spl functions; all but spl0 are done in-line
- */
-#include <machine/psl.h>
-
-#define _spl(s) \
-({ \
- register int _spl_r; \
-\
- __asm __volatile ("clrl %0; movew sr,%0; movew %1,sr" : \
- "&=d" (_spl_r) : "di" (s)); \
- _spl_r; \
-})
-
-#define _splraise(s) \
-({ \
- register int _spl_r; \
-\
- __asm __volatile ("clrl %0; movew sr,%0;" : "&=d" (_spl_r) : ); \
- if ((_spl_r & PSL_IPL) < ((s) & PSL_IPL)) \
- __asm __volatile ("movew %0,sr;" : : "di" (s)); \
- _spl_r; \
-})
-
-/* spl0 requires checking for software interrupts */
-#define spl1() _spl(PSL_S|PSL_IPL1)
-#define spl2() _spl(PSL_S|PSL_IPL2)
-#define spl3() _spl(PSL_S|PSL_IPL3)
-#define spl4() _spl(PSL_S|PSL_IPL4)
-#define spl5() _spl(PSL_S|PSL_IPL5)
-#define spl6() _spl(PSL_S|PSL_IPL6)
-#define spl7() _spl(PSL_S|PSL_IPL7)
-
#if defined(_KERNEL) && !defined(_LOCORE)
-/*
- * These four globals contain the appropriate PSL_S|PSL_IPL? values
- * to raise interrupt priority to the requested level.
- */
-extern unsigned short hp300_bioipl;
-extern unsigned short hp300_netipl;
-extern unsigned short hp300_ttyipl;
-extern unsigned short hp300_impipl;
-#endif /* _KERNEL && !_LOCORE */
-
-/* These spl calls are _not_ to be used by machine-independent code. */
-#define splhil() _splraise(PSL_S|PSL_IPL1)
-#define splkbd() splhil()
-
-/* These spl calls are used by machine-independent code. */
-#define splsoftclock() spl1()
-#define splsoftnet() spl1()
-#define splbio() _splraise(hp300_bioipl)
-#define splnet() _splraise(hp300_netipl)
-#define spltty() _splraise(hp300_ttyipl)
-#define splimp() _splraise(hp300_impipl)
-#define splclock() spl6()
-#define splstatclock() spl6()
-#define splvm() spl6()
-#define splhigh() spl7()
-#define splsched() spl7()
-
-/* watch out for side effects */
-#define splx(s) (s & PSL_IPL ? _spl(s) : spl0())
-
-#if defined(_KERNEL) && !defined(_LOCORE)
-extern void _delay __P((u_int));
#define delay(us) _delay((us) << 8)
#define DELAY(us) delay(us)
+
+void _delay __P((u_int));
#endif /* _KERNEL && !_LOCORE */
#ifdef COMPAT_HPUX
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/hp300/isr.h b/sys/arch/hp300/stand/kbdconf.c
index 09723c5d5fa..31d0531a315 100644
--- a/sys/arch/hp300/hp300/isr.h
+++ b/sys/arch/hp300/stand/kbdconf.c
@@ -1,8 +1,8 @@
-/* $OpenBSD: isr.h,v 1.3 1997/01/12 15:13:18 downsj Exp $ */
-/* $NetBSD: isr.h,v 1.7 1996/12/09 03:04:47 thorpej Exp $ */
+/* $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) 1996 The NetBSD Foundation, Inc.
+ * Copyright (c) 1997 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -37,42 +37,33 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/queue.h>
-
/*
- * The location and size of the autovectored interrupt portion
- * of the vector table.
+ * Keyboard support configuration.
*/
-#define ISRLOC 0x18
-#define NISR 8
-struct isr {
- LIST_ENTRY(isr) isr_link;
- int (*isr_func) __P((void *));
- void *isr_arg;
- int isr_ipl;
- int isr_priority;
-};
+#ifdef ITECONSOLE
-/*
- * ISR priorities. These are not the same as interrupt levels.
- * These serve 2 purposes:
- * - properly order ISRs in the list
- * - compute levels for spl*() calls.
- */
-#define ISRPRI_BIO 0
-#define ISRPRI_NET 1
-#define ISRPRI_TTY 2
-#define ISRPRI_TTYNOBUF 3
+#include <sys/param.h>
+
+#include "samachdep.h"
+#include "kbdvar.h"
+
+#ifndef SMALL
/*
- * Convert PSL values to IPLs and vice-versa.
+ * Note, these are arranged in order of preference. The first `init'
+ * routine to report success gets to play.
*/
-#define PSLTOIPL(x) (((x) >> 8) & 0xf)
-#define IPLTOPSL(x) ((((x) & 0xf) << 8) | PSL_S)
+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 */
-void isrinit __P((void));
-void *isrlink __P((int (*)(void *), void *, int, int));
-void isrunlink __P((void *));
-void isrdispatch __P((int));
-void isrprintlevels __P((void));
+#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 */