New device attachment scheme:
- split softc size and match/attach out from cfdriver into a new struct cfattach. - new "attach" directive for files.*. May specify the name of the cfattach structure, so that devices may be easily attached to parents with different autoconfiguration semantics.
This commit is contained in:
parent
82d914d090
commit
77abd102b7
@ -1,4 +1,4 @@
|
||||
# $NetBSD: files.pc532,v 1.19 1996/03/11 23:09:11 phil Exp $
|
||||
# $NetBSD: files.pc532,v 1.20 1996/03/17 01:38:52 thorpej Exp $
|
||||
#
|
||||
# new style config file for pc532 architecture
|
||||
#
|
||||
@ -8,22 +8,28 @@ maxpartitions 8
|
||||
|
||||
maxusers 2 16 64
|
||||
|
||||
device membus at root {[addr = -1], [irq = -1]}
|
||||
device membus {[addr = -1], [irq = -1]}
|
||||
attach membus at root
|
||||
|
||||
major {vnd = 5}
|
||||
|
||||
device rd at membus: disk
|
||||
device rd: disk
|
||||
attach rd at membus
|
||||
file arch/pc532/dev/rd.c rd needs-count
|
||||
major {rd = 3}
|
||||
|
||||
#device timer at membus
|
||||
#device clock at membus
|
||||
#device timer
|
||||
#attach timer at membus
|
||||
#device clock
|
||||
#attach clock at membus
|
||||
file arch/pc532/pc532/clock.c # clock timer
|
||||
|
||||
device scn at membus: tty
|
||||
device scn: tty
|
||||
attach scn at membus
|
||||
file arch/pc532/dev/scn.c scn needs-flag
|
||||
|
||||
device lpt at membus: ether, ifnet
|
||||
device lpt: ether, ifnet
|
||||
attach lpt at membus
|
||||
file arch/pc532/dev/lpt.c lpt needs-count
|
||||
|
||||
include "../../../scsi/files.scsi"
|
||||
@ -31,13 +37,17 @@ major {sd = 0}
|
||||
major {st = 2}
|
||||
major {cd = 4}
|
||||
|
||||
device ncr at membus: scsi, ncr5380sbc
|
||||
device ncr: scsi, ncr5380sbc
|
||||
attach ncr at membus
|
||||
file arch/pc532/dev/ncr.c ncr needs-count
|
||||
device oldncr at membus: scsi
|
||||
device oldncr: scsi
|
||||
attach oldncr at membus
|
||||
file arch/pc532/dev/oldncr.c oldncr needs-count
|
||||
device dp at membus: scsi
|
||||
device dp: scsi
|
||||
attach dp at membus
|
||||
file arch/pc532/dev/dp.c dp needs-count
|
||||
device aic at membus: scsi
|
||||
device aic: scsi
|
||||
attach aic at membus
|
||||
file arch/pc532/dev/aic.c aic needs-count
|
||||
|
||||
file dev/cons.c
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lpt.c,v 1.7 1995/11/30 00:58:45 jtc Exp $ */
|
||||
/* $NetBSD: lpt.c,v 1.8 1996/03/17 01:38:56 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Matthias Pfaller.
|
||||
@ -179,15 +179,12 @@ static void plipstart(struct ifnet *);
|
||||
static void plipoutput(struct lpt_softc *);
|
||||
#endif
|
||||
|
||||
struct cfdriver lptcd = {
|
||||
NULL,
|
||||
"lpt",
|
||||
lptmatch,
|
||||
lptattach,
|
||||
DV_TTY,
|
||||
sizeof(struct lpt_softc),
|
||||
NULL,
|
||||
0
|
||||
struct cfattach lpt_ca = {
|
||||
sizeof(struct lpt_softc), lptmatch, lptattach
|
||||
};
|
||||
|
||||
struct cfdriver lpt_cd = {
|
||||
NULL, "lpt", DV_TTY, NULL, 0
|
||||
};
|
||||
|
||||
lptmatch(struct device *parent, void *cf, void *aux)
|
||||
@ -255,7 +252,7 @@ lptattach(struct device *parent, struct device *self, void *aux)
|
||||
int
|
||||
lptopen(dev_t dev, int flag)
|
||||
{
|
||||
struct lpt_softc *sc = (struct lpt_softc *) lptcd.cd_devs[LPTUNIT(dev)];
|
||||
struct lpt_softc *sc = (struct lpt_softc *) lpt_cd.cd_devs[LPTUNIT(dev)];
|
||||
volatile struct i8255 *i8255 = sc->sc_i8255;
|
||||
u_char flags = LPTFLAGS(dev);
|
||||
int error;
|
||||
@ -344,7 +341,7 @@ lptout(void *arg)
|
||||
*/
|
||||
lptclose(dev_t dev, int flag)
|
||||
{
|
||||
struct lpt_softc *sc = (struct lpt_softc *) lptcd.cd_devs[LPTUNIT(dev)];
|
||||
struct lpt_softc *sc = (struct lpt_softc *) lpt_cd.cd_devs[LPTUNIT(dev)];
|
||||
|
||||
if (sc->sc_count)
|
||||
(void) pushbytes(sc);
|
||||
@ -377,7 +374,7 @@ pushbytes(struct lpt_softc *sc)
|
||||
*/
|
||||
lptwrite(dev_t dev, struct uio *uio)
|
||||
{
|
||||
struct lpt_softc *sc = (struct lpt_softc *) lptcd.cd_devs[LPTUNIT(dev)];
|
||||
struct lpt_softc *sc = (struct lpt_softc *) lpt_cd.cd_devs[LPTUNIT(dev)];
|
||||
size_t n;
|
||||
int error = 0;
|
||||
|
||||
@ -489,7 +486,7 @@ static int
|
||||
plipioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
{
|
||||
struct proc *p = curproc;
|
||||
struct lpt_softc *sc = (struct lpt_softc *) lptcd.cd_devs[ifp->if_unit];
|
||||
struct lpt_softc *sc = (struct lpt_softc *) lpt_cd.cd_devs[ifp->if_unit];
|
||||
volatile struct i8255 *i8255 = sc->sc_i8255;
|
||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||
struct ifreq *ifr = (struct ifreq *)data;
|
||||
@ -764,7 +761,7 @@ pliptransmit(volatile struct i8255 *i8255, u_char *buf, int len)
|
||||
static void
|
||||
plipstart(struct ifnet *ifp)
|
||||
{
|
||||
struct lpt_softc *sc = (struct lpt_softc *) lptcd.cd_devs[ifp->if_unit];
|
||||
struct lpt_softc *sc = (struct lpt_softc *) lpt_cd.cd_devs[ifp->if_unit];
|
||||
sc->sc_pending |= PLIP_OPENDING;
|
||||
softintr(sc->sc_ifsoftint);
|
||||
}
|
||||
|
@ -73,9 +73,12 @@ struct scsi_device ncr_dev = {
|
||||
NULL /* Use default done routine */
|
||||
};
|
||||
|
||||
struct cfdriver ncrcd = {
|
||||
NULL, "ncr", ncr_match, ncr_attach,
|
||||
DV_DULL, sizeof(struct ncr5380_softc), NULL, 0,
|
||||
struct cfattach ncr_ca = {
|
||||
sizeof(struct ncr5380_softc), ncr_match, ncr_attach
|
||||
};
|
||||
|
||||
struct cfdriver ncr_cd = {
|
||||
NULL, "ncr", DV_DULL, NULL, 0,
|
||||
};
|
||||
|
||||
static int
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: oldncr.c,v 1.2 1995/08/27 04:07:54 phil Exp $ */
|
||||
/* $NetBSD: oldncr.c,v 1.3 1996/03/17 01:39:01 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1993 Allen K. Briggs, Chris P. Caputo,
|
||||
@ -163,9 +163,13 @@ extern int matchbyname();
|
||||
static int ncrprobe();
|
||||
static void ncrattach();
|
||||
|
||||
struct cfdriver oldncrcd =
|
||||
{ NULL, "ncr", ncrprobe, ncrattach,
|
||||
DV_DULL, sizeof(struct ncr5380_softc), NULL, 0 };
|
||||
struct cfdriver oldncr_ca = {
|
||||
sizeof(struct ncr5380_softc), ncrprobe, ncrattach
|
||||
};
|
||||
|
||||
struct cfdriver oldncr_cd = {
|
||||
NULL, "ncr", DV_DULL, NULL, 0
|
||||
};
|
||||
|
||||
static int
|
||||
ncrprobe(parent, self, aux)
|
||||
|
@ -27,7 +27,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: rd.c,v 1.2 1996/01/07 22:02:46 thorpej Exp $
|
||||
* $Id: rd.c,v 1.3 1996/03/17 01:39:02 thorpej Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -46,15 +46,12 @@ struct rdsoftc {
|
||||
struct disk sc_dkdev; /* generic disk glue */
|
||||
};
|
||||
|
||||
struct cfdriver rdcd = {
|
||||
NULL,
|
||||
"rd",
|
||||
rdmatch,
|
||||
rdattach,
|
||||
DV_DISK,
|
||||
sizeof(struct rdsoftc),
|
||||
NULL,
|
||||
0
|
||||
struct cfattach rd_ca = {
|
||||
sizeof(struct rdsoftc), rdmatch, rdattach
|
||||
};
|
||||
|
||||
struct cfdriver rd_cd = {
|
||||
NULL, "rd", DV_DISK, NULL, 0
|
||||
};
|
||||
|
||||
void rdstrategy __P((struct buf *));
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: scn.c,v 1.25 1996/02/02 18:06:57 mycroft Exp $ */
|
||||
/* $NetBSD: scn.c,v 1.26 1996/03/17 01:39:04 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1991 The Regents of the University of California.
|
||||
@ -89,9 +89,13 @@ void scnstart __P((struct tty *));
|
||||
int scnopen __P((dev_t, int, int, struct proc *));
|
||||
int scnclose __P((dev_t, int, int, struct proc *));
|
||||
|
||||
struct cfdriver scncd =
|
||||
{ NULL, "scn", scnprobe, scnattach,
|
||||
DV_TTY, sizeof(struct scn_softc), NULL, 0 };
|
||||
struct cfattach scn_ca = {
|
||||
sizeof(struct scn_softc), scnprobe, scnattach
|
||||
};
|
||||
|
||||
struct cfdriver scn_cd = {
|
||||
NULL, "scn", DV_TTY, NULL, 0
|
||||
};
|
||||
|
||||
/* int scnsoftCAR;
|
||||
int scn_active; To Be Deleted ... */
|
||||
@ -199,9 +203,9 @@ int data_bits; /* 5, 6, 7, or 8 */
|
||||
return (EINVAL);
|
||||
|
||||
/* Set up rs pointer. */
|
||||
if (unit >= scncd.cd_ndevs)
|
||||
if (unit >= scn_cd.cd_ndevs)
|
||||
return ENXIO;
|
||||
rs = &((struct scn_softc *)scncd.cd_devs[unit])->scn_line;
|
||||
rs = &((struct scn_softc *)scn_cd.cd_devs[unit])->scn_line;
|
||||
a_or_b = rs->a_or_b;
|
||||
|
||||
/* Check out the Speeds. There are two groups of speeds. If the new
|
||||
@ -447,9 +451,9 @@ scnopen(dev_t dev, int flag, int mode, struct proc *p)
|
||||
int x;
|
||||
|
||||
/* Set up rs pointer. */
|
||||
if (unit >= scncd.cd_ndevs)
|
||||
if (unit >= scn_cd.cd_ndevs)
|
||||
return ENXIO;
|
||||
sc = scncd.cd_devs[unit];
|
||||
sc = scn_cd.cd_devs[unit];
|
||||
if (!sc)
|
||||
return ENXIO;
|
||||
rs = &sc->scn_line;
|
||||
@ -517,7 +521,7 @@ scnclose(dev, flag, mode, p)
|
||||
struct proc *p;
|
||||
{
|
||||
register int unit = UNIT(dev);
|
||||
struct scn_softc *sc = scncd.cd_devs[unit];
|
||||
struct scn_softc *sc = scn_cd.cd_devs[unit];
|
||||
register struct tty *tp = sc->scn_tty;
|
||||
register struct rs232_s *rs = &sc->scn_line;
|
||||
|
||||
@ -548,7 +552,7 @@ scnread(dev, uio, flag)
|
||||
dev_t dev;
|
||||
struct uio *uio;
|
||||
{
|
||||
register struct scn_softc *sc = scncd.cd_devs[UNIT(dev)];
|
||||
register struct scn_softc *sc = scn_cd.cd_devs[UNIT(dev)];
|
||||
register struct tty *tp = sc->scn_tty;
|
||||
|
||||
return ((*linesw[tp->t_line].l_read)(tp, uio, flag));
|
||||
@ -558,7 +562,7 @@ scnwrite(dev, uio, flag)
|
||||
dev_t dev;
|
||||
struct uio *uio;
|
||||
{
|
||||
register struct scn_softc *sc = scncd.cd_devs[UNIT(dev)];
|
||||
register struct scn_softc *sc = scn_cd.cd_devs[UNIT(dev)];
|
||||
register struct tty *tp = sc->scn_tty;
|
||||
|
||||
return ((*linesw[tp->t_line].l_write)(tp, uio, flag));
|
||||
@ -568,7 +572,7 @@ struct tty *
|
||||
scntty(dev)
|
||||
dev_t dev;
|
||||
{
|
||||
register struct scn_softc *sc = scncd.cd_devs[UNIT(dev)];
|
||||
register struct scn_softc *sc = scn_cd.cd_devs[UNIT(dev)];
|
||||
register struct tty *tp = sc->scn_tty;
|
||||
|
||||
return (tp);
|
||||
@ -584,8 +588,8 @@ scnintr(int uart_no)
|
||||
int line0 = uart_no << 1;
|
||||
int line1 = (uart_no << 1)+1;
|
||||
|
||||
register struct scn_softc *sc0 = scncd.cd_devs[line0];
|
||||
register struct scn_softc *sc1 = scncd.cd_devs[line1];
|
||||
register struct scn_softc *sc0 = scn_cd.cd_devs[line0];
|
||||
register struct scn_softc *sc1 = scn_cd.cd_devs[line1];
|
||||
|
||||
register struct tty *tp0 = sc0->scn_tty;
|
||||
register struct tty *tp1 = sc1->scn_tty;
|
||||
@ -632,8 +636,8 @@ _scnintr(int uart_no)
|
||||
scnintr(int line1)
|
||||
#endif
|
||||
{
|
||||
register struct scn_softc *sc0 = scncd.cd_devs[line1 - 1];
|
||||
register struct scn_softc *sc1 = scncd.cd_devs[line1];
|
||||
register struct scn_softc *sc0 = scn_cd.cd_devs[line1 - 1];
|
||||
register struct scn_softc *sc1 = scn_cd.cd_devs[line1];
|
||||
|
||||
register struct tty *tp0 = sc0->scn_tty;
|
||||
register struct tty *tp1 = sc1->scn_tty;
|
||||
@ -762,7 +766,7 @@ scnioctl(dev, cmd, data, flag, p)
|
||||
struct proc *p;
|
||||
{
|
||||
register int unit = UNIT(dev);
|
||||
register struct scn_softc *sc = scncd.cd_devs[unit];
|
||||
register struct scn_softc *sc = scn_cd.cd_devs[unit];
|
||||
register struct tty *tp = sc->scn_tty;
|
||||
register struct rs232_s *rs = &sc->scn_line;
|
||||
register scn;
|
||||
@ -864,7 +868,7 @@ scnparam(tp, t)
|
||||
{
|
||||
int cflag = t->c_cflag;
|
||||
int unit = UNIT(tp->t_dev);
|
||||
register struct scn_softc *sc = scncd.cd_devs[unit];
|
||||
register struct scn_softc *sc = scn_cd.cd_devs[unit];
|
||||
int parity = LC_NONE,
|
||||
stop_bits = LC_STOP1,
|
||||
data_bits = LC_BITS8;
|
||||
@ -922,7 +926,7 @@ scnstart(tp)
|
||||
{
|
||||
int s, c;
|
||||
int unit = UNIT(tp->t_dev);
|
||||
register struct scn_softc *sc = scncd.cd_devs[unit];
|
||||
register struct scn_softc *sc = scn_cd.cd_devs[unit];
|
||||
struct rs232_s *rs = &sc->scn_line;
|
||||
|
||||
s = spltty();
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: autoconf.c,v 1.16 1995/12/28 19:16:55 thorpej Exp $ */
|
||||
/* $NetBSD: autoconf.c,v 1.17 1996/03/17 01:39:07 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@ -204,9 +204,13 @@ setroot()
|
||||
static int membusprobe();
|
||||
static void membusattach();
|
||||
|
||||
struct cfdriver membuscd =
|
||||
{ NULL, "membus", membusprobe, membusattach,
|
||||
DV_DULL, sizeof(struct device), NULL, 0 };
|
||||
struct cfattach membus_ca = {
|
||||
sizeof(struct device), membusprobe, membusattach
|
||||
};
|
||||
|
||||
struct cfdriver membus_cd = {
|
||||
NULL, "membus", DV_DULL, NULL, 0
|
||||
};
|
||||
|
||||
static int
|
||||
membusprobe(parent, cf, aux)
|
||||
|
@ -1,26 +1,31 @@
|
||||
# $NetBSD: files.pica,v 1.1.1.1 1996/03/13 04:58:05 jonathan Exp $
|
||||
# $NetBSD: files.pica,v 1.2 1996/03/17 01:42:04 thorpej Exp $
|
||||
maxpartitions 8
|
||||
maxusers 2 8 64
|
||||
|
||||
device mainbus at root { } # no locators
|
||||
device mainbus { } # no locators
|
||||
attach mainbus at root
|
||||
|
||||
# Our CPU configurator
|
||||
device cpu at mainbus # not optional
|
||||
device cpu # not optional
|
||||
attach cpu at mainbus
|
||||
file arch/pica/pica/cpu.c cpu
|
||||
|
||||
#
|
||||
# PICA bus autoconfiguration devices
|
||||
#
|
||||
device pica at mainbus { } # { slot = -1, offset = -1 }
|
||||
device pica { } # { slot = -1, offset = -1 }
|
||||
attach pica at mainbus
|
||||
file arch/pica/pica/pica.c pica needs-flag
|
||||
|
||||
# Real time clock, must have one..
|
||||
device clock at pica
|
||||
device clock
|
||||
attach clock at pica
|
||||
file arch/pica/pica/clock.c clock
|
||||
file arch/pica/pica/clock_mc.c clock
|
||||
|
||||
# Ethernet chip
|
||||
device sn at pica: ifnet, ether
|
||||
device sn: ifnet, ether
|
||||
attach sn at pica
|
||||
file arch/pica/dev/if_sn.c sn needs-count
|
||||
|
||||
# Use machine independent SCSI driver routines
|
||||
@ -29,27 +34,34 @@ major {sd = 0}
|
||||
major {cd = 3}
|
||||
|
||||
# Machine dependent SCSI interface driver
|
||||
device asc at pica: scsi
|
||||
device asc: scsi
|
||||
attach asc at pica
|
||||
file arch/pica/dev/asc.c asc needs-count
|
||||
|
||||
# NS16450/16550 Serial line driver
|
||||
device com at pica
|
||||
device com
|
||||
attach com at pica
|
||||
file arch/pica/dev/com.c com needs-count
|
||||
|
||||
# Paralell printer port driver
|
||||
device lpt at pica
|
||||
device lpt
|
||||
attach lpt at pica
|
||||
file arch/pica/dev/lpt.c lpt needs-count
|
||||
|
||||
# Console driver on PC-style graphics
|
||||
device pc at pica
|
||||
device pms at pica
|
||||
device pc
|
||||
attach pc at pica
|
||||
device pms
|
||||
attach pms at pica
|
||||
file arch/pica/dev/pccons.c pc pms needs-count
|
||||
|
||||
# PS2 type mouse driver.
|
||||
|
||||
# Floppy disk controller
|
||||
device fdc at pica {drive = -1}
|
||||
device fd at fdc
|
||||
device fdc {drive = -1}
|
||||
attach fdc at pica
|
||||
device fd
|
||||
attach fd at fdc
|
||||
file arch/pica/dev/fd.c fdc needs-flag
|
||||
major {fd = 7}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: asc.c,v 1.1.1.1 1996/03/13 04:58:05 jonathan Exp $ */
|
||||
/* $NetBSD: asc.c,v 1.2 1996/03/17 01:42:07 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -443,9 +443,13 @@ int ascprint(void *, char *);
|
||||
|
||||
int asc_doprobe __P((void *, int, int, struct device *));
|
||||
|
||||
extern struct cfdriver asccd;
|
||||
struct cfdriver asccd = {
|
||||
NULL, "asc", ascmatch, ascattach, DV_DULL, sizeof(struct asc_softc), 0
|
||||
struct cfattach asc_ca = {
|
||||
sizeof(struct asc_softc), ascmatch, ascattach
|
||||
};
|
||||
|
||||
extern struct cfdriver asc_cd;
|
||||
struct cfdriver asc_cd = {
|
||||
NULL, "asc", DV_DULL, 0
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: com.c,v 1.1.1.1 1996/03/13 04:58:05 jonathan Exp $ */
|
||||
/* $NetBSD: com.c,v 1.2 1996/03/17 01:42:10 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1993, 1994, 1995 Charles M. Hannum. All rights reserved.
|
||||
@ -101,8 +101,12 @@ void compoll __P((void *));
|
||||
int comparam __P((struct tty *, struct termios *));
|
||||
void comstart __P((struct tty *));
|
||||
|
||||
struct cfdriver comcd = {
|
||||
NULL, "com", commatch, comattach, DV_TTY, sizeof(struct com_softc)
|
||||
struct cfattach com_ca = {
|
||||
sizeof(struct com_softc), commatch, comattach
|
||||
};
|
||||
|
||||
struct cfdriver com_cd = {
|
||||
NULL, "com", DV_TTY
|
||||
};
|
||||
|
||||
int comdefaultrate = TTYDEF_SPEED;
|
||||
@ -270,9 +274,9 @@ comopen(dev, flag, mode, p)
|
||||
int s;
|
||||
int error = 0;
|
||||
|
||||
if (unit >= comcd.cd_ndevs)
|
||||
if (unit >= com_cd.cd_ndevs)
|
||||
return ENXIO;
|
||||
sc = comcd.cd_devs[unit];
|
||||
sc = com_cd.cd_devs[unit];
|
||||
if (!sc)
|
||||
return ENXIO;
|
||||
|
||||
@ -365,7 +369,7 @@ comclose(dev, flag, mode, p)
|
||||
struct proc *p;
|
||||
{
|
||||
int unit = COMUNIT(dev);
|
||||
struct com_softc *sc = comcd.cd_devs[unit];
|
||||
struct com_softc *sc = com_cd.cd_devs[unit];
|
||||
struct tty *tp = sc->sc_tty;
|
||||
long iobase = sc->sc_iobase;
|
||||
int s;
|
||||
@ -403,7 +407,7 @@ comread(dev, uio, flag)
|
||||
struct uio *uio;
|
||||
int flag;
|
||||
{
|
||||
struct com_softc *sc = comcd.cd_devs[COMUNIT(dev)];
|
||||
struct com_softc *sc = com_cd.cd_devs[COMUNIT(dev)];
|
||||
struct tty *tp = sc->sc_tty;
|
||||
|
||||
return ((*linesw[tp->t_line].l_read)(tp, uio, flag));
|
||||
@ -415,7 +419,7 @@ comwrite(dev, uio, flag)
|
||||
struct uio *uio;
|
||||
int flag;
|
||||
{
|
||||
struct com_softc *sc = comcd.cd_devs[COMUNIT(dev)];
|
||||
struct com_softc *sc = com_cd.cd_devs[COMUNIT(dev)];
|
||||
struct tty *tp = sc->sc_tty;
|
||||
|
||||
return ((*linesw[tp->t_line].l_write)(tp, uio, flag));
|
||||
@ -425,7 +429,7 @@ struct tty *
|
||||
comtty(dev)
|
||||
dev_t dev;
|
||||
{
|
||||
struct com_softc *sc = comcd.cd_devs[COMUNIT(dev)];
|
||||
struct com_softc *sc = com_cd.cd_devs[COMUNIT(dev)];
|
||||
struct tty *tp = sc->sc_tty;
|
||||
|
||||
return (tp);
|
||||
@ -453,7 +457,7 @@ comioctl(dev, cmd, data, flag, p)
|
||||
struct proc *p;
|
||||
{
|
||||
int unit = COMUNIT(dev);
|
||||
struct com_softc *sc = comcd.cd_devs[unit];
|
||||
struct com_softc *sc = com_cd.cd_devs[unit];
|
||||
struct tty *tp = sc->sc_tty;
|
||||
long iobase = sc->sc_iobase;
|
||||
int error;
|
||||
@ -559,7 +563,7 @@ comparam(tp, t)
|
||||
struct tty *tp;
|
||||
struct termios *t;
|
||||
{
|
||||
struct com_softc *sc = comcd.cd_devs[COMUNIT(tp->t_dev)];
|
||||
struct com_softc *sc = com_cd.cd_devs[COMUNIT(tp->t_dev)];
|
||||
long iobase = sc->sc_iobase;
|
||||
int ospeed = comspeed(t->c_ospeed);
|
||||
u_char cfcr;
|
||||
@ -655,7 +659,7 @@ void
|
||||
comstart(tp)
|
||||
struct tty *tp;
|
||||
{
|
||||
struct com_softc *sc = comcd.cd_devs[COMUNIT(tp->t_dev)];
|
||||
struct com_softc *sc = com_cd.cd_devs[COMUNIT(tp->t_dev)];
|
||||
long iobase = sc->sc_iobase;
|
||||
int s;
|
||||
|
||||
@ -751,8 +755,8 @@ compoll(arg)
|
||||
comevents = 0;
|
||||
splx(s);
|
||||
|
||||
for (unit = 0; unit < comcd.cd_ndevs; unit++) {
|
||||
sc = comcd.cd_devs[unit];
|
||||
for (unit = 0; unit < com_cd.cd_ndevs; unit++) {
|
||||
sc = com_cd.cd_devs[unit];
|
||||
if (sc == 0 || sc->sc_ibufp == sc->sc_ibuf)
|
||||
continue;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: fd.c,v 1.1.1.1 1996/03/13 04:58:06 jonathan Exp $ */
|
||||
/* $NetBSD: fd.c,v 1.2 1996/03/17 01:42:12 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1993, 1994, 1995 Charles Hannum.
|
||||
@ -106,8 +106,12 @@ struct fdc_softc {
|
||||
int fdcprobe __P((struct device *, void *, void *));
|
||||
void fdcattach __P((struct device *, struct device *, void *));
|
||||
|
||||
struct cfdriver fdccd = {
|
||||
NULL, "fdc", fdcprobe, fdcattach, DV_DULL, sizeof(struct fdc_softc)
|
||||
struct cfattach fdc_ca = {
|
||||
sizeof(struct fdc_softc), fdcprobe, fdcattach
|
||||
};
|
||||
|
||||
struct cfdriver fdc_cd = {
|
||||
NULL, "fdc", DV_DULL
|
||||
};
|
||||
|
||||
/*
|
||||
@ -173,8 +177,12 @@ struct fd_softc {
|
||||
int fdprobe __P((struct device *, void *, void *));
|
||||
void fdattach __P((struct device *, struct device *, void *));
|
||||
|
||||
struct cfdriver fdcd = {
|
||||
NULL, "fd", fdprobe, fdattach, DV_DISK, sizeof(struct fd_softc)
|
||||
struct cfattach fd_cd = {
|
||||
sizeof(struct fd_softc), fdprobe, fdattach
|
||||
};
|
||||
|
||||
struct cfdriver fd_cd = {
|
||||
NULL, "fd", DV_DISK
|
||||
};
|
||||
|
||||
void fdgetdisklabel __P((struct fd_softc *));
|
||||
@ -424,8 +432,8 @@ fdstrategy(bp)
|
||||
int s;
|
||||
|
||||
/* Valid unit, controller, and request? */
|
||||
if (unit >= fdcd.cd_ndevs ||
|
||||
(fd = fdcd.cd_devs[unit]) == 0 ||
|
||||
if (unit >= fd_cd.cd_ndevs ||
|
||||
(fd = fd_cd.cd_devs[unit]) == 0 ||
|
||||
bp->b_blkno < 0 ||
|
||||
(bp->b_bcount % FDC_BSIZE) != 0) {
|
||||
bp->b_error = EINVAL;
|
||||
@ -652,9 +660,9 @@ Fdopen(dev, flags)
|
||||
struct fd_type *type;
|
||||
|
||||
unit = FDUNIT(dev);
|
||||
if (unit >= fdcd.cd_ndevs)
|
||||
if (unit >= fd_cd.cd_ndevs)
|
||||
return ENXIO;
|
||||
fd = fdcd.cd_devs[unit];
|
||||
fd = fd_cd.cd_devs[unit];
|
||||
if (fd == 0)
|
||||
return ENXIO;
|
||||
type = fd_dev_to_type(fd, dev);
|
||||
@ -677,7 +685,7 @@ fdclose(dev, flags)
|
||||
dev_t dev;
|
||||
int flags;
|
||||
{
|
||||
struct fd_softc *fd = fdcd.cd_devs[FDUNIT(dev)];
|
||||
struct fd_softc *fd = fd_cd.cd_devs[FDUNIT(dev)];
|
||||
|
||||
fd->sc_flags &= ~FD_OPEN;
|
||||
return 0;
|
||||
@ -1087,7 +1095,7 @@ fdioctl(dev, cmd, addr, flag)
|
||||
caddr_t addr;
|
||||
int flag;
|
||||
{
|
||||
struct fd_softc *fd = fdcd.cd_devs[FDUNIT(dev)];
|
||||
struct fd_softc *fd = fd_cd.cd_devs[FDUNIT(dev)];
|
||||
struct disklabel buffer;
|
||||
int error;
|
||||
|
||||
|
@ -116,8 +116,12 @@ struct sn_softc {
|
||||
int snmatch __P((struct device *, void *, void *));
|
||||
void snattach __P((struct device *, struct device *, void *));
|
||||
|
||||
struct cfdriver sncd = {
|
||||
NULL, "sn", snmatch, snattach, DV_IFNET, sizeof(struct sn_softc)
|
||||
struct cfattach sn_ca = {
|
||||
sizeof(struct sn_softc), snmatch, snattach
|
||||
};
|
||||
|
||||
struct cfdriver sn_cd = {
|
||||
NULL, "sn", DV_IFNET
|
||||
};
|
||||
|
||||
#include <assert.h>
|
||||
@ -370,7 +374,7 @@ snioctl(ifp, cmd, data)
|
||||
caddr_t data;
|
||||
{
|
||||
struct ifaddr *ifa;
|
||||
struct sn_softc *sc = sncd.cd_devs[ifp->if_unit];
|
||||
struct sn_softc *sc = sn_cd.cd_devs[ifp->if_unit];
|
||||
int s = splnet(), err = 0;
|
||||
int temp;
|
||||
|
||||
@ -466,7 +470,7 @@ void
|
||||
snstart(ifp)
|
||||
struct ifnet *ifp;
|
||||
{
|
||||
struct sn_softc *sc = sncd.cd_devs[ifp->if_unit];
|
||||
struct sn_softc *sc = sn_cd.cd_devs[ifp->if_unit];
|
||||
struct mbuf *m;
|
||||
int len;
|
||||
|
||||
@ -525,7 +529,7 @@ int
|
||||
sninit(unit)
|
||||
int unit;
|
||||
{
|
||||
struct sn_softc *sc = sncd.cd_devs[unit];
|
||||
struct sn_softc *sc = sn_cd.cd_devs[unit];
|
||||
struct sonic_reg *csr = sc->sc_csr;
|
||||
int s, error;
|
||||
|
||||
@ -594,7 +598,7 @@ int
|
||||
snstop(unit)
|
||||
int unit;
|
||||
{
|
||||
struct sn_softc *sc = sncd.cd_devs[unit];
|
||||
struct sn_softc *sc = sn_cd.cd_devs[unit];
|
||||
struct mtd *mtd;
|
||||
int s = splnet();
|
||||
|
||||
@ -630,7 +634,7 @@ void
|
||||
snwatchdog(unit)
|
||||
int unit;
|
||||
{
|
||||
struct sn_softc *sc = sncd.cd_devs[unit];
|
||||
struct sn_softc *sc = sn_cd.cd_devs[unit];
|
||||
int temp;
|
||||
|
||||
if (mtdhead && mtdhead->mtd_mbuf) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lpt.c,v 1.1.1.1 1996/03/13 04:58:06 jonathan Exp $ */
|
||||
/* $NetBSD: lpt.c,v 1.2 1996/03/17 01:42:15 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993, 1994 Charles Hannum.
|
||||
@ -107,8 +107,12 @@ int lptprobe __P((struct device *, void *, void *));
|
||||
void lptattach __P((struct device *, struct device *, void *));
|
||||
int lptintr __P((void *));
|
||||
|
||||
struct cfdriver lptcd = {
|
||||
NULL, "lpt", lptprobe, lptattach, DV_TTY, sizeof(struct lpt_softc)
|
||||
struct cfattach lpt_ca = {
|
||||
sizeof(struct lpt_softc), lptprobe, lptattach
|
||||
};
|
||||
|
||||
struct cfdriver lpt_cd = {
|
||||
NULL, "lpt", DV_TTY
|
||||
};
|
||||
|
||||
#define LPTUNIT(s) (minor(s) & 0x1f)
|
||||
@ -251,9 +255,9 @@ lptopen(dev, flag)
|
||||
int error;
|
||||
int spin;
|
||||
|
||||
if (unit >= lptcd.cd_ndevs)
|
||||
if (unit >= lpt_cd.cd_ndevs)
|
||||
return ENXIO;
|
||||
sc = lptcd.cd_devs[unit];
|
||||
sc = lpt_cd.cd_devs[unit];
|
||||
if (!sc)
|
||||
return ENXIO;
|
||||
|
||||
@ -354,7 +358,7 @@ lptclose(dev, flag)
|
||||
int flag;
|
||||
{
|
||||
int unit = LPTUNIT(dev);
|
||||
struct lpt_softc *sc = lptcd.cd_devs[unit];
|
||||
struct lpt_softc *sc = lpt_cd.cd_devs[unit];
|
||||
int iobase = sc->sc_iobase;
|
||||
|
||||
if (sc->sc_count)
|
||||
@ -404,7 +408,7 @@ lptwrite(dev, uio)
|
||||
dev_t dev;
|
||||
struct uio *uio;
|
||||
{
|
||||
struct lpt_softc *sc = lptcd.cd_devs[LPTUNIT(dev)];
|
||||
struct lpt_softc *sc = lpt_cd.cd_devs[LPTUNIT(dev)];
|
||||
size_t n;
|
||||
int error = 0;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pccons.c,v 1.1.1.1 1996/03/13 04:58:06 jonathan Exp $ */
|
||||
/* $NetBSD: pccons.c,v 1.2 1996/03/17 01:42:18 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1993, 1994, 1995 Charles Hannum. All rights reserved.
|
||||
@ -141,16 +141,24 @@ int pcmatch __P((struct device *, void *, void *));
|
||||
void pcattach __P((struct device *, struct device *, void *));
|
||||
int pcintr __P((void *));
|
||||
|
||||
struct cfdriver pccd = {
|
||||
NULL, "pc", pcmatch, pcattach, DV_TTY, sizeof(struct pc_softc)
|
||||
struct cfattach pc_ca = {
|
||||
sizeof(struct pc_softc), pcmatch, pcattach
|
||||
};
|
||||
|
||||
struct cfdriver pc_cd = {
|
||||
NULL, "pc", DV_TTY
|
||||
};
|
||||
|
||||
int pmsprobe __P((struct device *, void *, void *));
|
||||
void pmsattach __P((struct device *, struct device *, void *));
|
||||
int pmsintr __P((void *));
|
||||
|
||||
struct cfdriver pmscd = {
|
||||
NULL, "pms", pmsprobe, pmsattach, DV_TTY, sizeof(struct pms_softc)
|
||||
struct cfattch pms_ca = {
|
||||
sizeof(struct pms_softc), pmsprobe, pmsattach
|
||||
};
|
||||
|
||||
struct cfdriver pms_cd = {
|
||||
NULL, "pms", DV_TTY
|
||||
};
|
||||
|
||||
#define PMSUNIT(dev) (minor(dev))
|
||||
@ -514,9 +522,9 @@ pcopen(dev, flag, mode, p)
|
||||
int unit = PCUNIT(dev);
|
||||
struct tty *tp;
|
||||
|
||||
if (unit >= pccd.cd_ndevs)
|
||||
if (unit >= pc_cd.cd_ndevs)
|
||||
return ENXIO;
|
||||
sc = pccd.cd_devs[unit];
|
||||
sc = pc_cd.cd_devs[unit];
|
||||
if (sc == 0)
|
||||
return ENXIO;
|
||||
|
||||
@ -553,7 +561,7 @@ pcclose(dev, flag, mode, p)
|
||||
int flag, mode;
|
||||
struct proc *p;
|
||||
{
|
||||
struct pc_softc *sc = pccd.cd_devs[PCUNIT(dev)];
|
||||
struct pc_softc *sc = pc_cd.cd_devs[PCUNIT(dev)];
|
||||
struct tty *tp = sc->sc_tty;
|
||||
|
||||
(*linesw[tp->t_line].l_close)(tp, flag);
|
||||
@ -570,7 +578,7 @@ pcread(dev, uio, flag)
|
||||
struct uio *uio;
|
||||
int flag;
|
||||
{
|
||||
struct pc_softc *sc = pccd.cd_devs[PCUNIT(dev)];
|
||||
struct pc_softc *sc = pc_cd.cd_devs[PCUNIT(dev)];
|
||||
struct tty *tp = sc->sc_tty;
|
||||
|
||||
return ((*linesw[tp->t_line].l_read)(tp, uio, flag));
|
||||
@ -582,7 +590,7 @@ pcwrite(dev, uio, flag)
|
||||
struct uio *uio;
|
||||
int flag;
|
||||
{
|
||||
struct pc_softc *sc = pccd.cd_devs[PCUNIT(dev)];
|
||||
struct pc_softc *sc = pc_cd.cd_devs[PCUNIT(dev)];
|
||||
struct tty *tp = sc->sc_tty;
|
||||
|
||||
return ((*linesw[tp->t_line].l_write)(tp, uio, flag));
|
||||
@ -592,7 +600,7 @@ struct tty *
|
||||
pctty(dev)
|
||||
dev_t dev;
|
||||
{
|
||||
struct pc_softc *sc = pccd.cd_devs[PCUNIT(dev)];
|
||||
struct pc_softc *sc = pc_cd.cd_devs[PCUNIT(dev)];
|
||||
struct tty *tp = sc->sc_tty;
|
||||
|
||||
return (tp);
|
||||
@ -635,7 +643,7 @@ pcioctl(dev, cmd, data, flag, p)
|
||||
int flag;
|
||||
struct proc *p;
|
||||
{
|
||||
struct pc_softc *sc = pccd.cd_devs[PCUNIT(dev)];
|
||||
struct pc_softc *sc = pc_cd.cd_devs[PCUNIT(dev)];
|
||||
struct tty *tp = sc->sc_tty;
|
||||
int error;
|
||||
|
||||
@ -818,8 +826,8 @@ pccnpollc(dev, on)
|
||||
* interrupts.
|
||||
*/
|
||||
unit = PCUNIT(dev);
|
||||
if (pccd.cd_ndevs > unit) {
|
||||
sc = pccd.cd_devs[unit];
|
||||
if (pc_cd.cd_ndevs > unit) {
|
||||
sc = pc_cd.cd_devs[unit];
|
||||
if (sc != 0) {
|
||||
s = spltty();
|
||||
pcintr(sc);
|
||||
@ -1859,7 +1867,7 @@ pc_xmode_off()
|
||||
#endif
|
||||
async_update();
|
||||
}
|
||||
/* $NetBSD: pccons.c,v 1.1.1.1 1996/03/13 04:58:06 jonathan Exp $ */
|
||||
/* $NetBSD: pccons.c,v 1.2 1996/03/17 01:42:18 thorpej Exp $ */
|
||||
|
||||
#include <machine/mouse.h>
|
||||
|
||||
@ -1966,9 +1974,9 @@ pmsopen(dev, flag)
|
||||
int unit = PMSUNIT(dev);
|
||||
struct pms_softc *sc;
|
||||
|
||||
if (unit >= pmscd.cd_ndevs)
|
||||
if (unit >= pms_cd.cd_ndevs)
|
||||
return ENXIO;
|
||||
sc = pmscd.cd_devs[unit];
|
||||
sc = pms_cd.cd_devs[unit];
|
||||
if (!sc)
|
||||
return ENXIO;
|
||||
|
||||
@ -2003,7 +2011,7 @@ pmsclose(dev, flag)
|
||||
dev_t dev;
|
||||
int flag;
|
||||
{
|
||||
struct pms_softc *sc = pmscd.cd_devs[PMSUNIT(dev)];
|
||||
struct pms_softc *sc = pms_cd.cd_devs[PMSUNIT(dev)];
|
||||
|
||||
/* Disable interrupts. */
|
||||
pms_dev_cmd(PMS_DEV_DISABLE);
|
||||
@ -2023,7 +2031,7 @@ pmsread(dev, uio, flag)
|
||||
struct uio *uio;
|
||||
int flag;
|
||||
{
|
||||
struct pms_softc *sc = pmscd.cd_devs[PMSUNIT(dev)];
|
||||
struct pms_softc *sc = pms_cd.cd_devs[PMSUNIT(dev)];
|
||||
int s;
|
||||
int error;
|
||||
size_t length;
|
||||
@ -2071,7 +2079,7 @@ pmsioctl(dev, cmd, addr, flag)
|
||||
caddr_t addr;
|
||||
int flag;
|
||||
{
|
||||
struct pms_softc *sc = pmscd.cd_devs[PMSUNIT(dev)];
|
||||
struct pms_softc *sc = pms_cd.cd_devs[PMSUNIT(dev)];
|
||||
struct mouseinfo info;
|
||||
int s;
|
||||
int error;
|
||||
@ -2200,7 +2208,7 @@ pmsselect(dev, rw, p)
|
||||
int rw;
|
||||
struct proc *p;
|
||||
{
|
||||
struct pms_softc *sc = pmscd.cd_devs[PMSUNIT(dev)];
|
||||
struct pms_softc *sc = pms_cd.cd_devs[PMSUNIT(dev)];
|
||||
int s;
|
||||
int ret;
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
||||
* from: Utah Hdr: clock.c 1.18 91/01/21
|
||||
*
|
||||
* from: @(#)clock.c 8.1 (Berkeley) 6/10/93
|
||||
* $Id: clock.c,v 1.1.1.1 1996/03/13 04:58:10 jonathan Exp $
|
||||
* $Id: clock.c,v 1.2 1996/03/17 01:42:23 thorpej Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -57,9 +57,14 @@ extern int cputype; /* What kind of cpu we are running on */
|
||||
/* Definition of the driver for autoconfig. */
|
||||
static int clockmatch __P((struct device *, void *, void *));
|
||||
static void clockattach __P((struct device *, struct device *, void *));
|
||||
struct cfdriver clockcd =
|
||||
{ NULL, "clock", clockmatch, clockattach, DV_DULL,
|
||||
sizeof(struct clock_softc) };
|
||||
|
||||
struct cfattach clock_ca = {
|
||||
sizeof(struct clock_softc), clockmatch, clockattach
|
||||
};
|
||||
|
||||
struct cfdriver clock_cd = {
|
||||
NULL, "clock", DV_DULL
|
||||
};
|
||||
|
||||
void mcclock_attach __P((struct device *, struct device *, void *));
|
||||
|
||||
@ -156,7 +161,7 @@ delay(n)
|
||||
cpu_initclocks()
|
||||
{
|
||||
extern int tickadj;
|
||||
struct clock_softc *csc = (struct clock_softc *)clockcd.cd_devs[0];
|
||||
struct clock_softc *csc = (struct clock_softc *)clock_cd.cd_devs[0];
|
||||
|
||||
hz = 100; /* 100 Hz */
|
||||
tick = 1000000 / hz; /* number of micro-seconds between interrupts */
|
||||
@ -196,7 +201,7 @@ inittodr(base)
|
||||
time_t base;
|
||||
{
|
||||
struct tod_time c;
|
||||
struct clock_softc *csc = (struct clock_softc *)clockcd.cd_devs[0];
|
||||
struct clock_softc *csc = (struct clock_softc *)clock_cd.cd_devs[0];
|
||||
register int days, yr;
|
||||
long deltat;
|
||||
int badbase, s;
|
||||
@ -266,7 +271,7 @@ void
|
||||
resettodr()
|
||||
{
|
||||
struct tod_time c;
|
||||
struct clock_softc *csc = (struct clock_softc *)clockcd.cd_devs[0];
|
||||
struct clock_softc *csc = (struct clock_softc *)clock_cd.cd_devs[0];
|
||||
register int t, t2;
|
||||
int s;
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)conf.c 8.2 (Berkeley) 11/14/93
|
||||
* $Id: conf.c,v 1.2 1996/03/14 22:18:02 christos Exp $
|
||||
* $Id: conf.c,v 1.3 1996/03/17 01:42:25 thorpej Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cpu.c,v 1.1.1.1 1996/03/13 04:58:10 jonathan Exp $ */
|
||||
/* $NetBSD: cpu.c,v 1.2 1996/03/17 01:42:29 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
|
||||
@ -37,8 +37,14 @@
|
||||
/* Definition of the driver for autoconfig. */
|
||||
static int cpumatch(struct device *, void *, void *);
|
||||
static void cpuattach(struct device *, struct device *, void *);
|
||||
struct cfdriver cpucd =
|
||||
{ NULL, "cpu", cpumatch, cpuattach, DV_DULL, sizeof (struct device) };
|
||||
|
||||
struct cfattach cpu_ca = {
|
||||
sizeof(struct device), cpumatch, cpuattach
|
||||
};
|
||||
|
||||
struct cfdriver cpu_cd = {
|
||||
NULL, "cpu", DV_DULL
|
||||
};
|
||||
|
||||
static int cpuprint __P((void *, char *pnp));
|
||||
|
||||
@ -52,7 +58,7 @@ cpumatch(parent, cfdata, aux)
|
||||
struct confargs *ca = aux;
|
||||
|
||||
/* make sure that we're looking for a CPU. */
|
||||
if (strcmp(ca->ca_name, cpucd.cd_name) != 0)
|
||||
if (strcmp(ca->ca_name, cpu_cd.cd_name) != 0)
|
||||
return (0);
|
||||
|
||||
return (1);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: mainbus.c,v 1.1.1.1 1996/03/13 04:58:12 jonathan Exp $ */
|
||||
/* $NetBSD: mainbus.c,v 1.2 1996/03/17 01:42:31 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
|
||||
@ -44,9 +44,14 @@ struct mainbus_softc {
|
||||
static int mbmatch __P((struct device *, void *, void *));
|
||||
static void mbattach __P((struct device *, struct device *, void *));
|
||||
static int mbprint __P((void *, char *));
|
||||
struct cfdriver mainbuscd =
|
||||
{ NULL, "mainbus", mbmatch, mbattach, DV_DULL,
|
||||
sizeof (struct mainbus_softc) };
|
||||
|
||||
struct cfattach mainbus_ca = {
|
||||
sizeof(struct mainbus_softc), mbmatch, mbattach
|
||||
};
|
||||
|
||||
struct cfdriver mainbus_cd = {
|
||||
NULL, "mainbus", DV_DULL
|
||||
};
|
||||
|
||||
void mb_intr_establish __P((struct confargs *, int (*)(void *), void *));
|
||||
void mb_intr_disestablish __P((struct confargs *));
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pica.c,v 1.1.1.1 1996/03/13 04:58:12 jonathan Exp $ */
|
||||
/* $NetBSD: pica.c,v 1.2 1996/03/17 01:42:33 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
|
||||
@ -47,8 +47,14 @@ struct pica_softc {
|
||||
int picamatch(struct device *, void *, void *);
|
||||
void picaattach(struct device *, struct device *, void *);
|
||||
int picaprint(void *, char *);
|
||||
struct cfdriver picacd =
|
||||
{ NULL, "pica", picamatch, picaattach, DV_DULL, sizeof (struct pica_softc) };
|
||||
|
||||
struct cfattach pica_ca = {
|
||||
sizeof (struct pica_softc), picamatch, picaattach
|
||||
};
|
||||
|
||||
struct cfdriver pica_cd = {
|
||||
NULL, "pica", DV_DULL
|
||||
};
|
||||
|
||||
void pica_intr_establish __P((struct confargs *, int (*)(void *), void *));
|
||||
void pica_intr_disestablish __P((struct confargs *));
|
||||
@ -138,7 +144,7 @@ picamatch(parent, cfdata, aux)
|
||||
struct confargs *ca = aux;
|
||||
|
||||
/* Make sure that we're looking for a PICA. */
|
||||
if (strcmp(ca->ca_name, picacd.cd_name) != 0)
|
||||
if (strcmp(ca->ca_name, pica_cd.cd_name) != 0)
|
||||
return (0);
|
||||
|
||||
/* Make sure that unit exists. */
|
||||
@ -207,7 +213,7 @@ caddr_t
|
||||
pica_cvtaddr(ca)
|
||||
struct confargs *ca;
|
||||
{
|
||||
struct pica_softc *sc = picacd.cd_devs[0];
|
||||
struct pica_softc *sc = pica_cd.cd_devs[0];
|
||||
|
||||
return(sc->sc_devs[ca->ca_slot].ps_base + ca->ca_offset);
|
||||
|
||||
@ -219,7 +225,7 @@ pica_intr_establish(ca, handler, val)
|
||||
intr_handler_t handler;
|
||||
void *val;
|
||||
{
|
||||
struct pica_softc *sc = picacd.cd_devs[0];
|
||||
struct pica_softc *sc = pica_cd.cd_devs[0];
|
||||
|
||||
int slot;
|
||||
|
||||
@ -244,7 +250,7 @@ void
|
||||
pica_intr_disestablish(ca)
|
||||
struct confargs *ca;
|
||||
{
|
||||
struct pica_softc *sc = picacd.cd_devs[0];
|
||||
struct pica_softc *sc = pica_cd.cd_devs[0];
|
||||
|
||||
int slot;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: files.pmax,v 1.26 1996/02/15 19:13:21 jonathan Exp $
|
||||
# $NetBSD: files.pmax,v 1.27 1996/03/17 01:46:33 thorpej Exp $
|
||||
# DECstation-specific configuration info
|
||||
|
||||
# maxpartitions must be first item in files.${ARCH}.
|
||||
@ -9,9 +9,11 @@ maxusers 2 8 64
|
||||
#
|
||||
# Bus-independent devices
|
||||
#
|
||||
device mainbus at root { } # no locators
|
||||
device mainbus { } # no locators
|
||||
attach mainbus at root
|
||||
|
||||
device cpu at mainbus # not optional
|
||||
device cpu # not optional
|
||||
attach cpu at mainbus
|
||||
file arch/pmax/pmax/cpu.c cpu
|
||||
|
||||
#
|
||||
@ -30,7 +32,8 @@ file arch/pmax/pmax/kn230.c kn230 # DS5100, mipsmate
|
||||
#
|
||||
#define tcbus { }
|
||||
|
||||
device tc at mainbus {[slot = -1], [offset = -1]} ##{ }
|
||||
device tc {[slot = -1], [offset = -1]} ##{ }
|
||||
attach tc at mainbus
|
||||
file arch/pmax/tc/tc_subr.c tc needs-flag
|
||||
file dev/tc/tc.c tc needs-flag
|
||||
|
||||
@ -39,12 +42,14 @@ file dev/tc/tc.c tc needs-flag
|
||||
# The TurboChannel IOCTL ASIC. Present on IOASIC machines,
|
||||
# which is all turbochannel machines ever built except the 3MAX (5000/200).
|
||||
#
|
||||
device ioasic at tc { } #{ } # not really optional
|
||||
device ioasic { } #{ } # not really optional
|
||||
attach ioasic at tc
|
||||
file arch/pmax/tc/asic.c ioasic
|
||||
|
||||
|
||||
# Real-time clock (not optional)
|
||||
device clock at ioasic,tc,mainbus
|
||||
device clock
|
||||
attach clock at ioasic, tc, mainbus
|
||||
file arch/pmax/pmax/clock.c clock
|
||||
|
||||
|
||||
@ -63,21 +68,26 @@ major { rz = 21 }
|
||||
# Old 4.4bsd pmax-specific scsi driver (deprecated).
|
||||
#
|
||||
define oldscsi {}
|
||||
device oldscsibus at oldscsi {target = -1, drive = -1}
|
||||
device oldscsibus {target = -1, drive = -1}
|
||||
attach oldscsibus at oldscsi
|
||||
|
||||
# asc: system-slot or turbochannel-option SCSI interface
|
||||
device asc at ioasic,tc: oldscsi,scsi
|
||||
device asc: oldscsi,scsi
|
||||
attach asc at ioasic, tc: oldscsi, scsi
|
||||
file dev/tc/asc.c asc needs-flag
|
||||
|
||||
# sii: kn01 SCSI interface
|
||||
device sii at mainbus: oldscsi,scsi
|
||||
device sii: oldscsi,scsi
|
||||
attach sii at mainbus
|
||||
file arch/pmax/dev/sii.c sii needs-flag
|
||||
|
||||
|
||||
device tz at oldscsibus: tape
|
||||
device tz: tape
|
||||
attach tz at oldscsibus
|
||||
file arch/pmax/dev/tz.c tz needs-count
|
||||
|
||||
device rz at oldscsibus: disk
|
||||
device rz: disk
|
||||
attach rz at oldscsibus
|
||||
file arch/pmax/dev/rz.c rz needs-count
|
||||
|
||||
#
|
||||
@ -86,20 +96,24 @@ file arch/pmax/dev/rz.c rz needs-count
|
||||
|
||||
# DC7085 (DZ-like four-port serial device) on mainbus on non-IOASIC machines.
|
||||
# For the 3MAX (aka kn02 aka 5k/200) pretend that it's on an ASIC.
|
||||
device dc at mainbus,ioasic
|
||||
device dc
|
||||
attach dc at mainbus, ioasic
|
||||
file arch/pmax/dev/dc.c dc needs-count
|
||||
|
||||
# The "desktop bus" on the MAXINE (5k/25). What is it, anyway? ADB?
|
||||
device dtop at ioasic
|
||||
device dtop
|
||||
attach dtop at ioasic
|
||||
file arch/pmax/dev/dtop.c dtop needs-flag
|
||||
|
||||
# LANCE ethernet driver.
|
||||
# XXX Should use new machine-independent one instead.
|
||||
device le at ioasic,tc,mainbus: ifnet, ether
|
||||
device le: ifnet, ether
|
||||
attach le at ioasic, tc, mainbus
|
||||
file arch/pmax/tc/if_le.c le needs-flag
|
||||
|
||||
# 3100 (pmax) onboard framebuffer
|
||||
device pm at mainbus
|
||||
device pm
|
||||
attach pm at mainbus
|
||||
file arch/pmax/dev/pm.c pm needs-flag
|
||||
file arch/pmax/dev/bt478.c pm
|
||||
|
||||
@ -107,26 +121,32 @@ file arch/pmax/dev/bt478.c pm
|
||||
# Turbochannel options.
|
||||
########################################################################
|
||||
|
||||
device cfb at tc
|
||||
device cfb
|
||||
attach cfb at tc
|
||||
file arch/pmax/dev/cfb.c cfb needs-flag
|
||||
|
||||
device sfb at tc
|
||||
device sfb
|
||||
attach sfb at tc
|
||||
file arch/pmax/dev/sfb.c sfb needs-flag
|
||||
|
||||
device mfb at tc
|
||||
device mfb
|
||||
attach mfb at tc
|
||||
file arch/pmax/dev/mfb.c mfb needs-flag
|
||||
|
||||
# Zilog 8350/Intel 82350(?) SCC UART.
|
||||
device scc at ioasic
|
||||
device scc
|
||||
attach scc at ioasic
|
||||
file arch/pmax/tc/scc.c scc needs-count
|
||||
|
||||
# MAXINE onboard framebuffer
|
||||
device xcfb at tc
|
||||
device xcfb
|
||||
attach xcfb at tc
|
||||
file arch/pmax/dev/xcfb.c xcfb needs-flag
|
||||
file arch/pmax/dev/ims332.c xcfb
|
||||
|
||||
# DECWRL 45Mbit T3 interface
|
||||
device tt at tc
|
||||
device tt
|
||||
attach tt at tc
|
||||
file arch/pmax/dev/if_tt.c tt needs-count
|
||||
|
||||
## bogus pmax-specific SCSI code. Leave in until new-style config done.
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cfb.c,v 1.16 1996/02/28 20:49:18 thorpej Exp $ */
|
||||
/* $NetBSD: cfb.c,v 1.17 1996/03/17 01:46:37 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -117,7 +117,7 @@ struct fbinfo cfbfi; /*XXX*/ /* should be softc */
|
||||
* Forward references.
|
||||
*/
|
||||
|
||||
extern struct cfdriver cfb;
|
||||
extern struct cfdriver cfb_cd;
|
||||
|
||||
#define CMAP_BITS (3 * 256) /* 256 entries, 3 bytes per. */
|
||||
static u_char cmap_bits [CMAP_BITS]; /* colormap for console... */
|
||||
@ -162,8 +162,12 @@ int cfbmatch __P((struct device *, void *, void *));
|
||||
void cfbattach __P((struct device *, struct device *, void *));
|
||||
int cfb_intr __P((void *sc));
|
||||
|
||||
struct cfdriver cfbcd = {
|
||||
NULL, "cfb", cfbmatch, cfbattach, DV_DULL, sizeof(struct fbinfo), 0
|
||||
struct cfattach cfb_ca = {
|
||||
sizeof(struct fbinfo), cfbmatch, cfbattach
|
||||
};
|
||||
|
||||
struct cfdriver cfb_cd = {
|
||||
NULL, "cfb", DV_DULL
|
||||
};
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: dc.c,v 1.14 1996/02/02 18:07:17 mycroft Exp $ */
|
||||
/* $NetBSD: dc.c,v 1.15 1996/03/17 01:46:39 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -108,9 +108,14 @@ void dcattach __P((struct device *parent, struct device *self, void *aux));
|
||||
int dc_doprobe __P((void *addr, int unit, int flags, int pri));
|
||||
int dcintr __P((void * xxxunit));
|
||||
|
||||
extern struct cfdriver dccd;
|
||||
struct cfdriver dccd = {
|
||||
NULL, "dc", dcmatch, dcattach, DV_TTY, sizeof(struct dc_softc), 0
|
||||
extern struct cfdriver dc_cd;
|
||||
|
||||
struct cfattach dc_ca = {
|
||||
sizeof(struct dc_softc), dcmatch, dcattach
|
||||
};
|
||||
|
||||
struct cfdriver dc_cd = {
|
||||
NULL, "dc", DV_TTY
|
||||
};
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: dtop.c,v 1.12 1996/02/13 18:23:46 jonathan Exp $ */
|
||||
/* $NetBSD: dtop.c,v 1.13 1996/03/17 01:46:41 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -175,7 +175,7 @@ struct dtop_softc {
|
||||
};
|
||||
|
||||
#define DTOP_TTY(unit) \
|
||||
( ((struct dtop_softc*) dtopcd.cd_devs[(unit)]) -> dtop_tty)
|
||||
( ((struct dtop_softc*) dtop_cd.cd_devs[(unit)]) -> dtop_tty)
|
||||
|
||||
typedef struct dtop_softc *dtop_softc_t;
|
||||
|
||||
@ -205,9 +205,15 @@ int dtopmatch __P((struct device * parent, void *cfdata, void *aux));
|
||||
void dtopattach __P((struct device *parent, struct device *self, void *aux));
|
||||
int dtopintr __P((void *sc));
|
||||
|
||||
extern struct cfdriver dtopcd;
|
||||
struct cfdriver dtopcd =
|
||||
{ NULL, "dtop", dtopmatch, dtopattach, DV_DULL, sizeof(struct dtop_softc) };
|
||||
extern struct cfdriver dtop_cd;
|
||||
|
||||
struct cfattach dtop_ca = {
|
||||
sizeof(struct dtop_softc), dtopmatch, dtopattach
|
||||
};
|
||||
|
||||
struct cfdriver dtop_cd = {
|
||||
NULL, "dtop", DV_DULL
|
||||
};
|
||||
|
||||
/*
|
||||
* match driver based on name
|
||||
@ -272,7 +278,7 @@ dtopopen(dev, flag, mode, p)
|
||||
int s, error = 0;
|
||||
|
||||
unit = minor(dev);
|
||||
if (unit >= dtopcd.cd_ndevs)
|
||||
if (unit >= dtop_cd.cd_ndevs)
|
||||
return (ENXIO);
|
||||
tp = DTOP_TTY(unit);
|
||||
if (tp == NULL)
|
||||
@ -603,7 +609,7 @@ dtopKBDGetc()
|
||||
register int c;
|
||||
dtop_softc_t dtop;
|
||||
|
||||
dtop = dtopcd.cd_devs[0];
|
||||
dtop = dtop_cd.cd_devs[0];
|
||||
again:
|
||||
c = -1;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: mfb.c,v 1.11 1996/02/15 19:13:16 jonathan Exp $ */
|
||||
/* $NetBSD: mfb.c,v 1.12 1996/03/17 01:46:43 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -185,8 +185,12 @@ struct fbdriver mfb_driver = {
|
||||
int mfbmatch __P((struct device *, void *, void *));
|
||||
void mfbattach __P((struct device *, struct device *, void *));
|
||||
|
||||
struct cfdriver mfbcd = {
|
||||
NULL, "mfb", mfbmatch, mfbattach, DV_DULL, sizeof(struct device), 0
|
||||
struct cfattach mfb_ca = {
|
||||
sizeof(struct device), mfbmatch, mfbattach
|
||||
};
|
||||
|
||||
struct cfdriver mfb_cd = {
|
||||
NULL, "mfb", DV_DULL
|
||||
};
|
||||
|
||||
int
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pm.c,v 1.13 1996/02/15 19:13:08 jonathan Exp $ */
|
||||
/* $NetBSD: pm.c,v 1.14 1996/03/17 01:46:45 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -160,8 +160,12 @@ static u_char cmap_bits [CMAP_BITS]; /* colormap for console... */
|
||||
int pmmatch __P((struct device *, void *, void *));
|
||||
void pmattach __P((struct device *, struct device *, void *));
|
||||
|
||||
struct cfdriver pmcd = {
|
||||
NULL, "pm", pmmatch, pmattach, DV_DULL, sizeof(struct device), 0
|
||||
struct cfattach pm_ca = {
|
||||
sizeof(struct device), pmmatch, pmattach
|
||||
};
|
||||
|
||||
struct cfdriver pm_cd = {
|
||||
NULL, "pm", DV_DULL
|
||||
};
|
||||
|
||||
/* new-style raster-cons "driver" methods */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sfb.c,v 1.8 1996/02/28 20:49:20 thorpej Exp $ */
|
||||
/* $NetBSD: sfb.c,v 1.9 1996/03/17 01:46:48 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -126,8 +126,12 @@ static u_char cmap_bits [CMAP_BITS]; /* colormap for console... */
|
||||
int sfbmatch __P((struct device *, void *, void *));
|
||||
void sfbattach __P((struct device *, struct device *, void *));
|
||||
|
||||
struct cfdriver sfbcd = {
|
||||
NULL, "sfb", sfbmatch, sfbattach, DV_DULL, sizeof(struct device), 0
|
||||
struct sfb_ca = {
|
||||
sizeof(struct device), sfbmatch, sfbattach
|
||||
};
|
||||
|
||||
struct cfdriver sfb_cd = {
|
||||
NULL, "sfb", DV_DULL
|
||||
};
|
||||
|
||||
struct fbdriver sfb_driver = {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sii.c,v 1.9 1996/01/29 22:52:23 jonathan Exp $ */
|
||||
/* $NetBSD: sii.c,v 1.10 1996/03/17 01:46:51 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -118,9 +118,14 @@ int sii_doprobe __P((void *addr, int unit, int flags, int pri,
|
||||
struct device *self));
|
||||
int siiintr __P((void *sc));
|
||||
|
||||
extern struct cfdriver siicd;
|
||||
struct cfdriver siicd = {
|
||||
NULL, "sii", siimatch, siiattach, DV_DULL, sizeof(struct siisoftc)
|
||||
extern struct cfdriver sii_cd;
|
||||
|
||||
struct cfattach sii_ca = {
|
||||
sizeof(struct siisoftc), siimatch, siiattach
|
||||
};
|
||||
|
||||
struct cfdriver sii_cd = {
|
||||
NULL, "sii", DV_DULL
|
||||
};
|
||||
|
||||
#ifdef USE_NEW_SCSI
|
||||
@ -293,7 +298,7 @@ siistart(scsicmd)
|
||||
register ScsiCmd *scsicmd; /* command to start */
|
||||
{
|
||||
register struct pmax_scsi_device *sdp = scsicmd->sd;
|
||||
register struct siisoftc *sc = siicd.cd_devs[sdp->sd_ctlr];
|
||||
register struct siisoftc *sc = sii_cd.cd_devs[sdp->sd_ctlr];
|
||||
int s;
|
||||
|
||||
s = splbio();
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: xcfb.c,v 1.12 1996/02/15 19:13:11 jonathan Exp $ */
|
||||
/* $NetBSD: xcfb.c,v 1.13 1996/03/17 01:46:54 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -133,7 +133,7 @@ struct fbuaccess xcfbu;
|
||||
struct pmax_fbtty xcfbfb;
|
||||
|
||||
struct fbinfo xcfbfi; /*XXX*/
|
||||
extern struct cfdriver cfb;
|
||||
extern struct cfdriver cfb_cd;
|
||||
|
||||
#define CMAP_BITS (3 * 256) /* 256 entries, 3 bytes per. */
|
||||
static u_char cmap_bits [CMAP_BITS]; /* colormap for console... */
|
||||
@ -178,8 +178,12 @@ extern u_short defCursor[32];
|
||||
int xcfbmatch __P((struct device *, void *, void *));
|
||||
void xcfbattach __P((struct device *, struct device *, void *));
|
||||
|
||||
struct cfdriver xcfbcd = {
|
||||
NULL, "xcfb", xcfbmatch, xcfbattach, DV_DULL, sizeof(struct device), 0
|
||||
struct cfattach xcfb_ca = {
|
||||
sizeof(struct device), xcfbmatch, xcfbattach
|
||||
};
|
||||
|
||||
struct cfdriver xcfb_cd = {
|
||||
NULL, "xcfb", DV_DULL
|
||||
};
|
||||
|
||||
int
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: clock.c,v 1.10 1996/01/29 22:52:28 jonathan Exp $ */
|
||||
/* $NetBSD: clock.c,v 1.11 1996/03/17 01:47:02 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
@ -133,16 +133,21 @@ volatile struct chiptime *Mach_clock_addr;
|
||||
|
||||
|
||||
/* global autoconfiguration variables -- bus type*/
|
||||
extern struct cfdriver mainbuscd;
|
||||
extern struct cfdriver ioasiccd;
|
||||
extern struct cfdriver tccd;
|
||||
extern struct cfdriver mainbus_cd;
|
||||
extern struct cfdriver ioasic_cd;
|
||||
extern struct cfdriver tc_cd;
|
||||
|
||||
|
||||
/* Definition of the driver for autoconfig. */
|
||||
static int clockmatch __P((struct device *, void *, void *));
|
||||
static void clockattach __P((struct device *, struct device *, void *));
|
||||
struct cfdriver clockcd = {
|
||||
NULL, "clock", clockmatch, clockattach, DV_DULL, sizeof(struct device),
|
||||
|
||||
struct cfattach clock_ca = {
|
||||
sizeof(struct device), clockmatch, clockattach
|
||||
};
|
||||
|
||||
struct cfdriver clock_cd = {
|
||||
NULL, "clock", DV_DULL
|
||||
};
|
||||
|
||||
static void clock_startintr __P((void *));
|
||||
@ -165,9 +170,9 @@ clockmatch(parent, cfdata, aux)
|
||||
int vec, ipl;
|
||||
int nclocks;
|
||||
|
||||
if (parent->dv_cfdata->cf_driver != &ioasiccd &&
|
||||
parent->dv_cfdata->cf_driver != &tccd &&
|
||||
parent->dv_cfdata->cf_driver != &mainbuscd)
|
||||
if (parent->dv_cfdata->cf_driver != &ioasic_cd &&
|
||||
parent->dv_cfdata->cf_driver != &tc_cd &&
|
||||
parent->dv_cfdata->cf_driver != &mainbus_cd)
|
||||
return(0);
|
||||
|
||||
/* make sure that we're looking for this type of device. */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cpu.c,v 1.2 1996/01/29 22:52:30 jonathan Exp $ */
|
||||
/* $NetBSD: cpu.c,v 1.3 1996/03/17 01:47:04 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
|
||||
@ -36,8 +36,14 @@
|
||||
/* Definition of the driver for autoconfig. */
|
||||
static int cpumatch(struct device *, void *, void *);
|
||||
static void cpuattach(struct device *, struct device *, void *);
|
||||
struct cfdriver cpucd =
|
||||
{ NULL, "cpu", cpumatch, cpuattach, DV_DULL, sizeof (struct device) };
|
||||
|
||||
struct cfattach cpu_ca = {
|
||||
sizeof (struct device), cpumatch, cpuattach
|
||||
};
|
||||
|
||||
struct cfdriver cpu_cd = {
|
||||
NULL, "cpu", DV_DULL
|
||||
};
|
||||
|
||||
static int cpuprint __P((void *, char *pnp));
|
||||
|
||||
@ -52,7 +58,7 @@ cpumatch(parent, cfdata, aux)
|
||||
struct confargs *ca = aux;
|
||||
|
||||
/* make sure that we're looking for a CPU. */
|
||||
if (strcmp(ca->ca_name, cpucd.cd_name) != 0)
|
||||
if (strcmp(ca->ca_name, cpu_cd.cd_name) != 0)
|
||||
return (0);
|
||||
|
||||
return (1);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: mainbus.c,v 1.6 1996/02/02 18:07:56 mycroft Exp $ */
|
||||
/* $NetBSD: mainbus.c,v 1.7 1996/03/17 01:47:06 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
|
||||
@ -48,9 +48,15 @@ struct mainbus_softc {
|
||||
static int mbmatch __P((struct device *, void *, void *));
|
||||
static void mbattach __P((struct device *, struct device *, void *));
|
||||
static int mbprint __P((void *, char *));
|
||||
struct cfdriver mainbuscd =
|
||||
{ NULL, "mainbus", mbmatch, mbattach, DV_DULL,
|
||||
sizeof (struct mainbus_softc) };
|
||||
|
||||
struct cfattach mainbus_ca = {
|
||||
sizeof (struct mainbus_softc), mbmatch, mbattach
|
||||
};
|
||||
|
||||
struct cfdriver mainbus_cd = {
|
||||
NULL, "mainbus", DV_DULL
|
||||
};
|
||||
|
||||
void mb_intr_establish __P((struct confargs *ca,
|
||||
int (*handler)(intr_arg_t),
|
||||
intr_arg_t val ));
|
||||
@ -293,7 +299,7 @@ generic_intr_establish(ca, handler, arg)
|
||||
if (dev->dv_parent->dv_cfdata->cf_driver == &tccd) {
|
||||
tc_intr_establish(dev->dv_parent, ca->ca_slotpri, 0, handler, arg);
|
||||
} else
|
||||
if (dev->dv_parent->dv_cfdata->cf_driver == &mainbuscd) {
|
||||
if (dev->dv_parent->dv_cfdata->cf_driver == &mainbus_cd) {
|
||||
kn01_intr_establish(ca, handler, arg);
|
||||
}
|
||||
else {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: asic.c,v 1.8 1996/01/31 08:47:14 jonathan Exp $ */
|
||||
/* $NetBSD: asic.c,v 1.9 1996/03/17 01:47:09 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
|
||||
@ -75,8 +75,13 @@ int asicprint(void *, char *);
|
||||
|
||||
#define IOASIC_OFFSET_UNKNOWN -1
|
||||
|
||||
struct cfdriver ioasiccd =
|
||||
{ NULL, "asic", asicmatch, asicattach, DV_DULL, sizeof(struct asic_softc) };
|
||||
struct cfattach ioasic_ca = {
|
||||
sizeof(struct asic_softc), asicmatch, asicattach
|
||||
};
|
||||
|
||||
struct cfdriver ioasic_cd = {
|
||||
NULL, "asic", DV_DULL
|
||||
};
|
||||
|
||||
void asic_intr_establish __P((struct confargs *, intr_handler_t,
|
||||
intr_arg_t));
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: scc.c,v 1.9 1996/02/08 02:26:34 jonathan Exp $ */
|
||||
/* $NetBSD: scc.c,v 1.10 1996/03/17 01:47:12 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1991,1990,1989,1994,1995 Carnegie Mellon University
|
||||
@ -256,9 +256,14 @@ struct speedtab sccspeedtab[] = {
|
||||
/* Definition of the driver for autoconfig. */
|
||||
int sccmatch __P((struct device * parent, void *cfdata, void *aux));
|
||||
void sccattach __P((struct device *parent, struct device *self, void *aux));
|
||||
extern struct cfdriver scccd;
|
||||
struct cfdriver scccd = {
|
||||
NULL, "scc", sccmatch, sccattach, DV_TTY, sizeof (struct scc_softc)
|
||||
extern struct cfdriver scc_cd;
|
||||
|
||||
struct cfattach scc_ca = {
|
||||
sizeof (struct scc_softc), sccmatch, sccattach
|
||||
};
|
||||
|
||||
struct cfdriver scc_cd = {
|
||||
NULL, "scc", DV_TTY
|
||||
};
|
||||
|
||||
int sccGetc __P((dev_t));
|
||||
@ -660,9 +665,9 @@ sccopen(dev, flag, mode, p)
|
||||
int s, error = 0;
|
||||
|
||||
unit = SCCUNIT(dev);
|
||||
if (unit >= scccd.cd_ndevs)
|
||||
if (unit >= scc_cd.cd_ndevs)
|
||||
return (ENXIO);
|
||||
sc = scccd.cd_devs[unit];
|
||||
sc = scc_cd.cd_devs[unit];
|
||||
if (!sc)
|
||||
return (ENXIO);
|
||||
|
||||
@ -718,7 +723,7 @@ sccclose(dev, flag, mode, p)
|
||||
int flag, mode;
|
||||
struct proc *p;
|
||||
{
|
||||
register struct scc_softc *sc = scccd.cd_devs[SCCUNIT(dev)];
|
||||
register struct scc_softc *sc = scc_cd.cd_devs[SCCUNIT(dev)];
|
||||
register struct tty *tp;
|
||||
register int line;
|
||||
|
||||
@ -791,7 +796,7 @@ sccioctl(dev, cmd, data, flag, p)
|
||||
return (error);
|
||||
|
||||
line = SCCLINE(dev);
|
||||
sc = scccd.cd_devs[SCCUNIT(dev)];
|
||||
sc = scc_cd.cd_devs[SCCUNIT(dev)];
|
||||
switch (cmd) {
|
||||
|
||||
case TIOCSBRK:
|
||||
@ -879,7 +884,7 @@ sccparam(tp, t)
|
||||
return (0);
|
||||
}
|
||||
|
||||
sc = scccd.cd_devs[SCCUNIT(tp->t_dev)];
|
||||
sc = scc_cd.cd_devs[SCCUNIT(tp->t_dev)];
|
||||
line = SCCLINE(tp->t_dev);
|
||||
regs = (scc_regmap_t *)sc->scc_pdma[line].p_addr;
|
||||
|
||||
@ -1143,7 +1148,7 @@ sccstart(tp)
|
||||
u_char temp;
|
||||
int s, sendone;
|
||||
|
||||
sc = scccd.cd_devs[SCCUNIT(tp->t_dev)];
|
||||
sc = scc_cd.cd_devs[SCCUNIT(tp->t_dev)];
|
||||
dp = &sc->scc_pdma[SCCLINE(tp->t_dev)];
|
||||
regs = (scc_regmap_t *)dp->p_addr;
|
||||
s = spltty();
|
||||
@ -1224,7 +1229,7 @@ sccstop(tp, flag)
|
||||
register struct scc_softc *sc;
|
||||
register int s;
|
||||
|
||||
sc = scccd.cd_devs[SCCUNIT(tp->t_dev)];
|
||||
sc = scc_cd.cd_devs[SCCUNIT(tp->t_dev)];
|
||||
dp = &sc->scc_pdma[SCCLINE(tp->t_dev)];
|
||||
s = spltty();
|
||||
if (tp->t_state & TS_BUSY) {
|
||||
@ -1248,7 +1253,7 @@ sccmctl(dev, bits, how)
|
||||
register u_char value;
|
||||
int s;
|
||||
|
||||
sc = scccd.cd_devs[SCCUNIT(dev)];
|
||||
sc = scc_cd.cd_devs[SCCUNIT(dev)];
|
||||
line = SCCLINE(dev);
|
||||
regs = (scc_regmap_t *)sc->scc_pdma[line].p_addr;
|
||||
s = spltty();
|
||||
@ -1312,7 +1317,7 @@ scc_modem_intr(dev)
|
||||
register u_char value;
|
||||
int s;
|
||||
|
||||
sc = scccd.cd_devs[SCCUNIT(dev)];
|
||||
sc = scc_cd.cd_devs[SCCUNIT(dev)];
|
||||
tp = scc_tty[minor(dev)];
|
||||
chan = SCCLINE(dev);
|
||||
regs = (scc_regmap_t *)sc->scc_pdma[chan].p_addr;
|
||||
@ -1358,7 +1363,7 @@ sccGetc(dev)
|
||||
int s;
|
||||
|
||||
line = SCCLINE(dev);
|
||||
sc = scccd.cd_devs[SCCUNIT(dev)];
|
||||
sc = scc_cd.cd_devs[SCCUNIT(dev)];
|
||||
regs = (scc_regmap_t *)sc->scc_pdma[line].p_addr;
|
||||
if (!regs)
|
||||
return (0);
|
||||
@ -1409,7 +1414,7 @@ sccPutc(dev, c)
|
||||
s = splhigh();
|
||||
#endif
|
||||
line = SCCLINE(dev);
|
||||
sc = scccd.cd_devs[SCCUNIT(dev)];
|
||||
sc = scc_cd.cd_devs[SCCUNIT(dev)];
|
||||
regs = (scc_regmap_t *)sc->scc_pdma[line].p_addr;
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user