summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-06-12 08:20:42 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-06-12 08:20:42 +0000
commit236da5677a53227c6dc184858a2be53b81172be7 (patch)
tree385c682161e720b25661ef31e2aabeba47d61b4f /sys/arch
parent6b4b1e72e45a98113890e3f1772545351866c016 (diff)
sync to 0611
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/vax/conf/GENERIC4
-rw-r--r--sys/arch/vax/conf/Makefile.vax7
-rw-r--r--sys/arch/vax/conf/files.vax12
-rw-r--r--sys/arch/vax/if/if_de.c86
-rw-r--r--sys/arch/vax/if/if_qe.c70
-rw-r--r--sys/arch/vax/include/cdefs.h2
-rw-r--r--sys/arch/vax/include/cpu.h7
-rw-r--r--sys/arch/vax/include/disklabel.h2
-rw-r--r--sys/arch/vax/include/exec.h6
-rw-r--r--sys/arch/vax/include/ka650.h6
-rw-r--r--sys/arch/vax/include/ka750.h4
-rw-r--r--sys/arch/vax/include/profile.h2
-rw-r--r--sys/arch/vax/include/types.h2
-rw-r--r--sys/arch/vax/include/uvaxII.h4
-rw-r--r--sys/arch/vax/mba/hp.c3
-rw-r--r--sys/arch/vax/uba/dhu.c443
-rw-r--r--sys/arch/vax/uba/ubareg.h2
-rw-r--r--sys/arch/vax/uba/ubavar.h2
-rw-r--r--sys/arch/vax/uba/uda.c37
-rw-r--r--sys/arch/vax/vax/autoconf.c79
-rw-r--r--sys/arch/vax/vax/clock.c3
-rw-r--r--sys/arch/vax/vax/conf.c9
-rw-r--r--sys/arch/vax/vax/disksubr.c3
-rw-r--r--sys/arch/vax/vax/locore.c4
-rw-r--r--sys/arch/vax/vax/machdep.c11
-rw-r--r--sys/arch/vax/vax/pmap.c4
-rw-r--r--sys/arch/vax/vax/trap.c3
-rw-r--r--sys/arch/vax/vax/vm_machdep.c4
28 files changed, 401 insertions, 420 deletions
diff --git a/sys/arch/vax/conf/GENERIC b/sys/arch/vax/conf/GENERIC
index 03306e42244..280834627a6 100644
--- a/sys/arch/vax/conf/GENERIC
+++ b/sys/arch/vax/conf/GENERIC
@@ -1,5 +1,4 @@
-# $OpenBSD: GENERIC,v 1.3 1996/05/03 09:09:08 mickey Exp $
-# $NetBSD: GENERIC,v 1.12 1996/03/17 22:56:29 ragge Exp $
+# $NetBSD: GENERIC,v 1.13 1996/05/19 16:25:23 ragge Exp $
#
# GENERIC VAX configuration file; all supported devices.
#
@@ -103,6 +102,7 @@ ts0 at uba? csr 0172520 # TS11/TSV05 tape.
# Terminal lines
dhu0 at uba? csr 0160440 # DHU-11
+dz0 at uba? csr 0160100 # DZ-11
pseudo-device loop 1
pseudo-device pty 48
diff --git a/sys/arch/vax/conf/Makefile.vax b/sys/arch/vax/conf/Makefile.vax
index 72e75036bef..4d8b0eff776 100644
--- a/sys/arch/vax/conf/Makefile.vax
+++ b/sys/arch/vax/conf/Makefile.vax
@@ -1,7 +1,6 @@
-# $OpenBSD: Makefile.vax,v 1.3 1996/05/03 09:09:08 mickey Exp $
-# $NetBSD: Makefile.vax,v 1.20 1996/02/29 20:57:46 cgd Exp $
+# $Bsd: Makefile.vax,v 1.21 1996/05/11 16:13:17 mycroft Exp $
-# Makefile for OpenBSD
+# Makefile for Bsd
#
# This makefile is constructed from a machine description:
# config machineid
@@ -139,7 +138,7 @@ links:
SRCS= ${VAX}/vax/intvec.s ${VAX}/vax/subr.s lim.c \
param.c ioconf.c ${CFILES} ${SFILES}
-depend: .depend
+depend:: .depend
.depend: ${SRCS} param.c
mkdep ${AFLAGS} ${CPPFLAGS} ${VAX}/vax/intvec.s ${VAX}/vax/subr.s
mkdep -a ${CFLAGS} ${CPPFLAGS} lim.c
diff --git a/sys/arch/vax/conf/files.vax b/sys/arch/vax/conf/files.vax
index 92394880176..b9176eabbd5 100644
--- a/sys/arch/vax/conf/files.vax
+++ b/sys/arch/vax/conf/files.vax
@@ -1,4 +1,4 @@
-# $NetBSD: files.vax,v 1.18 1996/03/17 22:56:30 ragge Exp $
+# $NetBSD: files.vax,v 1.19 1996/05/19 16:25:29 ragge Exp $
#
# new style config file for vax architecture
#
@@ -79,6 +79,11 @@ device dhu
attach dhu at uba
file arch/vax/uba/dhu.c dhu needs-count
+# DZ11 at UBA
+device dz
+attach dz at uba
+file arch/vax/uba/dz.c dz needs-count
+
# These devices aren't tested (or even compiled!)
# They are just included here to make some files happy ;)
#
@@ -129,11 +134,6 @@ device dn
attach dn at uba
file arch/vax/uba/dn.c dn needs-count
-# DZ11 at UBA
-device dz
-attach dz at uba
-file arch/vax/uba/dz.c dz needs-count
-
# IDC (RB730) on UBA (VAX 11/730)
device idc { drive=-1 }
attach idc at uba
diff --git a/sys/arch/vax/if/if_de.c b/sys/arch/vax/if/if_de.c
index 9e40f50cddf..32098cb08b0 100644
--- a/sys/arch/vax/if/if_de.c
+++ b/sys/arch/vax/if/if_de.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_de.c,v 1.19 1996/04/08 18:34:54 ragge Exp $ */
+/* $NetBSD: if_de.c,v 1.21 1996/05/19 16:43:02 ragge Exp $ */
/*
* Copyright (c) 1982, 1986, 1989 Regents of the University of California.
@@ -71,6 +71,11 @@
#include <netinet/if_ether.h>
#endif
+#ifdef NS
+#include <netns/ns.h>
+#include <netns/ns_if.h>
+#endif
+
#ifdef ISO
#include <netiso/iso.h>
#include <netiso/iso_var.h>
@@ -103,7 +108,7 @@ int dedebug = 0;
* efficiently.
*/
struct de_softc {
- struct device ds_device; /* Configuration common part */
+ struct device ds_dev; /* Configuration common part */
struct arpcom ds_ac; /* Ethernet common part */
struct dedevice *ds_vaddr; /* Virtual address of this interface */
#define ds_if ds_ac.ac_if /* network-visible interface */
@@ -138,13 +143,13 @@ struct de_softc {
int dematch __P((struct device *, void *, void *));
void deattach __P((struct device *, struct device *, void *));
int dewait __P((struct de_softc *, char *));
-void deinit __P((int));
+void deinit __P((struct de_softc *));
int deioctl __P((struct ifnet *, u_long, caddr_t));
void dereset __P((int));
void destart __P((struct ifnet *));
void deread __P((struct de_softc *, struct ifrw *, int));
void derecv __P((int));
-void de_setaddr __P((u_char *, int));
+void de_setaddr __P((u_char *, struct de_softc *));
void deintr __P((int));
@@ -165,17 +170,17 @@ deattach(parent, self, aux)
struct device *parent, *self;
void *aux;
{
- struct uba_attach_args *ua = aux;
+ struct uba_attach_args *ua = aux;
struct de_softc *ds = (struct de_softc *)self;
struct ifnet *ifp = &ds->ds_if;
struct dedevice *addr;
+ char *c;
int csr1;
- printf("\n");
addr = (struct dedevice *)ua->ua_addr;
ds->ds_vaddr = addr;
- ifp->if_unit = ds->ds_device.dv_unit;
- ifp->if_name = "de";
+ bcopy(ds->ds_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
+ ifp->if_softc = ds;
ifp->if_flags = IFF_BROADCAST | IFF_NOTRAILERS;
/*
@@ -185,12 +190,13 @@ deattach(parent, self, aux)
*/
csr1 = addr->pcsr1;
if (csr1 & 0xff60)
- printf("de%d: broken\n", ds->ds_device.dv_unit);
+ c = "broken";
else if (csr1 & 0x10)
- printf("de%d: delua\n", ds->ds_device.dv_unit);
+ c = "delua";
else
- printf("de%d: deuna\n", ds->ds_device.dv_unit);
+ c = "deuna";
+ printf("\n%s: %s\n", ds->ds_dev.dv_xname, c);
/*
* Reset the board and temporarily map
* the pcbb buffer onto the Unibus.
@@ -200,7 +206,7 @@ deattach(parent, self, aux)
addr->pcsr0 = PCSR0_RSET;
(void)dewait(ds, "reset");
- ds->ds_ubaddr = uballoc(ds->ds_device.dv_parent->dv_unit,
+ ds->ds_ubaddr = uballoc(ds->ds_dev.dv_parent->dv_unit,
(char *)&ds->ds_pcbb, sizeof (struct de_pcbb), 0);
addr->pcsr2 = ds->ds_ubaddr & 0xffff;
addr->pcsr3 = (ds->ds_ubaddr >> 16) & 0x3;
@@ -211,10 +217,10 @@ deattach(parent, self, aux)
addr->pclow = CMD_GETCMD;
(void)dewait(ds, "read addr ");
- ubarelse(ds->ds_device.dv_parent->dv_unit, &ds->ds_ubaddr);
+ ubarelse(ds->ds_dev.dv_parent->dv_unit, &ds->ds_ubaddr);
bcopy((caddr_t)&ds->ds_pcbb.pcbb2, (caddr_t)ds->ds_addr,
sizeof (ds->ds_addr));
- printf("de%d: hardware address %s\n", ds->ds_device.dv_unit,
+ printf("%s: hardware address %s\n", ds->ds_dev.dv_xname,
ether_sprintf(ds->ds_addr));
ifp->if_ioctl = deioctl;
ifp->if_start = destart;
@@ -242,7 +248,7 @@ dereset(unit)
sc->ds_flags &= ~DSF_RUNNING;
addr->pcsr0 = PCSR0_RSET;
(void)dewait(sc, "reset");
- deinit(unit);
+ deinit(sc);
}
/*
@@ -250,20 +256,16 @@ dereset(unit)
* operations, and reinitialize UNIBUS usage.
*/
void
-deinit(unit)
- int unit;
-{
+deinit(ds)
struct de_softc *ds;
+{
volatile struct dedevice *addr;
+ struct ifnet *ifp = &ds->ds_if;
struct ifrw *ifrw;
struct ifxmt *ifxp;
- struct ifnet *ifp;
struct de_ring *rp;
int s,incaddr;
- ds = (struct de_softc *)de_cd.cd_devs[unit];
- ifp = &ds->ds_if;
-
/* not yet, if address still unknown */
if (ifp->if_addrlist.tqh_first == (struct ifaddr *)0)
return;
@@ -271,14 +273,14 @@ deinit(unit)
if (ds->ds_flags & DSF_RUNNING)
return;
if ((ifp->if_flags & IFF_RUNNING) == 0) {
- if (if_ubaminit(&ds->ds_deuba, ds->ds_device.dv_parent->dv_unit,
+ if (if_ubaminit(&ds->ds_deuba, ds->ds_dev.dv_parent->dv_unit,
sizeof (struct ether_header), (int)btoc(ETHERMTU),
ds->ds_ifr, NRCV, ds->ds_ifw, NXMT) == 0) {
- printf("de%d: can't initialize\n", unit);
+ printf("%s: can't initialize\n", ds->ds_dev.dv_xname);
ds->ds_if.if_flags &= ~IFF_UP;
return;
}
- ds->ds_ubaddr = uballoc(ds->ds_device.dv_parent->dv_unit,
+ ds->ds_ubaddr = uballoc(ds->ds_dev.dv_parent->dv_unit,
INCORE_BASE(ds), INCORE_SIZE(ds), 0);
}
addr = ds->ds_vaddr;
@@ -344,7 +346,7 @@ deinit(unit)
destart(&ds->ds_if); /* queue output packets */
ds->ds_flags |= DSF_RUNNING; /* need before de_setaddr */
if (ds->ds_flags & DSF_SETADDR)
- de_setaddr(ds->ds_addr, unit);
+ de_setaddr(ds->ds_addr, ds);
addr->pclow = CMD_START | PCSR0_INTE;
splx(s);
}
@@ -360,7 +362,7 @@ destart(ifp)
struct ifnet *ifp;
{
int len;
- register struct de_softc *ds = de_cd.cd_devs[ifp->if_unit];
+ register struct de_softc *ds = ifp->if_softc;
volatile struct dedevice *addr = ds->ds_vaddr;
register struct de_ring *rp;
struct mbuf *m;
@@ -572,19 +574,14 @@ deioctl(ifp, cmd, data)
caddr_t data;
{
register struct ifaddr *ifa = (struct ifaddr *)data;
- register struct de_softc *ds = de_cd.cd_devs[ifp->if_unit];
+ register struct de_softc *ds = ifp->if_softc;
int s = splnet(), error = 0;
- if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) {
- splx(s);
- return error;
- }
-
switch (cmd) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
- deinit(ifp->if_unit);
+ deinit(ds);
switch (ifa->ifa_addr->sa_family) {
#ifdef INET
@@ -592,6 +589,18 @@ deioctl(ifp, cmd, data)
arp_ifinit(&ds->ds_ac, ifa);
break;
#endif
+#ifdef NS
+ case AF_NS:
+ {
+ register struct ns_addr *ina = &(IA_SNS(ifa)->sns_addr);
+
+ if (ns_nullhost(*ina))
+ ina->x_host = *(union ns_host *)(ds->ds_addr);
+ else
+ de_setaddr(ina->x_host.c_host, ds);
+ break;
+ }
+#endif
}
break;
@@ -605,7 +614,7 @@ deioctl(ifp, cmd, data)
ds->ds_if.if_flags &= ~IFF_OACTIVE;
} else if (ifp->if_flags & IFF_UP &&
(ds->ds_flags & DSF_RUNNING) == 0)
- deinit(ifp->if_unit);
+ deinit(ds);
break;
default:
@@ -619,11 +628,10 @@ deioctl(ifp, cmd, data)
* set ethernet address for unit
*/
void
-de_setaddr(physaddr, unit)
+de_setaddr(physaddr, ds)
u_char *physaddr;
- int unit;
+ struct de_softc *ds;
{
- register struct de_softc *ds = de_cd.cd_devs[unit];
volatile struct dedevice *addr= ds->ds_vaddr;
if (! (ds->ds_flags & DSF_RUNNING))
@@ -656,7 +664,7 @@ dewait(ds, fn)
addr->pchigh = csr0 >> 8;
if (csr0 & PCSR0_PCEI)
printf("de%d: %s failed, csr0=%b csr1=%b\n",
- ds->ds_device.dv_unit, fn, csr0, PCSR0_BITS,
+ ds->ds_dev.dv_unit, fn, csr0, PCSR0_BITS,
addr->pcsr1, PCSR1_BITS);
return (csr0 & PCSR0_PCEI);
}
diff --git a/sys/arch/vax/if/if_qe.c b/sys/arch/vax/if/if_qe.c
index ab0e59eabe1..cb5fedd8029 100644
--- a/sys/arch/vax/if/if_qe.c
+++ b/sys/arch/vax/if/if_qe.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_qe.c,v 1.13 1996/03/18 16:47:25 ragge Exp $ */
+/* $NetBSD: if_qe.c,v 1.15 1996/05/19 16:43:07 ragge Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
@@ -162,6 +162,11 @@
#include <netinet/if_ether.h>
#endif
+#ifdef NS
+#include <netns/ns.h>
+#include <netns/ns_if.h>
+#endif
+
#ifdef ISO
#include <netiso/iso.h>
#include <netiso/iso_var.h>
@@ -186,8 +191,6 @@ extern char all_es_snpa[], all_is_snpa[], all_l1is_snpa[], all_l2is_snpa[];
#define MINDATA 60
-void qetimeout(int);
-
/*
* Ethernet software status per interface.
*
@@ -228,17 +231,17 @@ struct qe_softc {
int qematch __P((struct device *, void *, void *));
void qeattach __P((struct device *, struct device *, void *));
void qereset __P((int));
-void qeinit __P((int));
+void qeinit __P((struct qe_softc *));
void qestart __P((struct ifnet *));
void qeintr __P((int));
void qetint __P((int));
void qerint __P((int));
int qeioctl __P((struct ifnet *, u_long, caddr_t));
-void qe_setaddr __P((u_char *, int));
+void qe_setaddr __P((u_char *, struct qe_softc *));
void qeinitdesc __P((struct qe_ring *, caddr_t, int));
void qesetup __P((struct qe_softc *));
void qeread __P((struct qe_softc *, struct ifrw *, int));
-void qetimeout __P((int));
+void qetimeout __P((struct ifnet *));
void qerestart __P((struct qe_softc *));
struct cfdriver qe_cd = {
@@ -360,8 +363,8 @@ qeattach(parent, self, aux)
printf("\n");
sc->qe_vaddr = addr;
- ifp->if_unit = sc->qe_dev.dv_unit;
- ifp->if_name = "qe";
+ bcopy(sc->qe_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
+ ifp->if_softc = sc;
/*
* The Deqna is cable of transmitting broadcasts, but
* doesn't listen to its own.
@@ -404,17 +407,16 @@ qereset(unit)
printf(" %s", sc->qe_dev.dv_xname);
sc->qe_if.if_flags &= ~IFF_RUNNING;
- qeinit(unit);
+ qeinit(sc);
}
/*
* Initialization of interface.
*/
void
-qeinit(unit)
- int unit;
+qeinit(sc)
+ struct qe_softc *sc;
{
- struct qe_softc *sc = (struct qe_softc *)qe_cd.cd_devs[unit];
struct qedevice *addr = sc->qe_vaddr;
struct ifnet *ifp = (struct ifnet *)&sc->qe_if;
int i;
@@ -448,7 +450,8 @@ qeinit(unit)
sizeof (struct ether_header), (int)btoc(MAXPACKETSIZE),
sc->qe_ifr, NRCV, sc->qe_ifw, NXMT) == 0) {
fail:
- printf("qe%d: can't allocate uba resources\n", unit);
+ printf("%s: can't allocate uba resources\n",
+ sc->qe_dev.dv_xname);
sc->qe_if.if_flags &= ~IFF_UP;
return;
}
@@ -510,7 +513,7 @@ void
qestart(ifp)
struct ifnet *ifp;
{
- register struct qe_softc *sc = qe_cd.cd_devs[ifp->if_unit];
+ register struct qe_softc *sc = ifp->if_softc;
volatile struct qedevice *addr = sc->qe_vaddr;
register struct qe_ring *rp;
register index;
@@ -762,26 +765,33 @@ qeioctl(ifp, cmd, data)
u_long cmd;
caddr_t data;
{
- struct qe_softc *sc = qe_cd.cd_devs[ifp->if_unit];
+ struct qe_softc *sc = ifp->if_softc;
struct ifaddr *ifa = (struct ifaddr *)data;
int s = splnet(), error = 0;
- if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) {
- splx(s);
- return error;
- }
-
switch (cmd) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
- qeinit(ifp->if_unit);
+ qeinit(sc);
switch(ifa->ifa_addr->sa_family) {
#ifdef INET
case AF_INET:
arp_ifinit(&sc->qe_ac, ifa);
break;
#endif
+#ifdef NS
+ case AF_NS:
+ {
+ register struct ns_addr *ina = &(IA_SNS(ifa)->sns_addr);
+
+ if (ns_nullhost(*ina))
+ ina->x_host = *(union ns_host *)(sc->qe_addr);
+ else
+ qe_setaddr(ina->x_host.c_host, sc);
+ break;
+ }
+#endif
}
break;
@@ -807,11 +817,10 @@ qeioctl(ifp, cmd, data)
* set ethernet address for unit
*/
void
-qe_setaddr(physaddr, unit)
+qe_setaddr(physaddr, sc)
u_char *physaddr;
- int unit;
+ struct qe_softc *sc;
{
- register struct qe_softc *sc = qe_cd.cd_devs[unit];
register int i;
for (i = 0; i < 6; i++)
@@ -819,7 +828,7 @@ qe_setaddr(physaddr, unit)
sc->qe_flags |= QEF_SETADDR;
if (sc->qe_if.if_flags & IFF_RUNNING)
qesetup(sc);
- qeinit(unit);
+ qeinit(sc);
}
@@ -927,15 +936,14 @@ if (m) {
* the hang up and restarts the device.
*/
void
-qetimeout(unit)
- int unit;
+qetimeout(ifp)
+ struct ifnet *ifp;
{
- register struct qe_softc *sc;
+ register struct qe_softc *sc = ifp->if_softc;
- sc = qe_cd.cd_devs[unit];
#ifdef notdef
- log(LOG_ERR, "qe%d: transmit timeout, restarted %d\n",
- unit, sc->qe_restarts++);
+ log(LOG_ERR, "%s: transmit timeout, restarted %d\n",
+ sc->sc_dev.dv_xname, sc->qe_restarts++);
#endif
qerestart(sc);
}
diff --git a/sys/arch/vax/include/cdefs.h b/sys/arch/vax/include/cdefs.h
index 1c350092c48..0468cc9e196 100644
--- a/sys/arch/vax/include/cdefs.h
+++ b/sys/arch/vax/include/cdefs.h
@@ -30,8 +30,6 @@
__asm__(".stabs msg,30,0,0,0"); \
__asm__(".stabs \"_/**/sym\",1,0,0,0")
#endif
-#else
-#define __warn_references(sym,msg) /* nothing */
#endif
#endif /* !_MACHINE_CDEFS_H_ */
diff --git a/sys/arch/vax/include/cpu.h b/sys/arch/vax/include/cpu.h
index 684bafd2e04..a99710bd042 100644
--- a/sys/arch/vax/include/cpu.h
+++ b/sys/arch/vax/include/cpu.h
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.16 1996/04/08 18:35:46 ragge Exp $ */
+/* $NetBSD: cpu.h,v 1.17 1996/05/19 16:43:16 ragge Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden
@@ -33,6 +33,8 @@
/* All bugs are subject to removal without further notice */
#include <sys/cdefs.h>
+#include <sys/device.h>
+
#include <machine/mtpr.h>
#include <machine/pcb.h>
@@ -49,7 +51,8 @@ struct cpu_dep {
int (*cpu_clock) __P((void)); /* CPU dependent clock handling */
int (*cpu_mchk) __P((caddr_t)); /* Machine check handling */
void (*cpu_memerr) __P((void)); /* Memory subsystem errors */
- void (*cpu_conf) __P((void *, void *, void *)); /* Autoconfiguration */
+ /* Autoconfiguration */
+ void (*cpu_conf) __P((struct device *, struct device *, void *));
};
struct clockframe {
diff --git a/sys/arch/vax/include/disklabel.h b/sys/arch/vax/include/disklabel.h
index f03ecb50fe2..4d95b0997ba 100644
--- a/sys/arch/vax/include/disklabel.h
+++ b/sys/arch/vax/include/disklabel.h
@@ -1,4 +1,4 @@
-/* $NetBSD: disklabel.h,v 1.2 1995/05/03 19:53:44 ragge Exp $ */
+/* $NetBSD: disklabel.h,v 1.3 1996/02/01 22:33:26 mycroft Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
diff --git a/sys/arch/vax/include/exec.h b/sys/arch/vax/include/exec.h
index 684cd2ab3c3..3493e317afa 100644
--- a/sys/arch/vax/include/exec.h
+++ b/sys/arch/vax/include/exec.h
@@ -46,10 +46,4 @@ struct relocation_info_vax {
};
#define relocation_info relocation_info_vax
-#define ELF_TARG_CLASS ELFCLASS32
-#define ELF_TARG_DATA ELFDATA2LSB
-#define ELF_TARG_MACH EM_VAX
-
-#define DO_AOUT /* support a.out */
-
#endif /* _VAX_EXEC_H_ */
diff --git a/sys/arch/vax/include/ka650.h b/sys/arch/vax/include/ka650.h
index ec370f3232c..f513f0fc0fe 100644
--- a/sys/arch/vax/include/ka650.h
+++ b/sys/arch/vax/include/ka650.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ka650.h,v 1.1 1995/12/13 18:58:05 ragge Exp $ */
+/* $NetBSD: ka650.h,v 1.4 1996/05/19 16:43:20 ragge Exp $ */
/*
* Copyright (c) 1988 The Regents of the University of California.
* All rights reserved.
@@ -207,7 +207,7 @@ struct ka650_ipcr {
};
#define KA650_IPCR 0x20001e00
-#endif /* _LOCORE */
+#endif _LOCORE
/*
* Physical start address of the Qbus memory.
@@ -237,7 +237,7 @@ struct ka650_ipcr {
/* prototypes */
struct sbi_attach_args;
-void uvaxIII_conf __P((void *, void *, void *));
+void uvaxIII_conf __P((struct device *, struct device *, void *));
int uvaxIII_clock __P((void));
void uvaxIII_memenable __P((struct sbi_attach_args *, struct device *));
void uvaxIII_memerr __P((void));
diff --git a/sys/arch/vax/include/ka750.h b/sys/arch/vax/include/ka750.h
index cb6ff375a18..9c6e108879b 100644
--- a/sys/arch/vax/include/ka750.h
+++ b/sys/arch/vax/include/ka750.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ka750.h,v 1.5 1996/04/08 18:35:50 ragge Exp $ */
+/* $NetBSD: ka750.h,v 1.6 1996/05/19 16:43:23 ragge Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -43,7 +43,7 @@
#define V750PGS 4
/* 11/750 specific prototypes */
-void ka750_conf __P((void *, void *, void *));
+void ka750_conf __P((struct device *, struct device *, void *));
int ka750_clock __P((void));
void ka750_memenable __P((struct sbi_attach_args *, struct device *));
void ka750_memerr __P((void));
diff --git a/sys/arch/vax/include/profile.h b/sys/arch/vax/include/profile.h
index 8640c003119..dc5e0983eaa 100644
--- a/sys/arch/vax/include/profile.h
+++ b/sys/arch/vax/include/profile.h
@@ -46,7 +46,7 @@
* to __mcount, so that our return address won't get popped from stack.
*/
#define MCOUNT \
-__asm(".text; .globl mcount; mcount: pushl 16(fp); calls $1,__mcount; rsb");
+asm(".text; .globl mcount; mcount: pushl 16(fp); calls $1,__mcount; rsb");
#ifdef _KERNEL
/*
diff --git a/sys/arch/vax/include/types.h b/sys/arch/vax/include/types.h
index 7248b4711a3..09118fd8a40 100644
--- a/sys/arch/vax/include/types.h
+++ b/sys/arch/vax/include/types.h
@@ -65,9 +65,7 @@ typedef short int16_t;
typedef unsigned short u_int16_t;
typedef int int32_t;
typedef unsigned int u_int32_t;
-/* LONGLONG */
typedef long long int64_t;
-/* LONGLONG */
typedef unsigned long long u_int64_t;
typedef int32_t register_t;
diff --git a/sys/arch/vax/include/uvaxII.h b/sys/arch/vax/include/uvaxII.h
index 7bb1ada32eb..db6227ca193 100644
--- a/sys/arch/vax/include/uvaxII.h
+++ b/sys/arch/vax/include/uvaxII.h
@@ -1,4 +1,4 @@
-/* $NetBSD: uvaxII.h,v 1.3 1996/04/08 18:35:54 ragge Exp $ */
+/* $NetBSD: uvaxII.h,v 1.4 1996/05/19 16:43:28 ragge Exp $ */
/*-
* Copyright (c) 1986, 1988 The Regents of the University of California.
* All rights reserved.
@@ -125,7 +125,7 @@ struct ka630clock {
struct sbi_attach_args;
/* Prototypes */
-void uvaxII_conf __P((void *, void *, void *));
+void uvaxII_conf __P((struct device *, struct device *, void *));
int uvaxII_clock __P((void));
void uvaxII_memenable __P((struct sbi_attach_args *, struct device *));
void uvaxII_memerr __P((void));
diff --git a/sys/arch/vax/mba/hp.c b/sys/arch/vax/mba/hp.c
index 0dbb14fd472..65c33749d88 100644
--- a/sys/arch/vax/mba/hp.c
+++ b/sys/arch/vax/mba/hp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hp.c,v 1.8 1996/04/08 18:38:58 ragge Exp $ */
+/* $NetBSD: hp.c,v 1.9 1996/05/19 16:43:34 ragge Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
* All rights reserved.
@@ -51,7 +51,6 @@
#include <sys/ioccom.h>
#include <sys/fcntl.h>
#include <sys/syslog.h>
-#include <sys/cpu.h>
#include <machine/trap.h>
#include <machine/pte.h>
diff --git a/sys/arch/vax/uba/dhu.c b/sys/arch/vax/uba/dhu.c
index 807cbb3aec8..8dcf6236d7f 100644
--- a/sys/arch/vax/uba/dhu.c
+++ b/sys/arch/vax/uba/dhu.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dhu.c,v 1.4 1996/04/08 18:37:28 ragge Exp $ */
+/* $NetBSD: dhu.c,v 1.5 1996/05/19 16:27:02 ragge Exp $ */
/*
* Copyright (c) 1996 Ken C. Wellsch. All rights reserved.
* Copyright (c) 1992, 1993
@@ -36,10 +36,6 @@
* SUCH DAMAGE.
*/
-#include "dhu.h"
-
-#if NDHU > 0
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/ioctl.h>
@@ -60,37 +56,28 @@
#include <vax/uba/dhureg.h>
-/* A DHU has 16 ports while a DHV has only 8 */
+/* A DHU-11 has 16 ports while a DHV-11 has only 8. We use 16 by default */
-#define NDHULINE (NDHU*16)
-
-/* This is an experiment to try and fake DHU behavior with a DHV.
- * The DHV does not have any programmable delay on input silo level
- * but interrupts immediately when the first character enters.
- * This is really kludgy and so I doubt it will stay. From what could
- * be measured, doing a timeout() delay reduced the input interrupt
- * rate by an order of magnitude (from over 700 to at most 30) with
- * heavy input (e.g. via kermit). Input performance increased 5% too
- * as more CPU cycles were available for the application to consume input.
- */
+#define NDHULINE 16
-#define RX_DELAY 0 /* ticks to delay RX intr handling */
+#define DHU_M2U(c) ((c)>>4) /* convert minor(dev) to unit # */
+#define DHU_LINE(u) ((u)&0xF) /* extract line # from minor(dev) */
-struct dhu_softc
-{
+struct dhu_softc {
+ struct device sc_dev; /* Device struct used by config */
dhuregs * sc_addr; /* controller reg address */
- struct tty * sc_tty; /* what we work on */
- unsigned sc_txaddr; /* UBA map address to TX buf */
- u_char sc_type; /* controller type, DHU or DHV */
- u_char sc_state; /* to manage TX output status */
- u_short sc_cc; /* character count on TX */
- u_short sc_modem; /* modem bits state */
+ int sc_type; /* controller type, DHU or DHV */
+ struct {
+ struct tty *dhu_tty; /* what we work on */
+ int dhu_state; /* to manage TX output status */
+ int dhu_txaddr; /* UBA map address to TX buf */
+ short dhu_cc; /* character count on TX */
+ short dhu_modem; /* modem bits state */
+ } sc_dhu[NDHULINE];
};
-struct dhu_softc dhu_softc[NDHULINE];
-
-#define IS_DHU 0 /* cntlr is a DHU */
-#define IS_DHV 1 /* cntlr is a DHV */
+#define IS_DHU 16 /* Unibus DHU-11 board linecount */
+#define IS_DHV 8 /* Q-bus DHV-11 or DHQ-11 */
#define STATE_IDLE 000 /* no current output in progress */
#define STATE_DMA_RUNNING 001 /* DMA TX in progress */
@@ -111,8 +98,7 @@ struct dhu_softc dhu_softc[NDHULINE];
/* a baud rate from the same group. So limiting to B is likely */
/* best, although clone boards like the ABLE QHV allow all settings. */
-static struct speedtab dhuspeedtab[] =
-{
+static struct speedtab dhuspeedtab[] = {
{ 0, 0 }, /* Groups */
{ 50, DHU_LPR_B50 }, /* A */
{ 75, DHU_LPR_B75 }, /* B */
@@ -135,46 +121,40 @@ static struct speedtab dhuspeedtab[] =
static int dhu_match __P((struct device *, void *, void *));
static void dhu_attach __P((struct device *, struct device *, void *));
-
-struct cfdriver dhu_cd = {
- NULL, "dhu", DV_TTY
-};
-
-struct cfattach dhu_ca = {
- sizeof(struct device), dhu_match, dhu_attach
-};
-
static void dhurint __P((int));
static void dhuxint __P((int));
static void dhustart __P((struct tty *));
static int dhuparam __P((struct tty *, struct termios *));
static int dhuiflow __P((struct tty *, int));
- int dhustop __P((struct tty *, int));
-static unsigned dhumctl __P((int, int, int));
+static unsigned dhumctl __P((struct dhu_softc *,int, int, int));
int dhuopen __P((dev_t, int, int, struct proc *));
int dhuclose __P((dev_t, int, int, struct proc *));
int dhuread __P((dev_t, struct uio *, int));
int dhuwrite __P((dev_t, struct uio *, int));
int dhuioctl __P((dev_t, u_long, caddr_t, int, struct proc *));
+ int dhustop __P((struct tty *, int));
struct tty * dhutty __P((dev_t));
+struct cfdriver dhu_cd = {
+ NULL, "dhu", DV_TTY
+};
+
+struct cfattach dhu_ca = {
+ sizeof(struct dhu_softc), dhu_match, dhu_attach
+};
/* Autoconfig handles: setup the controller to interrupt, */
/* then complete the housecleaning for full operation */
static int
-dhu_match (parent, match, aux)
+dhu_match(parent, match, aux)
struct device *parent;
void *match, *aux;
{
struct uba_attach_args *ua = aux;
- static int nunits = 0;
register dhuregs *dhuaddr;
register int n;
- if (nunits > NDHU)
- return 0;
-
dhuaddr = (dhuregs *) ua->ua_addr;
/* Reset controller to initialize, enable TX/RX interrupts */
@@ -201,122 +181,80 @@ dhu_match (parent, match, aux)
if ((dhuaddr->dhu_csr & DHU_CSR_DIAG_FAIL) != 0)
return 0;
- /* Register the RX interrupt handler and pass unit # as arg */
+ /* Register the RX interrupt handler */
ua->ua_ivec = dhurint;
- nunits++;
return 1;
}
static void
-dhu_attach (parent, self, aux)
+dhu_attach(parent, self, aux)
struct device *parent, *self;
void *aux;
{
+ register struct dhu_softc *sc = (void *)self;
register struct uba_attach_args *ua = aux;
register dhuregs *dhuaddr;
register unsigned c;
- register int n, m;
+ register int n;
dhuaddr = (dhuregs *) ua->ua_addr;
/* Process the 8 bytes of diagnostic info put into */
/* the FIFO following the master reset operation. */
- printf ("\ndhv%d:", self->dv_unit);
+ printf("\n%s:", self->dv_xname);
for (n = 0; n < 8; n++) {
c = dhuaddr->dhu_rbuf;
if ((c&DHU_DIAG_CODE) == DHU_DIAG_CODE) {
if ((c&0200) == 0000)
- printf (" rom(%d) version %d",
+ printf(" rom(%d) version %d",
((c>>1)&01), ((c>>2)&037));
else if (((c>>2)&07) != 0)
- printf (" diag-error(proc%d)=%x",
+ printf(" diag-error(proc%d)=%x",
((c>>1)&01), ((c>>2)&07));
}
}
- printf ("\n");
-
- /* Initialize our static softc structure. */
+ printf("\n");
c = dhuaddr->dhu_stat; /* get flag to distinguish DHU from DHV */
- for (n = 0; n < ((c & DHU_STAT_DHU)? 16: 8); n++) {
- m = ((self->dv_unit) << 4) + n;
- dhu_softc[m].sc_addr = dhuaddr;
- dhu_softc[m].sc_tty = ttymalloc();
- dhu_softc[m].sc_type = (c & DHU_STAT_DHU)? IS_DHU: IS_DHV;
- dhu_softc[m].sc_state = STATE_IDLE;
-
- dhu_softc[m].sc_txaddr = uballoc (parent->dv_unit,
- dhu_softc[m].sc_tty->t_outq.c_cs,
- dhu_softc[m].sc_tty->t_outq.c_cn,
- UBA_CANTWAIT);
- }
+ sc->sc_addr = dhuaddr;
+ sc->sc_type = (c & DHU_STAT_DHU)? IS_DHU: IS_DHV;
/* Now stuff TX interrupt handler in place */
- ubasetvec (self, ua->ua_cvec+1, dhuxint);
+ ubasetvec(self, ua->ua_cvec + 1, dhuxint);
return;
}
/* Receiver Interrupt */
-#if RX_DELAY > 0
-
-static int RXtimeout = 0;
-
-static void
-dhurint (cntlr)
- int cntlr;
-{
- static void dhuRXint __P((void *));
- if (RXtimeout == 0) {
- RXtimeout = 1;
- timeout (dhuRXint, (void *)cntlr, RX_DELAY);
- }
- return;
-}
-
-static void
-dhuRXint (arg)
- void * arg;
-{
-
-#else
-
static void
-dhurint (cntlr)
- int cntlr;
+dhurint(unit)
+ int unit;
{
-
-#endif
+ struct dhu_softc *sc = dhu_cd.cd_devs[unit];
register dhuregs *dhuaddr;
register struct tty *tp;
- register int cc, unit;
+ register int cc, line;
register unsigned c, delta;
int overrun = 0;
-#if RX_DELAY > 0
- int cntlr = (int) arg;
- int s;
- s = spltty();
-#endif
+ dhuaddr = sc->sc_addr;
- dhuaddr = dhu_softc[cntlr].sc_addr;
+ while ((c = dhuaddr->dhu_rbuf) & DHU_RBUF_DATA_VALID) {
- while ((c = dhuaddr->dhu_rbuf) & DHU_RBUF_DATA_VALID)
- {
/* Ignore diagnostic FIFO entries. */
- if ((c&DHU_DIAG_CODE) == DHU_DIAG_CODE)
+ if ((c & DHU_DIAG_CODE) == DHU_DIAG_CODE)
continue;
- cc = c & 0xff;
- unit = (cntlr<<4) | ((c>>8)&017);
- tp = dhu_softc[unit].sc_tty;
+ cc = c & 0xFF;
+ line = DHU_LINE(c>>8);
+ tp = sc->sc_dhu[line].dhu_tty;
/* LINK.TYPE is set so we get modem control FIFO entries */
@@ -329,28 +267,33 @@ dhurint (cntlr)
}
else if ((tp->t_state & TS_CARR_ON) &&
(*linesw[tp->t_line].l_modem)(tp, 0) == 0)
- (void) dhumctl (unit, 0, DMSET);
+ (void) dhumctl(sc, line, 0, DMSET);
/* Do CRTSCTS flow control */
- delta = c ^ dhu_softc[unit].sc_modem;
- dhu_softc[unit].sc_modem = c;
+ delta = c ^ sc->sc_dhu[line].dhu_modem;
+ sc->sc_dhu[line].dhu_modem = c;
if ((delta & DHU_STAT_CTS) &&
(tp->t_state & TS_ISOPEN) &&
(tp->t_cflag & CRTSCTS)) {
if (c & DHU_STAT_CTS) {
tp->t_state &= ~TS_TTSTOP;
- ttstart (tp);
+ ttstart(tp);
} else {
tp->t_state |= TS_TTSTOP;
- dhustop (tp, 0);
+ dhustop(tp, 0);
}
}
continue;
}
+ if (!(tp->t_state & TS_ISOPEN)) {
+ wakeup((caddr_t)&tp->t_rawq);
+ continue;
+ }
+
if ((c & DHU_RBUF_OVERRUN_ERR) && overrun == 0) {
- log(LOG_WARNING, "dhv(%d,%d): silo overflow\n",
- cntlr, (c >> 8) & 017);
+ log(LOG_WARNING, "%s: silo overflow, line %d\n",
+ sc->sc_dev.dv_xname, line);
overrun = 1;
}
/* A BREAK key will appear as a NULL with a framing error */
@@ -361,71 +304,90 @@ dhurint (cntlr)
(*linesw[tp->t_line].l_rint)(cc, tp);
}
-#if RX_DELAY > 0
- RXtimeout = 0;
- (void) splx(s);
-#endif
return;
}
/* Transmitter Interrupt */
static void
-dhuxint (cntlr)
- int cntlr;
+dhuxint(unit)
+ int unit;
{
+ register struct dhu_softc *sc = dhu_cd.cd_devs[unit];
register dhuregs *dhuaddr;
- register struct dhu_softc *sc;
register struct tty *tp;
- register unsigned csr;
- register int unit;
+ register int line;
- dhuaddr = dhu_softc[cntlr].sc_addr;
-
- csr = (dhuaddr->dhu_csr_hi) << 8;
-
- unit = (cntlr<<4)|((csr>>8)&017);
+ dhuaddr = sc->sc_addr;
- sc = &dhu_softc[unit];
+ line = DHU_LINE(dhuaddr->dhu_csr_hi);
- tp = sc->sc_tty;
+ tp = sc->sc_dhu[line].dhu_tty;
tp->t_state &= ~TS_BUSY;
if (tp->t_state & TS_FLUSH)
tp->t_state &= ~TS_FLUSH;
else {
- if (sc->sc_state == STATE_DMA_STOPPED)
- sc->sc_cc -= dhuaddr->dhu_tbufcnt;
- ndflush (&tp->t_outq, sc->sc_cc);
- sc->sc_cc = 0;
+ if (sc->sc_dhu[line].dhu_state == STATE_DMA_STOPPED)
+ sc->sc_dhu[line].dhu_cc -= dhuaddr->dhu_tbufcnt;
+ ndflush(&tp->t_outq, sc->sc_dhu[line].dhu_cc);
+ sc->sc_dhu[line].dhu_cc = 0;
}
- sc->sc_state = STATE_IDLE;
+ sc->sc_dhu[line].dhu_state = STATE_IDLE;
if (tp->t_line)
(*linesw[tp->t_line].l_start)(tp);
else
- dhustart (tp);
+ dhustart(tp);
return;
}
int
-dhuopen (dev, flag, mode, p)
+dhuopen(dev, flag, mode, p)
dev_t dev;
int flag, mode;
struct proc *p;
{
+ register dhuregs *dhuaddr;
register struct tty *tp;
- register int unit;
+ register int unit, line;
+ struct dhu_softc *sc;
int s, error = 0;
- unit = minor(dev);
- if (unit >= NDHULINE)
+ unit = DHU_M2U(minor(dev));
+ line = DHU_LINE(minor(dev));
+
+ if (unit >= dhu_cd.cd_ndevs || dhu_cd.cd_devs[unit] == NULL)
return (ENXIO);
- tp = dhu_softc[unit].sc_tty;
- if (tp == NULL)
- tp = dhu_softc[unit].sc_tty = ttymalloc();
+
+ sc = dhu_cd.cd_devs[unit];
+
+ if (line >= sc->sc_type)
+ return ENXIO;
+
+ tp = sc->sc_dhu[line].dhu_tty;
+ if (tp == NULL) {
+
+ tp = sc->sc_dhu[line].dhu_tty = ttymalloc();
+ if (tp == NULL)
+ return ENXIO;
+
+ sc->sc_dhu[line].dhu_state = STATE_IDLE;
+
+ sc->sc_dhu[line].dhu_txaddr = uballoc(
+ sc->sc_dev.dv_parent->dv_unit,
+ tp->t_outq.c_cs, tp->t_outq.c_cn, 0);
+
+ dhuaddr = sc->sc_addr;
+
+ s = spltty();
+ dhuaddr->dhu_csr_lo = (DHU_CSR_RXIE | line);
+ sc->sc_dhu[line].dhu_modem = dhuaddr->dhu_stat;
+ (void) splx(s);
+ }
+
tp->t_oproc = dhustart;
tp->t_param = dhuparam;
tp->t_hwiflow = dhuiflow;
@@ -445,7 +407,7 @@ dhuopen (dev, flag, mode, p)
} else if ((tp->t_state & TS_XCLUDE) && curproc->p_ucred->cr_uid != 0)
return (EBUSY);
/* Use DMBIS and *not* DMSET or else we clobber incoming bits */
- if (dhumctl (unit, DML_DTR|DML_RTS, DMBIS) & DML_DCD)
+ if (dhumctl(sc, line, DML_DTR|DML_RTS, DMBIS) & DML_DCD)
tp->t_state |= TS_CARR_ON;
s = spltty();
while (!(flag & O_NONBLOCK) && !(tp->t_cflag & CLOCAL) &&
@@ -464,67 +426,84 @@ dhuopen (dev, flag, mode, p)
/*ARGSUSED*/
int
-dhuclose (dev, flag, mode, p)
+dhuclose(dev, flag, mode, p)
dev_t dev;
int flag, mode;
struct proc *p;
{
register struct tty *tp;
- register int unit = minor(dev);
+ register int unit, line;
+ struct dhu_softc *sc;
- tp = dhu_softc[unit].sc_tty;
+ unit = DHU_M2U(minor(dev));
+ line = DHU_LINE(minor(dev));
+
+ sc = dhu_cd.cd_devs[unit];
+
+ tp = sc->sc_dhu[line].dhu_tty;
(*linesw[tp->t_line].l_close)(tp, flag);
/* Make sure a BREAK state is not left enabled. */
- (void) dhumctl (unit, DML_BRK, DMBIC);
+ (void) dhumctl(sc, line, DML_BRK, DMBIC);
/* Do a hangup if so required. */
if ((tp->t_cflag & HUPCL) || (tp->t_state & TS_WOPEN) ||
!(tp->t_state & TS_ISOPEN))
- (void) dhumctl (unit, 0, DMSET);
+ (void) dhumctl(sc, line, 0, DMSET);
return (ttyclose(tp));
}
int
-dhuread (dev, uio, flag)
+dhuread(dev, uio, flag)
dev_t dev;
struct uio *uio;
{
+ register struct dhu_softc *sc;
register struct tty *tp;
- tp = dhu_softc[minor(dev)].sc_tty;
+ sc = dhu_cd.cd_devs[DHU_M2U(minor(dev))];
+
+ tp = sc->sc_dhu[DHU_LINE(minor(dev))].dhu_tty;
return ((*linesw[tp->t_line].l_read)(tp, uio, flag));
}
int
-dhuwrite (dev, uio, flag)
+dhuwrite(dev, uio, flag)
dev_t dev;
struct uio *uio;
{
+ register struct dhu_softc *sc;
register struct tty *tp;
- tp = dhu_softc[minor(dev)].sc_tty;
+ sc = dhu_cd.cd_devs[DHU_M2U(minor(dev))];
+
+ tp = sc->sc_dhu[DHU_LINE(minor(dev))].dhu_tty;
return ((*linesw[tp->t_line].l_write)(tp, uio, flag));
}
/*ARGSUSED*/
int
-dhuioctl (dev, cmd, data, flag, p)
+dhuioctl(dev, cmd, data, flag, p)
dev_t dev;
u_long cmd;
caddr_t data;
int flag;
struct proc *p;
{
+ register struct dhu_softc *sc;
register struct tty *tp;
- register int unit = minor(dev);
+ register int unit, line;
int error;
- tp = dhu_softc[unit].sc_tty;
+ unit = DHU_M2U(minor(dev));
+ line = DHU_LINE(minor(dev));
+ sc = dhu_cd.cd_devs[unit];
+ tp = sc->sc_dhu[line].dhu_tty;
+
error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);
if (error >= 0)
return (error);
@@ -535,35 +514,35 @@ dhuioctl (dev, cmd, data, flag, p)
switch (cmd) {
case TIOCSBRK:
- (void) dhumctl (unit, DML_BRK, DMBIS);
+ (void) dhumctl(sc, line, DML_BRK, DMBIS);
break;
case TIOCCBRK:
- (void) dhumctl (unit, DML_BRK, DMBIC);
+ (void) dhumctl(sc, line, DML_BRK, DMBIC);
break;
case TIOCSDTR:
- (void) dhumctl (unit, DML_DTR|DML_RTS, DMBIS);
+ (void) dhumctl(sc, line, DML_DTR|DML_RTS, DMBIS);
break;
case TIOCCDTR:
- (void) dhumctl (unit, DML_DTR|DML_RTS, DMBIC);
+ (void) dhumctl(sc, line, DML_DTR|DML_RTS, DMBIC);
break;
case TIOCMSET:
- (void) dhumctl (unit, *(int *)data, DMSET);
+ (void) dhumctl(sc, line, *(int *)data, DMSET);
break;
case TIOCMBIS:
- (void) dhumctl (unit, *(int *)data, DMBIS);
+ (void) dhumctl(sc, line, *(int *)data, DMBIS);
break;
case TIOCMBIC:
- (void) dhumctl (unit, *(int *)data, DMBIC);
+ (void) dhumctl(sc, line, *(int *)data, DMBIC);
break;
case TIOCMGET:
- *(int *)data = (dhumctl (unit, 0, DMGET) & ~DML_BRK);
+ *(int *)data = (dhumctl(sc, line, 0, DMGET) & ~DML_BRK);
break;
default:
@@ -573,35 +552,37 @@ dhuioctl (dev, cmd, data, flag, p)
}
struct tty *
-dhutty (dev)
+dhutty(dev)
dev_t dev;
{
- struct tty *tp = dhu_softc[minor(dev)].sc_tty;
+ struct dhu_softc *sc = dhu_cd.cd_devs[DHU_M2U(minor(dev))];
+ struct tty *tp = sc->sc_dhu[DHU_LINE(minor(dev))].dhu_tty;
return (tp);
}
/*ARGSUSED*/
int
-dhustop (tp, flag)
+dhustop(tp, flag)
register struct tty *tp;
{
- register dhuregs *dhuaddr;
register struct dhu_softc *sc;
- int unit = minor(tp->t_dev);
+ register dhuregs *dhuaddr;
+ register int line;
int s;
s = spltty();
- if (tp->t_state & TS_BUSY)
- {
- sc = &dhu_softc[unit];
+ if (tp->t_state & TS_BUSY) {
+
+ sc = dhu_cd.cd_devs[DHU_M2U(minor(tp->t_dev))];
+ line = DHU_LINE(minor(tp->t_dev));
+
+ if (sc->sc_dhu[line].dhu_state == STATE_DMA_RUNNING) {
- if (sc->sc_state == STATE_DMA_RUNNING)
- {
- sc->sc_state = STATE_DMA_STOPPED;
+ sc->sc_dhu[line].dhu_state = STATE_DMA_STOPPED;
dhuaddr = sc->sc_addr;
- dhuaddr->dhu_csr_lo = (DHU_CSR_RXIE | (unit & 017));
+ dhuaddr->dhu_csr_lo = (DHU_CSR_RXIE | line);
dhuaddr->dhu_lnctrl |= DHU_LNCTRL_DMA_ABORT;
}
@@ -613,14 +594,13 @@ dhustop (tp, flag)
}
static void
-dhustart (tp)
+dhustart(tp)
register struct tty *tp;
{
register struct dhu_softc *sc;
register dhuregs *dhuaddr;
- register int unit = minor(tp->t_dev);
- register unsigned addr;
- register int cc;
+ register int line, cc;
+ register int addr;
int s;
s = spltty();
@@ -641,28 +621,30 @@ dhustart (tp)
tp->t_state |= TS_BUSY;
- sc = &dhu_softc[unit];
+ sc = dhu_cd.cd_devs[DHU_M2U(minor(tp->t_dev))];
+
+ line = DHU_LINE(minor(tp->t_dev));
dhuaddr = sc->sc_addr;
- dhuaddr->dhu_csr_lo = (DHU_CSR_RXIE | (unit & 017));
+ dhuaddr->dhu_csr_lo = (DHU_CSR_RXIE | line);
+
+ sc->sc_dhu[line].dhu_cc = cc;
- sc->sc_cc = cc;
+ if (cc == 1) {
- if (cc == 1)
- {
- sc->sc_state = STATE_TX_ONE_CHAR;
+ sc->sc_dhu[line].dhu_state = STATE_TX_ONE_CHAR;
dhuaddr->dhu_txchar = DHU_TXCHAR_DATA_VALID | *tp->t_outq.c_cf;
- }
- else
- {
- sc->sc_state = STATE_DMA_RUNNING;
- addr = UBAI_ADDR(sc->sc_txaddr) +
+ } else {
+
+ sc->sc_dhu[line].dhu_state = STATE_DMA_RUNNING;
+
+ addr = UBAI_ADDR(sc->sc_dhu[line].dhu_txaddr) +
(tp->t_outq.c_cf - tp->t_outq.c_cs);
dhuaddr->dhu_tbufcnt = cc;
- dhuaddr->dhu_tbufad1 = (addr & 0xffff);
- dhuaddr->dhu_tbufad2 = ((addr>>16) & 0x3f) |
+ dhuaddr->dhu_tbufad1 = (addr & 0xFFFF);
+ dhuaddr->dhu_tbufad2 = ((addr>>16) & 0x3F) |
DHU_TBUFAD2_TX_ENABLE;
dhuaddr->dhu_lnctrl &= ~DHU_LNCTRL_DMA_ABORT;
@@ -674,18 +656,24 @@ out:
}
static int
-dhuparam (tp, t)
+dhuparam(tp, t)
register struct tty *tp;
register struct termios *t;
{
+ struct dhu_softc *sc;
register dhuregs *dhuaddr;
register int cflag = t->c_cflag;
- int unit = minor(tp->t_dev);
int ispeed = ttspeedtab(t->c_ispeed, dhuspeedtab);
int ospeed = ttspeedtab(t->c_ospeed, dhuspeedtab);
register unsigned lpr, lnctrl;
+ int unit, line;
int s;
+ unit = DHU_M2U(minor(tp->t_dev));
+ line = DHU_LINE(minor(tp->t_dev));
+
+ sc = dhu_cd.cd_devs[unit];
+
/* check requested parameters */
if (ospeed < 0 || ispeed < 0)
return (EINVAL);
@@ -695,31 +683,35 @@ dhuparam (tp, t)
tp->t_cflag = cflag;
if (ospeed == 0) {
- (void) dhumctl (unit, 0, DMSET); /* hang up line */
+ (void) dhumctl(sc, line, 0, DMSET); /* hang up line */
return (0);
}
s = spltty();
- dhuaddr = dhu_softc[unit].sc_addr;
- dhuaddr->dhu_csr_lo = (DHU_CSR_RXIE | (unit & 017));
+ dhuaddr = sc->sc_addr;
+ dhuaddr->dhu_csr_lo = (DHU_CSR_RXIE | line);
lpr = ((ispeed&017)<<8) | ((ospeed&017)<<12) ;
- switch (cflag & CSIZE)
- {
- case CS5:
+ switch (cflag & CSIZE) {
+
+ case CS5:
lpr |= DHU_LPR_5_BIT_CHAR;
break;
- case CS6:
+
+ case CS6:
lpr |= DHU_LPR_6_BIT_CHAR;
break;
- case CS7:
+
+ case CS7:
lpr |= DHU_LPR_7_BIT_CHAR;
break;
- default:
+
+ default:
lpr |= DHU_LPR_8_BIT_CHAR;
break;
}
+
if (cflag & PARENB)
lpr |= DHU_LPR_PARENB;
if (!(cflag & PARODD))
@@ -737,6 +729,8 @@ dhuparam (tp, t)
lnctrl |= (DHU_LNCTRL_RX_ENABLE | DHU_LNCTRL_LINK_TYPE);
+ /* Enable the auto XON/XOFF feature on the controller */
+
if (t->c_iflag & IXON)
lnctrl |= DHU_LNCTRL_OAUTO;
else
@@ -749,29 +743,30 @@ dhuparam (tp, t)
dhuaddr->dhu_lnctrl = lnctrl;
- dhu_softc[unit].sc_modem = dhuaddr->dhu_stat;
-
(void) splx(s);
return (0);
}
static int
-dhuiflow (tp, flag)
+dhuiflow(tp, flag)
struct tty *tp;
int flag;
{
- int unit = minor(tp->t_dev);
+ register struct dhu_softc *sc;
+ register int line = DHU_LINE(minor(tp->t_dev));
if (tp->t_cflag & CRTSCTS) {
- (void) dhumctl (unit, DML_RTS, ((flag)? DMBIC: DMBIS));
+ sc = dhu_cd.cd_devs[DHU_M2U(minor(tp->t_dev))];
+ (void) dhumctl(sc, line, DML_RTS, ((flag)? DMBIC: DMBIS));
return (1);
}
return (0);
}
static unsigned
-dhumctl (unit, bits, how)
- int unit, bits, how;
+dhumctl(sc, line, bits, how)
+ struct dhu_softc *sc;
+ int line, bits, how;
{
register dhuregs *dhuaddr;
register unsigned status;
@@ -781,8 +776,8 @@ dhumctl (unit, bits, how)
s = spltty();
- dhuaddr = dhu_softc[unit].sc_addr;
- dhuaddr->dhu_csr_lo = (DHU_CSR_RXIE | (unit & 017));
+ dhuaddr = sc->sc_addr;
+ dhuaddr->dhu_csr_lo = (DHU_CSR_RXIE | line);
mbits = 0;
@@ -815,21 +810,21 @@ dhumctl (unit, bits, how)
if (lnctrl & DHU_LNCTRL_BREAK)
mbits |= DML_BRK;
- switch (how)
- {
- case DMSET:
+ switch (how) {
+
+ case DMSET:
mbits = bits;
break;
- case DMBIS:
+ case DMBIS:
mbits |= bits;
break;
- case DMBIC:
+ case DMBIC:
mbits &= ~bits;
break;
- case DMGET:
+ case DMGET:
(void) splx(s);
return (mbits);
}
@@ -854,5 +849,3 @@ dhumctl (unit, bits, how)
(void) splx(s);
return (mbits);
}
-
-#endif /* #if NDHU > 0 */
diff --git a/sys/arch/vax/uba/ubareg.h b/sys/arch/vax/uba/ubareg.h
index f715debad4d..d63093e5613 100644
--- a/sys/arch/vax/uba/ubareg.h
+++ b/sys/arch/vax/uba/ubareg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ubareg.h,v 1.4 1995/11/10 19:25:50 ragge Exp $ */
+/* $NetBSD: ubareg.h,v 1.7 1996/04/08 18:37:35 ragge Exp $ */
/*-
* Copyright (c) 1982, 1986 The Regents of the University of California.
diff --git a/sys/arch/vax/uba/ubavar.h b/sys/arch/vax/uba/ubavar.h
index 18d28ae0044..c179cb4887c 100644
--- a/sys/arch/vax/uba/ubavar.h
+++ b/sys/arch/vax/uba/ubavar.h
@@ -267,4 +267,4 @@ void ubareset __P((int));
int ubasetup __P((int, struct buf *, int));
#endif /* _KERNEL */
-#endif /* !_LOCORE */
+#endif !_LOCORE
diff --git a/sys/arch/vax/uba/uda.c b/sys/arch/vax/uba/uda.c
index cb541c4bcb9..c911d3a9b3f 100644
--- a/sys/arch/vax/uba/uda.c
+++ b/sys/arch/vax/uba/uda.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uda.c,v 1.15 1996/03/17 22:56:50 ragge Exp $ */
+/* $NetBSD: uda.c,v 1.16 1996/05/19 16:43:42 ragge Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
* All rights reserved.
@@ -252,7 +252,12 @@ struct ra_info {
/*
* Definition of the driver for autoconf.
*/
-int udaprobe(), udaslave(), udaattach(), udadgo(), udaintr();
+int udaprobe __P((caddr_t, int, struct uba_ctlr *, struct uba_softc *));
+int udaslave __P((struct uba_device *, caddr_t));
+void udaattach __P((struct uba_device *));
+void udadgo __P((struct uba_ctlr *));
+void udaintr __P((int));
+
struct uba_ctlr *udaminfo[NUDA];
struct uba_device *udadinfo[NRA];
struct disklabel udalabel[NRA];
@@ -265,8 +270,15 @@ struct uba_driver udadriver =
/*
* More driver definitions, for generic MSCP code.
*/
-int udadgram(), udactlrdone(), udaunconf(), udaiodone();
-int udaonline(), udagotstatus(), udaioerror(), udareplace(), udabb();
+void udadgram __P((struct mscp_info *, struct mscp *));
+void udactlrdone __P((struct mscp_info *, struct mscp *));
+int udaunconf __P((struct mscp_info *, struct mscp *));
+void udaiodone __P((struct mscp_info *, struct buf *, int));
+int udaonline __P((struct uba_device *, struct mscp *));
+int udagotstatus __P((struct uba_device *, struct mscp *));
+void udareplace __P((struct uba_device *, struct mscp *));
+int udaioerror __P((struct uba_device *, struct mscp *, struct buf *));
+void udabb __P((struct uba_device *, struct mscp *, struct buf *));
struct buf udautab[NRA]; /* per drive transfer queue */
@@ -506,7 +518,7 @@ again:
findunit:
udaslavereply.mscp_opcode = 0;
sc->sc_flags |= SC_INSLAVE;
- if ((mp = mscp_getcp(&sc->sc_mi, MSCP_DONTWAIT)) == NULL)
+ if ((mp = mscp_getcp((void *)&sc->sc_mi, MSCP_DONTWAIT)) == NULL)
panic("udaslave"); /* `cannot happen' */
mp->mscp_opcode = M_OP_GETUNITST;
if (ui->ui_slave == '?') {
@@ -577,14 +589,14 @@ gotit:
*/
printf("uda%d: unit %d off line: ", um->um_ctlr,
mp->mscp_unit);
- mscp_printevent(mp);
+ mscp_printevent((void *)mp);
goto try_another;
}
break;
default:
printf("uda%d: unable to get unit status: ", um->um_ctlr);
- mscp_printevent(mp);
+ mscp_printevent((void *)mp);
return (0);
}
@@ -630,6 +642,7 @@ try_another:
* what?). Set up the inverting pointer, and attempt to bring the
* drive on line and read its label.
*/
+void
udaattach(ui)
register struct uba_device *ui;
{
@@ -1225,7 +1238,7 @@ loop:
* be too small: We should have at least as many command
* packets as credits, for best performance.
*/
- if ((mp = mscp_getcp(&sc->sc_mi, MSCP_DONTWAIT)) == NULL) {
+ if ((mp = mscp_getcp((void*)&sc->sc_mi, MSCP_DONTWAIT)) == NULL) {
if (sc->sc_mi.mi_credits > MSCP_MINCREDITS &&
(sc->sc_flags & SC_GRIPED) == 0) {
log(LOG_NOTICE, "uda%d: command ring too small\n",
@@ -1307,6 +1320,7 @@ out:
* this calls us again immediately we will not recurse, because
* that time we will be in udastart(). Clever....
*/
+void
udadgo(um)
register struct uba_ctlr *um;
{
@@ -1333,6 +1347,7 @@ udadgo(um)
udastart(um);
}
+void
udaiodone(mi, bp, info)
register struct mscp_info *mi;
struct buf *bp;
@@ -1425,7 +1440,9 @@ udasaerror(um, doreset)
* continue initialisation, or acknowledge command and response
* interrupts, and process responses.
*/
+void
udaintr(ctlr)
+ int ctlr;
{
struct uba_ctlr *um = udaminfo[ctlr];
struct uda_softc *sc = &uda_softc[ctlr];
@@ -1616,6 +1633,7 @@ udainitds(ctlr)
/*
* Handle an error datagram.
*/
+void
udadgram(mi, mp)
struct mscp_info *mi;
struct mscp *mp;
@@ -1637,6 +1655,7 @@ udadgram(mi, mp)
* The Set Controller Characteristics command finished.
* Record the new state of the controller.
*/
+void
udactlrdone(mi, mp)
register struct mscp_info *mi;
struct mscp *mp;
@@ -1775,6 +1794,7 @@ udaioerror(ui, mp, bp)
* A replace operation finished.
*/
/*ARGSUSED*/
+void
udareplace(ui, mp)
struct uba_device *ui;
struct mscp *mp;
@@ -1787,6 +1807,7 @@ udareplace(ui, mp)
* A bad block related operation finished.
*/
/*ARGSUSED*/
+void
udabb(ui, mp, bp)
struct uba_device *ui;
struct mscp *mp;
diff --git a/sys/arch/vax/vax/autoconf.c b/sys/arch/vax/vax/autoconf.c
index a6651d66f57..e71716a7af1 100644
--- a/sys/arch/vax/vax/autoconf.c
+++ b/sys/arch/vax/vax/autoconf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.12 1996/04/08 18:32:26 ragge Exp $ */
+/* $NetBSD: autoconf.c,v 1.13 1996/05/19 16:43:53 ragge Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -66,15 +66,11 @@ struct bp_conf {
extern int cold;
-void notsupp_conf __P((void *, void *, void *));
-int notsupp_clock __P((void));
-void notsupp_memerr __P((void));
-int notsupp_mchk __P((caddr_t));
void notsupp_steal_pages __P((void));
#ifdef VAX8600 /* XXX These are in ka860 also */
-void ka86_conf __P((void *, void *, void *));
+void ka86_conf __P((struct device *, struct device *, void *));
int ka86_clock __P((void));
void ka86_memenable __P((struct sbi_attach_args *, struct device *));
void ka86_memerr __P((void));
@@ -82,7 +78,7 @@ int ka86_mchk __P((caddr_t));
void ka86_steal_pages __P((void));
#endif
#ifdef VAX780 /* XXX These are in ka780 also */
-void ka780_conf __P((void *, void *, void *));
+void ka780_conf __P((struct device *, struct device *, void *));
int ka780_clock __P((void));
void ka780_memenable __P((struct sbi_attach_args *, void *));
void ka780_memerr __P((void));
@@ -104,70 +100,55 @@ int nexty730[NNEX730] = {
struct cpu_dep cpu_calls[VAX_MAX+1]={
/* Type 0,noexist */
- {notsupp_steal_pages, notsupp_clock, notsupp_mchk, notsupp_memerr,
- notsupp_conf},
+ {notsupp_steal_pages, NULL, NULL, NULL, NULL },
#ifdef VAX780 /* Type 1, 11/{780,782,785} */
{ka780_steal_pages, ka780_clock, ka780_mchk, ka780_memerr, ka780_conf},
#else
- {notsupp_steal_pages, notsupp_clock, notsupp_mchk, notsupp_memerr,
- notsupp_conf},
+ {notsupp_steal_pages, NULL, NULL, NULL, NULL },
#endif
#ifdef VAX750 /* Type 2, 11/750 */
{ka750_steal_pages, ka750_clock, ka750_mchk, ka750_memerr, ka750_conf},
#else
- {notsupp_steal_pages, notsupp_clock, notsupp_mchk, notsupp_memerr,
- notsupp_conf},
+ {notsupp_steal_pages, NULL, NULL, NULL, NULL },
#endif
#ifdef VAX730 /* Type 3, 11/{730,725}, ceauciesco-vax */
- {notsupp_steal_pages, notsupp_clock, notsupp_mchk, notsupp_memerr,
- notsupp_conf},
+ {notsupp_steal_pages, NULL, NULL, NULL, NULL },
#else
- {notsupp_steal_pages, notsupp_clock, notsupp_mchk, notsupp_memerr,
- notsupp_conf},
+ {notsupp_steal_pages, NULL, NULL, NULL, NULL },
#endif
#ifdef VAX8600 /* Type 4, 8600/8650 (11/{790,795}) */
{ka86_steal_pages, ka86_clock, ka86_mchk, ka86_memerr, ka86_conf},
#else
- {notsupp_steal_pages, notsupp_clock, notsupp_mchk, notsupp_memerr,
- notsupp_conf},
+ {notsupp_steal_pages, NULL, NULL, NULL, NULL },
#endif
#ifdef VAX8200 /* Type 5, 8200, 8300, 8350 */
- {notsupp_steal_pages, notsupp_clock, notsupp_mchk, notsupp_memerr,
- notsupp_conf},
+ {notsupp_steal_pages, NULL, NULL, NULL, NULL },
#else
- {notsupp_steal_pages, notsupp_clock, notsupp_mchk, notsupp_memerr,
- notsupp_conf},
+ {notsupp_steal_pages, NULL, NULL, NULL, NULL },
#endif
#ifdef VAX8800 /* Type 6, 85X0, 8700, 88X0 */
- {notsupp_steal_pages, notsupp_clock, notsupp_mchk, notsupp_memerr,
- notsupp_conf},
+ {notsupp_steal_pages, NULL, NULL, NULL, NULL },
#else
- {notsupp_steal_pages, notsupp_clock, notsupp_mchk, notsupp_memerr,
- notsupp_conf},
+ {notsupp_steal_pages, NULL, NULL, NULL, NULL },
#endif
#ifdef VAX610 /* Type 7, KA610 */
- {notsupp_steal_pages, notsupp_clock, notsupp_mchk, notsupp_memerr,
- notsupp_conf},
+ {notsupp_steal_pages, NULL, NULL, NULL, NULL },
#else
- {notsupp_steal_pages, notsupp_clock, notsupp_mchk, notsupp_memerr,
- notsupp_conf},
+ {notsupp_steal_pages, NULL, NULL, NULL, NULL },
#endif
#ifdef VAX630 /* Type 8, KA630 or KA410 (uVAX II) */
{uvaxII_steal_pages, uvaxII_clock, uvaxII_mchk, uvaxII_memerr,
uvaxII_conf},
#else
- {notsupp_steal_pages, notsupp_clock, notsupp_mchk, notsupp_memerr,
- notsupp_conf},
+ {notsupp_steal_pages, NULL, NULL, NULL, NULL },
#endif
/* Type 9, not used */
- {notsupp_steal_pages, notsupp_clock, notsupp_mchk, notsupp_memerr,
- notsupp_conf},
+ {notsupp_steal_pages, NULL, NULL, NULL, NULL },
#ifdef VAX650 /* Type 10, KA65X (uVAX III) */
{uvaxIII_steal_pages, uvaxIII_clock, uvaxIII_mchk, uvaxIII_memerr,
uvaxIII_conf},
#else
- {notsupp_steal_pages, notsupp_clock, notsupp_mchk, notsupp_memerr,
- notsupp_conf},
+ {notsupp_steal_pages, NULL, NULL, NULL, NULL },
#endif
};
@@ -178,30 +159,6 @@ notsupp_steal_pages()
asm("halt");
}
-void
-notsupp_conf(dev, dev2, a)
- void *dev, *dev2, *a;
-{
-}
-
-int
-notsupp_clock()
-{
- return 0;
-}
-
-void
-notsupp_memerr()
-{
-}
-
-int
-notsupp_mchk(a)
- caddr_t a;
-{
- return 0;
-}
-
void gencnslask __P((void));
void
diff --git a/sys/arch/vax/vax/clock.c b/sys/arch/vax/vax/clock.c
index 8de6a4ca178..3a1a717edcb 100644
--- a/sys/arch/vax/vax/clock.c
+++ b/sys/arch/vax/vax/clock.c
@@ -1,4 +1,4 @@
-/* $NetBSD: clock.c,v 1.13 1996/04/08 18:32:27 ragge Exp $ */
+/* $NetBSD: clock.c,v 1.14 1996/05/19 16:43:57 ragge Exp $ */
/*
* Copyright (c) 1995 Ludd, University of Lule}, Sweden.
* All rights reserved.
@@ -33,6 +33,7 @@
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/systm.h>
+#include <sys/device.h>
#include <machine/mtpr.h>
#include <machine/sid.h>
diff --git a/sys/arch/vax/vax/conf.c b/sys/arch/vax/vax/conf.c
index 467f5c05132..ce5e911fb86 100644
--- a/sys/arch/vax/vax/conf.c
+++ b/sys/arch/vax/vax/conf.c
@@ -45,6 +45,10 @@
int ttselect __P((dev_t, int, struct proc *));
+#ifndef LKM
+#define lkmenodev enodev
+#endif
+
#include "hp.h" /* 0 */
bdev_decl(hp);
@@ -199,6 +203,11 @@ cdev_decl(pts);
#define ptcioctl ptyioctl
cdev_decl(ptc);
cdev_decl(log);
+#ifdef LKM
+#define NLKM 1
+#else
+#define NLKM 0
+#endif
cdev_decl(lkm);
cdev_decl(hp);
diff --git a/sys/arch/vax/vax/disksubr.c b/sys/arch/vax/vax/disksubr.c
index a81294004b7..411b5b3f1ab 100644
--- a/sys/arch/vax/vax/disksubr.c
+++ b/sys/arch/vax/vax/disksubr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: disksubr.c,v 1.9 1996/04/08 18:32:35 ragge Exp $ */
+/* $NetBSD: disksubr.c,v 1.10 1996/05/19 16:44:02 ragge Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -41,7 +41,6 @@
#include <sys/dkbad.h>
#include <sys/disklabel.h>
#include <sys/syslog.h>
-#include <sys/cpu.h>
#include <machine/macros.h>
diff --git a/sys/arch/vax/vax/locore.c b/sys/arch/vax/vax/locore.c
index fe4b6ed8092..100dd6bd794 100644
--- a/sys/arch/vax/vax/locore.c
+++ b/sys/arch/vax/vax/locore.c
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.c,v 1.14 1996/04/08 18:32:46 ragge Exp $ */
+/* $NetBSD: locore.c,v 1.15 1996/05/19 16:44:07 ragge Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -36,6 +36,7 @@
#include <sys/param.h>
#include <sys/types.h>
#include <sys/reboot.h>
+#include <sys/device.h>
#include <vm/vm.h>
@@ -43,7 +44,6 @@
#include <machine/cpu.h>
#include <machine/sid.h>
-#include <machine/uvaxII.h>
#include <machine/param.h>
#include <machine/vmparam.h>
#include <machine/pcb.h>
diff --git a/sys/arch/vax/vax/machdep.c b/sys/arch/vax/vax/machdep.c
index f00e302cca6..2cdc6cdc5d0 100644
--- a/sys/arch/vax/vax/machdep.c
+++ b/sys/arch/vax/vax/machdep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.29 1996/04/08 18:32:47 ragge Exp $ */
+/* $NetBSD: machdep.c,v 1.30 1996/05/19 16:44:13 ragge Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -63,7 +63,6 @@
#include <sys/device.h>
#include <sys/exec.h>
#include <sys/mount.h>
-#include <sys/cpu.h>
#include <sys/syscallargs.h>
#include <sys/ptrace.h>
#ifdef SYSVMSG
@@ -112,7 +111,7 @@
#endif
void netintr __P((void));
-void machinecheck __P((u_int));
+void machinecheck __P((caddr_t));
void cmrerr __P((void));
extern int virtual_avail, virtual_end;
@@ -530,10 +529,6 @@ boot(howto)
{
showto = howto;
if ((howto & RB_NOSYNC) == 0 && waittime < 0) {
- extern struct proc proc0;
- /* allow safe curproc referencies */
- if (curproc == NULL)
- curproc = &proc0;
waittime = 0;
vfs_shutdown();
/*
@@ -638,7 +633,7 @@ netintr()
void
machinecheck(frame)
- u_int frame;
+ caddr_t frame;
{
if ((*cpu_calls[cpunumber].cpu_mchk) (frame) == 0)
return;
diff --git a/sys/arch/vax/vax/pmap.c b/sys/arch/vax/vax/pmap.c
index 54a61b57004..6bb529719f3 100644
--- a/sys/arch/vax/vax/pmap.c
+++ b/sys/arch/vax/vax/pmap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.26 1996/04/08 18:32:53 ragge Exp $ */
+/* $NetBSD: pmap.c,v 1.27 1996/05/19 16:44:20 ragge Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
* All rights reserved.
@@ -37,6 +37,7 @@
#include <sys/user.h>
#include <sys/msgbuf.h>
#include <sys/systm.h>
+#include <sys/device.h>
#include <vm/vm.h>
#include <vm/vm_page.h>
@@ -47,7 +48,6 @@
#include <machine/mtpr.h>
#include <machine/macros.h>
#include <machine/sid.h>
-#include <machine/uvaxII.h>
#include <machine/cpu.h>
#include <machine/scb.h>
diff --git a/sys/arch/vax/vax/trap.c b/sys/arch/vax/vax/trap.c
index 906be1f8aa7..d81c18dad76 100644
--- a/sys/arch/vax/vax/trap.c
+++ b/sys/arch/vax/vax/trap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.20 1996/04/08 18:32:58 ragge Exp $ */
+/* $NetBSD: trap.c,v 1.21 1996/05/19 16:44:27 ragge Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -42,7 +42,6 @@
#include <sys/systm.h>
#include <sys/signalvar.h>
#include <sys/exec.h>
-#include <sys/cpu.h>
#include <vm/vm.h>
#include <vm/vm_kern.h>
diff --git a/sys/arch/vax/vax/vm_machdep.c b/sys/arch/vax/vax/vm_machdep.c
index 426252e664b..04e20a0e1cb 100644
--- a/sys/arch/vax/vax/vm_machdep.c
+++ b/sys/arch/vax/vax/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vm_machdep.c,v 1.24 1996/04/08 18:33:01 ragge Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.25 1996/05/19 16:44:33 ragge Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -41,7 +41,7 @@
#include <sys/vnode.h>
#include <sys/core.h>
#include <sys/mount.h>
-#include <sys/cpu.h>
+#include <sys/device.h>
#include <vm/vm.h>
#include <vm/vm_kern.h>