-# $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.
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
-# $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
#
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
-# $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.
#
# (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"
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
-# $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
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
-/* $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.
*/
#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
#define ACD_OPEN 0x0002
#endif
-int
+static int
acmatch(parent, match, aux)
struct device *parent;
void *match, *aux;
return (1);
}
-void
+static void
acattach(parent, self, aux)
struct device *parent, *self;
void *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 ||
}
/*ARGSUSED*/
+int
acclose(dev, flag, mode, p)
dev_t dev;
int flag, mode;
(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;
return(error);
}
+int
accommand(dev, command, bufp, buflen)
dev_t dev;
int command;
{
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)
#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);
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);
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:
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;
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",
-/* $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.
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 */
--- /dev/null
+/* $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))
-/* $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.
*/
#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>
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]);
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;
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);
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;
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;
void *arg;
{
struct ct_softc *sc = arg;
- register struct buf *bp;
+ struct buf *bp;
int rw;
bp = sc->sc_tab.b_actf;
*/
void
cteof(sc, bp)
- register struct ct_softc *sc;
- register struct buf *bp;
+ struct ct_softc *sc;
+ struct buf *bp;
{
long blks;
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
* 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;
}
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;
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
"%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,
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;
caddr_t data;
struct proc *p;
{
- register struct mtop *op;
- register int cnt;
+ struct mtop *op;
+ int cnt;
switch (cmd) {
-/* $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.
*
#include <machine/autoconf.h>
#include <machine/cpu.h>
+#include <machine/intr.h>
#include <dev/cons.h>
#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 */
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.
*/
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
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)
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);
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;
/*
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) {
}
}
+void
dcaeint(sc, stat)
struct dca_softc *sc;
int stat;
(*linesw[tp->t_line].l_rint)(c, tp);
}
+void
dcamint(sc)
struct dca_softc *sc;
{
int
dcaioctl(dev, cmd, data, flag, p)
dev_t dev;
- int cmd;
+ u_long cmd;
caddr_t data;
int flag;
struct proc *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];
break;
case CS8:
+ default: /* XXX gcc whines about cfcr being unitialized... */
cfcr = CFCR_8BITS;
break;
}
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];
* 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;
void
dcacnputc(dev, c)
dev_t dev;
- register int c;
+ int c;
{
int timo;
u_char stat;
-/* $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.
#include <machine/autoconf.h>
#include <machine/cpu.h>
+#include <machine/intr.h>
#include <dev/cons.h>
#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) */
* 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;
#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 *));
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;
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;
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);
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 */
/*
{
int unit, board, port;
struct dcm_softc *sc;
- register struct tty *tp;
+ struct tty *tp;
unit = DCMUNIT(dev);
board = DCMBOARD(unit);
{
int unit, board, port;
struct dcm_softc *sc;
- register struct tty *tp;
+ struct tty *tp;
unit = DCMUNIT(dev);
board = DCMBOARD(unit);
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);
* 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;
dcmxint(sc, port);
}
+void
dcmrint(sc)
struct dcm_softc *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;
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) &&
#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)
(*linesw[tp->t_line].l_start)(tp);
}
+void
dcmmint(sc, port, mcnd)
struct dcm_softc *sc;
int 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)
int
dcmioctl(dev, cmd, data, flag, p)
dev_t dev;
- int cmd;
+ u_long cmd;
caddr_t data;
int flag;
struct proc *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);
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;
void
dcmstart(tp)
- register struct tty *tp;
+ struct tty *tp;
{
struct dcm_softc *sc;
struct dcmdevice *dcm;
}
#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:
/*
* Stop output on a line.
*/
-void
+int
dcmstop(tp, flag)
- register struct tty *tp;
+ struct tty *tp;
int flag;
{
int s;
tp->t_state |= TS_FLUSH;
}
splx(s);
+ return (0);
}
/*
* Modem control
*/
+int
dcmmctl(dev, bits, how)
dev_t dev;
int bits, how;
/*
* Set board to either interrupt per-character or at a fixed interval.
*/
+void
dcmsetischeme(brd, flags)
int 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++) {
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;
{
struct dcmpreg *pp;
unsigned tail;
- int s, unit, stat;
+ int s, stat;
pp = dcm_preg(dcm_cn, DCMCONSPORT);
-/* $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.
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;
}
char *buf;
size_t buflen;
{
+#ifdef DIOVERBOSE
int i;
+#endif
bzero(buf, buflen);
-/* $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
#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
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
#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()
*/
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");
#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]++;
* 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;
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).
}
#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);
}
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)
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;
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
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);
}
dmatimeout(arg)
void *arg;
{
- register int i, s;
+ int i, s;
struct dma_softc *sc = arg;
for (i = 0; i < NDMACHAN; i++) {
-/* $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
* 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; \
#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; \
-/* $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.
};
#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 */
-/* $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.
#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>
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;
void
fhpibifc(hd)
- register struct fhpibdevice *hd;
+ struct fhpibdevice *hd;
{
hd->hpib_cmd |= CT_IFC;
hd->hpib_cmd |= CT_INITFIFO;
{
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;
{
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;
/*
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;
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;
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) {
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)) {
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;
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) {
/*
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;
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;
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);
}
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;
-/* $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.
*/
#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>
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;
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);
}
#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;
return(error);
}
+int
grfunmap(dev, addr, p)
dev_t dev;
caddr_t addr;
#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? */
#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);
}
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);
* 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) {
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)
#endif
}
+int
grflckmmap(dev, addrp)
dev_t dev;
caddr_t *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;
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);
-/* $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.
* 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>
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
};
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
* 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;
int cmd;
caddr_t data;
{
- register struct dvboxfb *dbp;
+ struct dvboxfb *dbp;
int error = 0;
dbp = (struct dvboxfb *) gp->g_regkva;
void
dvbox_init(ip)
- register struct ite_data *ip;
+ struct ite_data *ip;
{
int i;
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);
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,
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;
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;
-/* $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.
* (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>
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
};
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
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;
gb_microcode(gbp)
struct gboxfb *gbp;
{
- register int i;
+ int i;
for (i = 0; i < CRTC_DATA_LENGTH; i++) {
gbp->crtc_address = i;
*/
int
gb_mode(gp, cmd, data)
- register struct grf_data *gp;
+ struct grf_data *gp;
int cmd;
caddr_t data;
{
void
gbox_init(ip)
- register struct ite_data *ip;
+ struct ite_data *ip;
{
/* XXX */
if (ip->regbase == 0) {
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,
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;
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;
-/* $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.
* 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>
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
};
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
hyper_ite_fontinit(ip)
struct ite_data *ip;
{
- register u_char *fbmem, *dp;
+ u_char *fbmem, *dp;
int c, l, b;
int stride, width;
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;
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 */
}
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
*/
-/* $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.
* 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>
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
};
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
* 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;
*/
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:
rbox_init(ip)
struct ite_data *ip;
{
- register int i;
+ int i;
/* XXX */
if (ip->regbase == 0) {
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,
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;
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;
-/* $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.
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)
-/* $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.
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
};
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;
* 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;
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;
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;
-/* $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.
#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),
-/* $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.
#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>
#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
};
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;
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];
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;
{
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
*/
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",
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 ||
{
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);
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
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;
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;
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;
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);
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
*/
#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++;
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;
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;
#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);
int
hdstatus(rs)
- register struct hd_softc *rs;
+ struct hd_softc *rs;
{
- register int c, s;
+ int c, s;
u_char stat;
int rv;
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;
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
{
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) {
hdsize(dev)
dev_t dev;
{
- register int unit = hdunit(dev);
+ int unit = hdunit(dev);
struct hd_softc *rs;
int psize, didopen = 0;
}
#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))
-/* $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.
*/
#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>
/* 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[],
#ifdef DEBUG
if (hildebug & HDB_FOLLOW)
- printf("hilsoftinit(%d, %x)\n", unit, hilbase);
+ printf("hilsoftinit(%d, %p)\n", unit, hilbase);
#endif
/*
* Initialize loop information
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).
}
/* 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;
}
/* 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;
/*
* 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;
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);
}
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);
break;
case FIONBIO:
- dptr = &hilp->hl_device[device];
+ dptr = &hilp->hl_device[(int)device];
if (*(int *)data)
dptr->hd_flags |= HIL_NOBLOCK;
else
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;
#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;
break;
case FIONBIO:
- dptr = &hilp->hl_device[device];
+ dptr = &hilp->hl_device[(int)device];
if (*(int *)data)
dptr->hd_flags |= HIL_NOBLOCK;
else
#endif
/* ARGSUSED */
+int
hilmmap(dev, off, prot)
dev_t dev;
int off, prot;
{
+ return (-1);
}
/*ARGSUSED*/
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)
}
/*ARGSUSED*/
+void
hilint(unit)
int 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);
#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)
#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;
#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;
* 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;
{
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
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;
* per loop. There may be other keyboards, but they will always be "raw".
*/
+void
kbdbell(unit)
int 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);
send_hil_cmd(hildevice, HIL_INTON, NULL, 0, NULL);
}
+void
kbddisable(unit)
int unit;
{
kbdgetc(statp)
int *statp;
{
- register int c, stat;
+ int c, stat;
int s;
if (hilkbd_cn_device == NULL)
* 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);
/*
* 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.
* 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;
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,
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)
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];
/*
* 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++) {
/*
* XXX map devno as expected by HP-UX
*/
+int
hildevno(dev)
dev_t 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;
{
* 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();
* 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
} 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
}
#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;
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;
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++) {
-/* $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.
* 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 },
};
-/* $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.
#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 */
-/* $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.
#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 *));
void
hpibreset(unit)
- register int unit;
+ int unit;
{
struct hpibbus_softc *sc = hpibbus_cd.cd_devs[unit];
int
hpibpptest(unit, slave)
- register int unit;
+ int unit;
int slave;
{
struct hpibbus_softc *sc = hpibbus_cd.cd_devs[unit];
sc->sc_flags &= ~HPIBF_PPOLL;
}
+void
hpibawait(unit)
int 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;
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);
-/* $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.
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 *));
-/* $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.
#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>
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;
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 {
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;
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;
}
-/* $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.
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 */
};
-/* $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.
#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))
int
iteioctl(dev, cmd, addr, flag, p)
dev_t dev;
- int cmd;
+ u_long cmd;
caddr_t addr;
int flag;
struct proc *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;
splx(s);
}
-void
+int
itestop(tp, flag)
struct tty *tp;
int flag;
{
-
+ return (0);
}
void
{
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)
c &= KBD_CHARMASK;
switch ((stat>>KBD_SSHIFT) & KBD_SMASK) {
-
+ default:
case KBD_KEY:
if (!capsmode) {
code = kbd_keymap[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 {
/* locate the major number */
for (itemaj = 0; itemaj < nchrdev; itemaj++)
if (cdevsw[itemaj].d_open == iteopen)
+ break;
return (itemaj);
}
struct grf_data *gp;
struct itesw *isw;
{
- extern void kbdcninit __P((void)); /* XXX */
struct ite_data *ip = &ite_cn;
/*
itecngetc(dev)
dev_t dev;
{
- register int c;
+ int c;
int stat;
c = kbdgetc(&stat);
-/* $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.
struct ite_data *ip;
u_char *fbmem, *glyphp;
{
- register int bn;
+ int bn;
int l, b;
for (l = 0; l < ip->ftheight; l++) {
-/* $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.
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 */
-/* $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
#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); \
getandputrop(psrc, srcbit, 0, width, pdst, rop)
#define getunalignedword(psrc, x, dst) { \
- register int _tmp; \
+ int _tmp; \
FASTGETBITS(psrc, x, 32, _tmp); \
dst = _tmp; \
}
-/* $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.
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]);
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 ||
*/
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];
}
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);
void *arg;
{
struct mt_softc *sc = arg;
- register struct buf *bp, *dp;
+ struct buf *bp, *dp;
short cmdcount = 1;
u_char cmdbuf[2];
goto fatalerror;
}
timeout(spl_mtintr, sc, 4 * hz);
- hpibawait(sc->sc_hpibno, sc->sc_slave);
+ hpibawait(sc->sc_hpibno);
return;
case MTSET800BPI:
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;
} 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);
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;
(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;
int flag;
struct proc *p;
{
- register struct mtop *op;
+ struct mtop *op;
int cnt;
switch (cmd) {
-/* $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.
#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>
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;
void
nhpibifc(hd)
- register struct nhpibdevice *hd;
+ struct nhpibdevice *hd;
{
hd->hpib_acr = AUX_TCA;
hd->hpib_acr = AUX_CSRE;
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;
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);
-/* $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.
#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>
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 ||
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
#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);
#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));
}
#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));
}
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;
#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
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;
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
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;
int h;
{
extern int hz;
- register int m = h;
+ int m = h;
if (m > 0)
m = m * 1000 / hz;
int m;
{
extern int hz;
- register int h = m;
+ int h = m;
if (h > 0) {
h = h * hz / 1000;
-/* $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.
#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>
#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 */
#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
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;
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;
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. */
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)
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);
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))
static int
wait_for_select(hd)
- volatile register struct scsidevice *hd;
+ volatile struct scsidevice *hd;
{
u_char ints;
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;
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) {
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) {
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) {
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))
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;
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;
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;
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
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);
}
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);
}
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;
*/
phase = CMD_PHASE;
while (1) {
- register int wait = scsi_cmd_wait;
+ int wait = scsi_cmd_wait;
switch (phase) {
#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
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)
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);
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
*/
if (freedma) {
hs->sc_flags &=~ SCSI_HAVEDMA;
- dmafree(hs->sc_dq);
+ dmafree(&hs->sc_dq);
}
/*
* Initialize command block
* 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);
}
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;
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) {
-/* $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.
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
-/* $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.
#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
#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 *));
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
#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"
/*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).
*/
} 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;
void
sdreset(sc)
- register struct sd_softc *sc;
+ struct sd_softc *sc;
{
sc->sc_stats.sdresets++;
}
{
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;
{
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;
int flags, mode;
struct proc *p;
{
- register int unit = sdunit(dev);
+ int unit = sdunit(dev);
struct sd_softc *sc;
int error, mask, part;
{
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);
*/
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 */
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++;
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);
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 {
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
}
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
}
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) {
void
sdustart(unit)
- register int unit;
+ int unit;
{
struct sd_softc *sc = sd_cd.cd_devs[unit];
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;
* 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) {
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;
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++;
}
#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,
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) {
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
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)
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)
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) {
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;
int unit, part;
struct sd_softc *sc;
struct disklabel *lp;
- daddr_t baddr;
char stat;
/* Check for recursive dump; if so, punt. */
-/* $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
#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 */
-/* $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.
#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 };
/* 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;
return (1);
}
-void
+static void
stattach(parent, self, aux)
struct device *parent, *self;
void *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;
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 ||
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;
}
}
/*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)) {
/*
void
ststrategy(bp)
- register struct buf *bp;
+ struct buf *bp;
{
struct st_softc *sc;
struct buf *dp;
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;
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,
}
}
+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;
}
/*ARGSUSED*/
+int
stdump(dev)
dev_t 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) {
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) {
*/
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;
*/
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;
*/
#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
}
#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 */
}
#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.
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;
sc->sc_flags &= ~(STF_CMD|STF_WRTTN);
}
+static void
sterror(sc, stat)
struct st_softc *sc;
int 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:
}
#ifdef DEBUG
-
+void
dumpxsense(sensebuf)
struct st_xsense *sensebuf;
{
(xp->exb_xsense.tplft0)) );
}
+void
prtmodsel(msd, modlen)
struct mode_select_data *msd;
int modlen;
msd->vupb,msd->rsvd5,msd->p5,msd->motionthres,msd->reconthres,msd->gapthres);
}
+void
prtmodstat(mode)
struct mode_sense *mode;
{
-/* $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.
/*
* stvar.h scsi tape driver
*/
-
struct exb_xsense {
u_char reserved8;
u_char reserved9;
"\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 */
-/* $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.
#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>
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.
panic("no mainbus found");
(void)spl0();
- isrprintlevels();
+ intr_printlevels();
/*
* Find boot device.
-/* $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.
*/
#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
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.
* 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];
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;
*/
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,
* Initialize the time of day register, based on the time base which is, e.g.
* from a filesystem.
*/
+void
inittodr(base)
time_t 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);
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;
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();
return(1);
}
+void
read_bbc()
{
- register int i, read_okay;
+ int i, read_okay;
read_okay = 0;
while (!read_okay) {
-/* $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.
/*
* Returns true if dev is /dev/mem or /dev/kmem.
*/
+int
iskmemdev(dev)
dev_t dev;
{
/*
* Returns true if dev is /dev/zero.
*/
+int
iszerodev(dev)
dev_t dev;
{
/*
* Convert a character device number to a block device number.
*/
+dev_t
chrtoblk(dev)
dev_t dev;
{
-/* $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.
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);
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;
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)) {
-/* $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
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/buf.h>
+#include <sys/disk.h>
#include <sys/disklabel.h>
#include <sys/syslog.h>
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;
*/
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)
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;
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 *)
-/* $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
#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++) {
-/* $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.
#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>
#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>
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);
}
/*
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);
{
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)
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;
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[];
#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) {
}
#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
/*
#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
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;
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);
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
* the sigcontext structure.
*/
if (flags & HSS_RTEFRAME) {
- register int sz;
+ int sz;
/* grab frame type and validate */
sz = tstate.hss_frame.f_format;
#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
}
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))
*/
void
hpux_setregs(p, pack, stack, retval)
- register struct proc *p;
+ struct proc *p;
struct exec_package *pack;
u_long stack;
register_t *retval;
--- /dev/null
+/* $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, 1997 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Adam Glass, Gordon W. Ross, 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.
+ */
+
+/*
+ * 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 <machine/intr.h>
+
+typedef LIST_HEAD(, isr) isr_list_t;
+isr_list_t isr_list[NISR];
+
+u_short hp300_bioipl, hp300_netipl, hp300_ttyipl, hp300_impipl;
+
+extern int intrcnt[]; /* from locore.s */
+
+void intr_computeipl __P((void));
+
+void
+intr_init()
+{
+ int i;
+
+ /* Initialize the ISR lists. */
+ for (i = 0; i < NISR; ++i)
+ LIST_INIT(&isr_list[i]);
+
+ /* Default interrupt priorities. */
+ hp300_bioipl = hp300_netipl = hp300_ttyipl = hp300_impipl =
+ (PSL_S|PSL_IPL3);
+}
+
+/*
+ * Scan all of the ISRs, recomputing the interrupt levels for the spl*()
+ * calls. This doesn't have to be fast.
+ */
+void
+intr_computeipl()
+{
+ struct isr *isr;
+ int ipl;
+
+ /* Start with low values. */
+ hp300_bioipl = hp300_netipl = hp300_ttyipl = hp300_impipl =
+ (PSL_S|PSL_IPL3);
+
+ for (ipl = 0; ipl < NISR; ipl++) {
+ for (isr = isr_list[ipl].lh_first; isr != NULL;
+ isr = isr->isr_link.le_next) {
+ /*
+ * Bump up the level for a given priority,
+ * if necessary.
+ */
+ switch (isr->isr_priority) {
+ case IPL_BIO:
+ if (ipl > PSLTOIPL(hp300_bioipl))
+ hp300_bioipl = IPLTOPSL(ipl);
+ break;
+
+ case IPL_NET:
+ if (ipl > PSLTOIPL(hp300_netipl))
+ hp300_netipl = IPLTOPSL(ipl);
+ break;
+
+ 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("intr_computeipl: bad priority");
+ }
+ }
+ }
+
+ /*
+ * Enforce `bio <= net <= tty <= imp'
+ */
+
+ if (hp300_netipl < hp300_bioipl)
+ hp300_netipl = hp300_bioipl;
+
+ if (hp300_ttyipl < hp300_netipl)
+ hp300_ttyipl = hp300_netipl;
+
+ if (hp300_impipl < hp300_ttyipl)
+ hp300_impipl = hp300_ttyipl;
+}
+
+void
+intr_printlevels()
+{
+
+#ifdef DEBUG
+ printf("psl: bio = 0x%x, net = 0x%x, tty = 0x%x, imp = 0x%x\n",
+ hp300_bioipl, hp300_netipl, hp300_ttyipl, hp300_impipl);
+#endif
+
+ printf("interrupt levels: bio = %d, net = %d, tty = %d\n",
+ PSLTOIPL(hp300_bioipl), PSLTOIPL(hp300_netipl),
+ PSLTOIPL(hp300_ttyipl));
+}
+
+/*
+ * Establish an interrupt handler.
+ * Called by driver attach functions.
+ */
+void *
+intr_establish(func, arg, ipl, priority)
+ int (*func) __P((void *));
+ void *arg;
+ int ipl;
+ int priority;
+{
+ struct isr *newisr, *curisr;
+ isr_list_t *list;
+
+ if ((ipl < 0) || (ipl >= NISR))
+ panic("intr_establish: bad ipl %d", ipl);
+
+ newisr = (struct isr *)malloc(sizeof(struct isr), M_DEVBUF, M_NOWAIT);
+ if (newisr == NULL)
+ panic("intr_establish: can't allocate space for isr");
+
+ /* Fill in the new entry. */
+ newisr->isr_func = func;
+ newisr->isr_arg = arg;
+ newisr->isr_ipl = ipl;
+ newisr->isr_priority = priority;
+
+ /*
+ * Some devices are particularly sensitive to interrupt
+ * handling latency. The DCA, for example, can lose many
+ * characters if its interrupt isn't handled with reasonable
+ * speed.
+ *
+ * To work around this problem, each device can give itself a
+ * "priority". An unbuffered DCA would give itself a higher
+ * priority than a SCSI device, for example.
+ *
+ * This is necessary because of the flat spl scheme employed by
+ * the hp300. Each device can be set from ipl 3 to ipl 5, which
+ * in turn means that splbio, splnet, and spltty must all be at
+ * spl5.
+ *
+ * Don't blame me...I just work here.
+ */
+
+ /*
+ * Get the appropriate ISR list. If the list is empty, no
+ * additional work is necessary; we simply insert ourselves
+ * at the head of the list.
+ */
+ list = &isr_list[ipl];
+ if (list->lh_first == NULL) {
+ LIST_INSERT_HEAD(list, newisr, isr_link);
+ goto compute;
+ }
+
+ /*
+ * A little extra work is required. We traverse the list
+ * and place ourselves after any ISRs with our current (or
+ * higher) priority.
+ */
+ for (curisr = list->lh_first; curisr->isr_link.le_next != NULL;
+ curisr = curisr->isr_link.le_next) {
+ if (newisr->isr_priority > curisr->isr_priority) {
+ LIST_INSERT_BEFORE(curisr, newisr, isr_link);
+ goto compute;
+ }
+ }
+
+ /*
+ * We're the least important entry, it seems. We just go
+ * on the end.
+ */
+ LIST_INSERT_AFTER(curisr, newisr, isr_link);
+
+ compute:
+ /* Compute new interrupt levels. */
+ intr_computeipl();
+ return (newisr);
+}
+
+/*
+ * Disestablish an interrupt handler.
+ */
+void
+intr_disestablish(arg)
+ void *arg;
+{
+ struct isr *isr = arg;
+
+ LIST_REMOVE(isr, isr_link);
+ free(isr, M_DEVBUF);
+ intr_computeipl();
+}
+
+/*
+ * This is the dispatcher called by the low-level
+ * assembly language interrupt routine.
+ */
+void
+intr_dispatch(evec)
+ int evec; /* format | vector offset */
+{
+ struct isr *isr;
+ isr_list_t *list;
+ int handled, ipl, vec;
+ static int straycount, unexpected;
+
+ vec = (evec & 0xfff) >> 2;
+ if ((vec < ISRLOC) || (vec >= (ISRLOC + NISR)))
+ panic("isrdispatch: bad vec 0x%x\n", vec);
+ ipl = vec - ISRLOC;
+
+ intrcnt[ipl]++;
+ cnt.v_intr++;
+
+ list = &isr_list[ipl];
+ if (list->lh_first == NULL) {
+ printf("intr_dispatch: ipl %d unexpected\n", ipl);
+ if (++unexpected > 10)
+ 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);
+
+ if (handled)
+ straycount = 0;
+ else if (++straycount > 50)
+ panic("intr_dispatch: too many stray interrupts");
+ else
+ 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()
+{
+#ifdef INET
+ if (netisr & (1 << NETISR_ARP)) {
+ netisr &= ~(1 << NETISR_ARP);
+ arpintr();
+ }
+ if (netisr & (1 << NETISR_IP)) {
+ netisr &= ~(1 << NETISR_IP);
+ 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);
+ nsintr();
+ }
+#endif
+#ifdef ISO
+ if (netisr & (1 << NETISR_ISO)) {
+ netisr &= ~(1 << NETISR_ISO);
+ clnlintr();
+ }
+#endif
+#ifdef CCITT
+ if (netisr & (1 << NETISR_CCITT)) {
+ netisr &= ~(1 << NETISR_CCITT);
+ ccittintr();
+ }
+#endif
+#include "ppp.h"
+#if NPPP > 0
+ if (netisr & (1 << NETISR_PPP)) {
+ netisr &= ~(1 << NETISR_PPP);
+ pppintr();
+ }
+#endif
+}
+++ /dev/null
-/* $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 $ */
-
-/*-
- * Copyright (c) 1996 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Adam Glass, Gordon W. Ross, 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.
- */
-
-/*
- * Link and dispatch interrupts.
- */
-
-#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>
-
-typedef LIST_HEAD(, isr) isr_list_t;
-isr_list_t isr_list[NISR];
-
-u_short hp300_bioipl, hp300_netipl, hp300_ttyipl, hp300_impipl;
-
-extern int intrcnt[]; /* from locore.s */
-
-void isrcomputeipl __P((void));
-
-void
-isrinit()
-{
- int i;
-
- /* Initialize the ISR lists. */
- for (i = 0; i < NISR; ++i) {
- LIST_INIT(&isr_list[i]);
- }
-
- /* Default interrupt priorities. */
- hp300_bioipl = hp300_netipl = hp300_ttyipl = hp300_impipl =
- (PSL_S|PSL_IPL3);
-}
-
-/*
- * Scan all of the ISRs, recomputing the interrupt levels for the spl*()
- * calls. This doesn't have to be fast.
- */
-void
-isrcomputeipl()
-{
- struct isr *isr;
- int ipl;
-
- /* Start with low values. */
- hp300_bioipl = hp300_netipl = hp300_ttyipl = hp300_impipl =
- (PSL_S|PSL_IPL3);
-
- for (ipl = 0; ipl < NISR; ipl++) {
- for (isr = isr_list[ipl].lh_first; isr != NULL;
- isr = isr->isr_link.le_next) {
- /*
- * Bump up the level for a given priority,
- * if necessary.
- */
- switch (isr->isr_priority) {
- case ISRPRI_BIO:
- if (ipl > PSLTOIPL(hp300_bioipl))
- hp300_bioipl = IPLTOPSL(ipl);
- break;
-
- case ISRPRI_NET:
- if (ipl > PSLTOIPL(hp300_netipl))
- hp300_netipl = IPLTOPSL(ipl);
- break;
-
- case ISRPRI_TTY:
- case ISRPRI_TTYNOBUF:
- if (ipl > PSLTOIPL(hp300_ttyipl))
- hp300_ttyipl = IPLTOPSL(ipl);
- break;
-
- default:
- printf("priority = %d\n", isr->isr_priority);
- panic("isrcomputeipl: bad priority");
- }
- }
- }
-
- /*
- * Enforce `bio <= net <= tty <= imp'
- */
-
- if (hp300_netipl < hp300_bioipl)
- hp300_netipl = hp300_bioipl;
-
- if (hp300_ttyipl < hp300_netipl)
- hp300_ttyipl = hp300_netipl;
-
- if (hp300_impipl < hp300_ttyipl)
- hp300_impipl = hp300_ttyipl;
-}
-
-void
-isrprintlevels()
-{
-
-#ifdef DEBUG
- printf("psl: bio = 0x%x, net = 0x%x, tty = 0x%x, imp = 0x%x\n",
- hp300_bioipl, hp300_netipl, hp300_ttyipl, hp300_impipl);
-#endif
-
- printf("interrupt levels: bio = %d, net = %d, tty = %d\n",
- PSLTOIPL(hp300_bioipl), PSLTOIPL(hp300_netipl),
- PSLTOIPL(hp300_ttyipl));
-}
-
-/*
- * Establish an interrupt handler.
- * Called by driver attach functions.
- */
-void *
-isrlink(func, arg, ipl, priority)
- int (*func) __P((void *));
- void *arg;
- int ipl;
- int priority;
-{
- struct isr *newisr, *curisr;
- isr_list_t *list;
-
- if ((ipl < 0) || (ipl >= NISR))
- panic("isrlink: 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");
-
- /* Fill in the new entry. */
- newisr->isr_func = func;
- newisr->isr_arg = arg;
- newisr->isr_ipl = ipl;
- newisr->isr_priority = priority;
-
- /*
- * Some devices are particularly sensitive to interrupt
- * handling latency. The DCA, for example, can lose many
- * characters if its interrupt isn't handled with reasonable
- * speed.
- *
- * To work around this problem, each device can give itself a
- * "priority". An unbuffered DCA would give itself a higher
- * priority than a SCSI device, for example.
- *
- * This is necessary because of the flat spl scheme employed by
- * the hp300. Each device can be set from ipl 3 to ipl 5, which
- * in turn means that splbio, splnet, and spltty must all be at
- * spl5.
- *
- * Don't blame me...I just work here.
- */
-
- /*
- * Get the appropriate ISR list. If the list is empty, no
- * additional work is necessary; we simply insert ourselves
- * at the head of the list.
- */
- list = &isr_list[ipl];
- if (list->lh_first == NULL) {
- LIST_INSERT_HEAD(list, newisr, isr_link);
- goto compute;
- }
-
- /*
- * A little extra work is required. We traverse the list
- * and place ourselves after any ISRs with our current (or
- * higher) priority.
- */
- for (curisr = list->lh_first; curisr->isr_link.le_next != NULL;
- curisr = curisr->isr_link.le_next) {
- if (newisr->isr_priority > curisr->isr_priority) {
- LIST_INSERT_BEFORE(curisr, newisr, isr_link);
- goto compute;
- }
- }
-
- /*
- * We're the least important entry, it seems. We just go
- * on the end.
- */
- LIST_INSERT_AFTER(curisr, newisr, isr_link);
-
- compute:
- /* Compute new interrupt levels. */
- isrcomputeipl();
- return (newisr);
-}
-
-/*
- * Disestablish an interrupt handler.
- */
-void
-isrunlink(arg)
- void *arg;
-{
- struct isr *isr = arg;
-
- LIST_REMOVE(isr, isr_link);
- free(isr, M_DEVBUF);
- isrcomputeipl();
-}
-
-/*
- * This is the dispatcher called by the low-level
- * assembly language interrupt routine.
- */
-void
-isrdispatch(evec)
- int evec; /* format | vector offset */
-{
- struct isr *isr;
- isr_list_t *list;
- int handled, ipl, vec;
- static int straycount, unexpected;
-
- vec = (evec & 0xfff) >> 2;
- if ((vec < ISRLOC) || (vec >= (ISRLOC + NISR)))
- panic("isrdispatch: bad vec 0x%x\n");
- ipl = vec - ISRLOC;
-
- intrcnt[ipl]++;
- cnt.v_intr++;
-
- list = &isr_list[ipl];
- if (list->lh_first == NULL) {
- printf("intrhand: ipl %d unexpected\n", ipl);
- if (++unexpected > 10)
- panic("isrdispatch: too many unexpected interrupts");
- return;
- }
-
- /* 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);
-
- if (handled)
- straycount = 0;
- else if (++straycount > 50)
- panic("isrdispatch: too many stray interrupts");
- else
- printf("isrdispatch: stray level %d interrupt\n", ipl);
-}
-
-/*
- * XXX Why on earth isn't this in a common file?!
- */
-void
-netintr()
-{
-#ifdef INET
- if (netisr & (1 << NETISR_ARP)) {
- netisr &= ~(1 << NETISR_ARP);
- arpintr();
- }
- if (netisr & (1 << NETISR_IP)) {
- netisr &= ~(1 << NETISR_IP);
- ipintr();
- }
-#endif
-#ifdef NS
- if (netisr & (1 << NETISR_NS)) {
- netisr &= ~(1 << NETISR_NS);
- nsintr();
- }
-#endif
-#ifdef ISO
- if (netisr & (1 << NETISR_ISO)) {
- netisr &= ~(1 << NETISR_ISO);
- clnlintr();
- }
-#endif
-#ifdef CCITT
- if (netisr & (1 << NETISR_CCITT)) {
- netisr &= ~(1 << NETISR_CCITT);
- ccittintr();
- }
-#endif
-#include "ppp.h"
-#if NPPP > 0
- if (netisr & (1 << NETISR_PPP)) {
- netisr &= ~(1 << NETISR_PPP);
- pppintr();
- }
-#endif
-}
+++ /dev/null
-/* $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 $ */
-
-/*-
- * Copyright (c) 1996 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.
- */
-
-#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;
-};
-
-/*
- * 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
-
-/*
- * Convert PSL values to IPLs and vice-versa.
- */
-#define PSLTOIPL(x) (((x) >> 8) & 0xf)
-#define IPLTOPSL(x) ((((x) & 0xf) << 8) | PSL_S)
-
-void isrinit __P((void));
-void *isrlink __P((int (*)(void *), void *, int, int));
-void isrunlink __P((void *));
-void isrdispatch __P((int));
-void isrprintlevels __P((void));
-/* $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
#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
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));
-/* $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
*/
#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>
*/
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);
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;
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++;
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];
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);
-/* $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 $ */
/*
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
/*
#define INTERRUPT_RESTOREREG moveml sp@+,#0x0303
/* Externs. */
- .globl _hilint, _isrdispatch, _nmihand
+ .globl _hilint, _intr_dispatch, _nmihand
.globl _hardclock, _statintr
_spurintr: /* Level 0 */
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
-/* $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.
#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>
#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" */
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;
#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);
*/
caddr_t
allocsys(v)
- register caddr_t v;
+ caddr_t v;
{
#define valloc(name, type, num) \
*/
void
setregs(p, pack, stack, retval)
- register struct proc *p;
+ struct proc *p;
struct exec_package *pack;
u_long stack;
register_t *retval;
#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:
}
#ifdef USELEDS
-#include <hp300/hp300/led.h>
-
int inledcontrol = 0; /* 1 if we are in ledcontrol already, cheap mutex */
char *ledaddr;
*/
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;
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) {
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;
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;
int
badaddr(addr)
- register caddr_t addr;
+ caddr_t addr;
{
- register int i;
+ int i;
label_t faultbuf;
nofault = (int *) &faultbuf;
int
badbaddr(addr)
- register caddr_t addr;
+ caddr_t addr;
{
- register int i;
+ int i;
label_t faultbuf;
nofault = (int *) &faultbuf;
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
-/* $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.
*/
#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>
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)
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;
-/* $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
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));
#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
#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
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
#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
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)
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) {
#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) {
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
/*
*/
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
/*
*/
void
pmap_destroy(pmap)
- register pmap_t pmap;
+ pmap_t pmap;
{
int count;
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_destroy(%x)\n", pmap);
+ printf("pmap_destroy(%p)\n", pmap);
#endif
simple_lock(&pmap->pm_lock);
*/
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 */
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_reference(%x)\n", pmap);
+ printf("pmap_reference(%p)\n", pmap);
#endif
simple_lock(&pmap->pm_lock);
void
pmap_activate(pmap, pcb)
- register pmap_t pmap;
+ pmap_t pmap;
struct pcb *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);
void
pmap_deactivate(pmap, pcb)
- register pmap_t pmap;
+ pmap_t pmap;
struct pcb *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)
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;
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
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
}
*/
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)
*/
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)
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
/*
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
* 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
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
/*
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;
(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;
*/
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;
*/
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;
}
/*
*/
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
/*
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))
pa = (pa & PG_FRAME) | (va & ~PG_FRAME);
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("%x\n", pa);
+ printf("%lx\n", pa);
#endif
return(pa);
}
{
#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
}
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
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
#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;
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;
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
}
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);
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;
{
#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
/*
* - 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))
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;
}
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);
{
#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);
}
{
#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);
}
#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
#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
* 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;
#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));
/* 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;
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
*/
#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;
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);
#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)
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))
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,
/* 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)
/* 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;
#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)
* 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);
/* 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++;
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
}
*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);
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
}
* 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) {
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
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);
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
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)
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
/*
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
}
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");
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) ||
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;
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
-/* $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
#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))
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:
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:
* 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
* absolute "jmp" table.
*/
{
- register int *kp;
+ int *kp;
kp = &RELOC(protection_codes, int);
kp[VM_PROT_NONE|VM_PROT_NONE|VM_PROT_NONE] = 0;
* 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),
-/* $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
void *v;
register_t *retval;
{
- register struct sys_vtrace_args /* {
+ struct sys_vtrace_args /* {
syscallarg(int) request;
syscallarg(int) value;
} */ *uap = v;
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)
* do pages, above that we do the entire cache.
*/
/*ARGSUSED1*/
+int
cachectl(req, addr, len)
int req;
caddr_t addr;
#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;
#endif
if (addr == 0 ||
- (req & ~CC_EXTPURGE) != CC_PURGE && len > 2*NBPG)
+ ((req & ~CC_EXTPURGE) != CC_PURGE && len > 2*NBPG))
doall = 1;
if (!doall) {
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... */
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
void *v;
register_t *retval;
{
+#if 0 /* unused */
struct sys_sysarch_args /* {
syscallarg(int) op;
syscallarg(char *) parms;
} */ *uap = v;
+#endif
return ENOSYS;
}
-/* $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
#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;
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));
*/
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;
"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,
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++;
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");
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;
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();
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;
#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);
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
/*
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);
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;
* 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))
#ifdef DEBUG
void
dumpssw(ssw)
- register u_short ssw;
+ u_short ssw;
{
printf(" SSW: %x: ", ssw);
if (ssw & SSW4_CP)
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",
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
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];
-/* $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.
#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
*/
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;
*/
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)
* 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;
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--)
* Look at _lev6intr in locore.s for more details.
*/
/*ARGSUSED*/
+void
setredzone(pte, vaddr)
pt_entry_t *pte;
caddr_t vaddr;
/*
* Convert kernel VA to physical address
*/
+int
kvtop(addr)
- register caddr_t addr;
+ caddr_t addr;
{
vm_offset_t va;
/*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");
/*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)
-/* $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.
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));
-/* $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.
*/
#include <m68k/cpu.h>
+/*
+ * Get interrupt glue.
+ */
+#include <machine/intr.h>
+
/*
* definitions of cpu-dependent requirements
* referenced in generic code
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.
*/
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));
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()
-/* $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.
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 *));
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_ */
--- /dev/null
+/* $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_ */
-/* $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.
#define MACHINE_ARCH "m68k"
#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
#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
-# $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
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
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}/../../..
-/* $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.
struct dcmdevice *dcmcnaddr = NULL;
-#define DCMCONUNIT 0 /* XXX */
+#define DCMCONUNIT 1 /* XXX */
void
dcmprobe(cp)
}
dcmcnaddr = (struct dcmdevice *) hw->hw_kva;
+#ifdef FORCEDCMCONSOLE
+ cp->cn_pri = CN_REMOTE;
+#else
dcm = dcmcnaddr;
switch (dcm->dcm_rsid) {
case DCMID:
}
curcons_scode = hw->hw_sc;
+#endif
}
void
--- /dev/null
+/* $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 */
-/* $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.
*/
/*
- * 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 */
#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,
'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,
'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,
};
#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,
'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,
'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,
* 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)
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;
}
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;
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);
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 */
--- /dev/null
+/* $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 */
--- /dev/null
+/* $OpenBSD: kbdconf.c,v 1.1 1997/04/16 11:56:39 downsj Exp $ */
+/* $NetBSD: kbdconf.c,v 1.1 1997/04/14 19:00:12 thorpej Exp $ */
+
+/*-
+ * Copyright (c) 1997 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Keyboard support configuration.
+ */
+
+#ifdef ITECONSOLE
+
+#include <sys/param.h>
+
+#include "samachdep.h"
+#include "kbdvar.h"
+
+#ifndef SMALL
+
+/*
+ * Note, these are arranged in order of preference. The first `init'
+ * routine to report success gets to play.
+ */
+struct kbdsw kbdsw[] = {
+#ifdef HIL_KEYBOARD
+ { hilkbd_getc, hilkbd_nmi, hilkbd_init },
+#endif
+#ifdef DOMAIN_KEYBOARD
+ { dnkbd_getc, dnkbd_nmi, dnkbd_init },
+#endif
+ { NULL, NULL, NULL },
+};
+
+#endif /* SMALL */
+
+#endif /* ITECONSOLE */
--- /dev/null
+/* $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 */