diff options
Diffstat (limited to 'sys/arch/i386/isa')
-rw-r--r-- | sys/arch/i386/isa/clock.c | 4 | ||||
-rw-r--r-- | sys/arch/i386/isa/fd.c | 14 | ||||
-rw-r--r-- | sys/arch/i386/isa/fdreg.h | 2 | ||||
-rw-r--r-- | sys/arch/i386/isa/icu.h | 6 | ||||
-rw-r--r-- | sys/arch/i386/isa/isa_machdep.c | 32 | ||||
-rw-r--r-- | sys/arch/i386/isa/isa_machdep.h | 15 | ||||
-rw-r--r-- | sys/arch/i386/isa/lms.c | 4 | ||||
-rw-r--r-- | sys/arch/i386/isa/mms.c | 4 | ||||
-rw-r--r-- | sys/arch/i386/isa/npx.c | 2 | ||||
-rw-r--r-- | sys/arch/i386/isa/pccons.c | 4 | ||||
-rw-r--r-- | sys/arch/i386/isa/pcvt/Util/vgaio/vgaio.h | 9 | ||||
-rw-r--r-- | sys/arch/i386/isa/pcvt/pcvt_conf.h | 4 | ||||
-rw-r--r-- | sys/arch/i386/isa/pcvt/pcvt_drv.c | 2 | ||||
-rw-r--r-- | sys/arch/i386/isa/pcvt/pcvt_hdr.h | 87 | ||||
-rw-r--r-- | sys/arch/i386/isa/pcvt/pcvt_ioctl.h | 4 | ||||
-rw-r--r-- | sys/arch/i386/isa/pcvt/pcvt_kbd.c | 6 | ||||
-rw-r--r-- | sys/arch/i386/isa/pms.c | 4 | ||||
-rw-r--r-- | sys/arch/i386/isa/spkr.c | 42 | ||||
-rw-r--r-- | sys/arch/i386/isa/vector.s | 16 |
19 files changed, 126 insertions, 135 deletions
diff --git a/sys/arch/i386/isa/clock.c b/sys/arch/i386/isa/clock.c index 2833d2f2f10..c4e310a032f 100644 --- a/sys/arch/i386/isa/clock.c +++ b/sys/arch/i386/isa/clock.c @@ -1,4 +1,4 @@ -/* $NetBSD: clock.c,v 1.34 1995/08/13 04:06:29 mycroft Exp $ */ +/* $NetBSD: clock.c,v 1.35 1995/12/24 02:30:07 mycroft Exp $ */ /*- * Copyright (c) 1993, 1994 Charles Hannum. @@ -328,7 +328,7 @@ cpu_initclocks() * XXX If you're doing strange things with multiple clocks, you might * want to keep track of clock handlers. */ - (void)isa_intr_establish(0, IST_PULSE, IPL_CLOCK, clockintr, 0, "clock"); + (void)isa_intr_establish(0, IST_PULSE, IPL_CLOCK, clockintr, 0); } void diff --git a/sys/arch/i386/isa/fd.c b/sys/arch/i386/isa/fd.c index 78d8ff0c347..abd878fcc6b 100644 --- a/sys/arch/i386/isa/fd.c +++ b/sys/arch/i386/isa/fd.c @@ -308,7 +308,7 @@ fdcattach(parent, self, aux) isa_establish(&fdc->sc_id, &fdc->sc_dev); #endif fdc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_BIO, fdcintr, - fdc, fdc->sc_dev.dv_xname); + fdc); /* * The NVRAM info only tells us about the first two disks on the @@ -931,8 +931,8 @@ loop: at_dma(read, bp->b_data + fd->sc_skip, fd->sc_nbytes, fdc->sc_drq); #else - isadma_start(bp->b_data + fd->sc_skip, fd->sc_nbytes, - fdc->sc_drq, read ? ISADMA_START_READ : ISADMA_START_WRITE); + isa_dmastart(read, bp->b_data + fd->sc_skip, fd->sc_nbytes, + fdc->sc_drq); #endif outb(iobase + fdctl, type->rate); #ifdef FD_DEBUG @@ -987,7 +987,7 @@ loop: #ifdef NEWCONFIG at_dma_abort(fdc->sc_drq); #else - isadma_abort(fdc->sc_drq); + isa_dmaabort(fdc->sc_drq); #endif case SEEKTIMEDOUT: case RECALTIMEDOUT: @@ -1004,7 +1004,7 @@ loop: #ifdef NEWCONFIG at_dma_abort(fdc->sc_drq); #else - isadma_abort(fdc->sc_drq); + isa_dmaabort(fdc->sc_drq); #endif #ifdef FD_DEBUG fdcstatus(&fd->sc_dev, 7, bp->b_flags & B_READ ? @@ -1018,7 +1018,9 @@ loop: #ifdef NEWCONFIG at_dma_terminate(fdc->sc_drq); #else - isadma_done(fdc->sc_drq); + read = bp->b_flags & B_READ; + isa_dmadone(read, bp->b_data + fd->sc_skip, fd->sc_nbytes, + fdc->sc_drq); #endif if (fdc->sc_errors) { diskerr(bp, "fd", "soft error", LOG_PRINTF, diff --git a/sys/arch/i386/isa/fdreg.h b/sys/arch/i386/isa/fdreg.h index 5bab1f7d595..a1c8388912d 100644 --- a/sys/arch/i386/isa/fdreg.h +++ b/sys/arch/i386/isa/fdreg.h @@ -63,4 +63,4 @@ #define FDC_BSIZE 512 #define FDC_NPORT 8 -#define FDC_MAXIOSIZE MAXBSIZE +#define FDC_MAXIOSIZE NBPG /* XXX should be MAXBSIZE */ diff --git a/sys/arch/i386/isa/icu.h b/sys/arch/i386/isa/icu.h index b2cc5068c34..f89eb51ed23 100644 --- a/sys/arch/i386/isa/icu.h +++ b/sys/arch/i386/isa/icu.h @@ -1,4 +1,4 @@ -/* $NetBSD: icu.h,v 1.18 1996/01/07 02:03:20 mycroft Exp $ */ +/* $NetBSD: icu.h,v 1.19 1996/02/01 22:31:21 mycroft Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -46,7 +46,7 @@ #ifndef _I386_ISA_ICU_H_ #define _I386_ISA_ICU_H_ -#ifndef LOCORE +#ifndef _LOCORE /* * Interrupt "level" mechanism variables, masks, and macros @@ -55,7 +55,7 @@ extern unsigned imen; /* interrupt mask enable */ #define SET_ICUS() (outb(IO_ICU1 + 1, imen), outb(IO_ICU2 + 1, imen >> 8)) -#endif /* !LOCORE */ +#endif /* !_LOCORE */ /* * Interrupt enable bits -- in order of priority diff --git a/sys/arch/i386/isa/isa_machdep.c b/sys/arch/i386/isa/isa_machdep.c index 7078c27bfb6..93f22d78a73 100644 --- a/sys/arch/i386/isa/isa_machdep.c +++ b/sys/arch/i386/isa/isa_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: isa_machdep.c,v 1.8 1995/10/09 06:34:47 mycroft Exp $ */ +/* $NetBSD: isa_machdep.c,v 1.10 1996/02/09 02:26:00 mycroft Exp $ */ /*- * Copyright (c) 1993, 1994 Charles Hannum. @@ -145,8 +145,6 @@ isa_nmi() return(0); } -int intrstray[ICU_LEN]; - /* * Caught a stray interrupt, notify */ @@ -154,15 +152,17 @@ void isa_strayintr(irq) int irq; { + static u_long strays; + /* * Stray interrupts on irq 7 occur when an interrupt line is raised * and then lowered before the CPU acknowledges it. This generally * means either the device is screwed or something is cli'ing too * long and it's timing out. */ - if (intrstray[irq]++ <= 5) + if (++strays <= 5) log(LOG_ERR, "stray interrupt %d%s\n", irq, - intrstray[irq] > 5 ? "; stopped logging" : ""); + strays >= 5 ? "; stopped logging" : ""); } int fastvec; @@ -199,18 +199,18 @@ intr_calculatemasks() imask[level] = irqs | SIR_ALLMASK; } -#include "sl.h" -#include "ppp.h" -#if NSL > 0 || NPPP > 0 - /* In the presence of SLIP or PPP, imp > tty. */ - imask[IPL_IMP] |= imask[IPL_TTY]; -#endif + /* + * There are tty, network and disk drivers that use free() at interrupt + * time, so imp > (tty | net | bio). + */ + imask[IPL_IMP] |= imask[IPL_TTY] | imask[IPL_NET] | imask[IPL_BIO]; /* - * There are network and disk drivers that use free() at interrupt - * time, so imp > (net | bio). + * Enforce a hierarchy that gives slow devices a better chance at not + * dropping data. */ - imask[IPL_IMP] |= imask[IPL_NET] | imask[IPL_BIO]; + imask[IPL_TTY] |= imask[IPL_NET] | imask[IPL_BIO]; + imask[IPL_NET] |= imask[IPL_BIO]; /* And eventually calculate the complete masks. */ for (irq = 0; irq < ICU_LEN; irq++) { @@ -249,13 +249,12 @@ fakeintr(arg) * XXX PRONE TO RACE CONDITIONS, UGLY, 'INTERESTING' INSERTION ALGORITHM. */ void * -isa_intr_establish(irq, type, level, ih_fun, ih_arg, ih_what) +isa_intr_establish(irq, type, level, ih_fun, ih_arg) int irq; int type; int level; int (*ih_fun) __P((void *)); void *ih_arg; - char *ih_what; { struct intrhand **p, *q, *ih; static struct intrhand fakehand = {fakeintr}; @@ -309,7 +308,6 @@ isa_intr_establish(irq, type, level, ih_fun, ih_arg, ih_what) ih->ih_next = NULL; ih->ih_level = level; ih->ih_irq = irq; - ih->ih_what = ih_what; *p = ih; return (ih); diff --git a/sys/arch/i386/isa/isa_machdep.h b/sys/arch/i386/isa/isa_machdep.h index 56f956f8c2f..495653d9b65 100644 --- a/sys/arch/i386/isa/isa_machdep.h +++ b/sys/arch/i386/isa/isa_machdep.h @@ -78,6 +78,21 @@ /* + * Interrupt handler chains. isa_intr_establish() inserts a handler into + * the list. The handler is called with its (single) argument. + */ + +struct intrhand { + int (*ih_fun)(); + void *ih_arg; + u_long ih_count; + struct intrhand *ih_next; + int ih_level; + int ih_irq; +}; + + +/* * ISA DMA bounce buffers. * XXX should be made partially machine- and bus-mapping-independent. * diff --git a/sys/arch/i386/isa/lms.c b/sys/arch/i386/isa/lms.c index 151fc590264..7c453919051 100644 --- a/sys/arch/i386/isa/lms.c +++ b/sys/arch/i386/isa/lms.c @@ -1,4 +1,4 @@ -/* $NetBSD: lms.c,v 1.20 1995/10/05 22:06:47 mycroft Exp $ */ +/* $NetBSD: lms.c,v 1.21 1995/12/24 02:30:17 mycroft Exp $ */ /*- * Copyright (c) 1993, 1994 Charles Hannum. @@ -120,7 +120,7 @@ lmsattach(parent, self, aux) sc->sc_state = 0; sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_PULSE, IPL_TTY, lmsintr, - sc, sc->sc_dev.dv_xname); + sc); } int diff --git a/sys/arch/i386/isa/mms.c b/sys/arch/i386/isa/mms.c index ef2fa5e1d69..ae4f144e726 100644 --- a/sys/arch/i386/isa/mms.c +++ b/sys/arch/i386/isa/mms.c @@ -1,4 +1,4 @@ -/* $NetBSD: mms.c,v 1.19 1995/10/05 22:06:51 mycroft Exp $ */ +/* $NetBSD: mms.c,v 1.20 1995/12/24 02:30:19 mycroft Exp $ */ /*- * Copyright (c) 1993, 1994 Charles Hannum. @@ -110,7 +110,7 @@ mmsattach(parent, self, aux) sc->sc_state = 0; sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_PULSE, IPL_TTY, mmsintr, - sc, sc->sc_dev.dv_xname); + sc); } int diff --git a/sys/arch/i386/isa/npx.c b/sys/arch/i386/isa/npx.c index 9b58f0e8313..3ec32a58889 100644 --- a/sys/arch/i386/isa/npx.c +++ b/sys/arch/i386/isa/npx.c @@ -326,7 +326,7 @@ npxattach(parent, self, aux) printf("\n"); lcr0(rcr0() & ~CR0_NE); sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_NONE, - npxintr, 0, "npx"); + npxintr, 0); break; case NPX_EXCEPTION: printf(": using exception 16\n"); diff --git a/sys/arch/i386/isa/pccons.c b/sys/arch/i386/isa/pccons.c index 73277988ed5..fefe23887d3 100644 --- a/sys/arch/i386/isa/pccons.c +++ b/sys/arch/i386/isa/pccons.c @@ -1,4 +1,4 @@ -/* $NetBSD: pccons.c,v 1.90 1995/10/11 04:20:33 mycroft Exp $ */ +/* $NetBSD: pccons.c,v 1.91 1995/12/24 02:30:25 mycroft Exp $ */ /*- * Copyright (c) 1993, 1994, 1995 Charles Hannum. All rights reserved. @@ -471,7 +471,7 @@ pcattach(parent, self, aux) do_async_update(1); sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_TTY, pcintr, - sc, sc->sc_dev.dv_xname); + sc); } int diff --git a/sys/arch/i386/isa/pcvt/Util/vgaio/vgaio.h b/sys/arch/i386/isa/pcvt/Util/vgaio/vgaio.h index b2d09999282..ee8c5c22935 100644 --- a/sys/arch/i386/isa/pcvt/Util/vgaio/vgaio.h +++ b/sys/arch/i386/isa/pcvt/Util/vgaio/vgaio.h @@ -37,8 +37,13 @@ * The author may be reached unter <joerg_wunsch@uriah.sax.de> * * $Log: vgaio.h,v $ - * Revision 1.1 1995/10/18 08:50:49 deraadt - * Initial revision + * Revision 1.2 1996/03/19 21:09:52 mickey + * Merging w/ NetBSD 021796. + * speaker upgraded to the current. + * some changes to the VM stuff (ie kern_thread.c added and so). + * + * Revision 1.1.1.1 1996/02/16 18:59:24 niklas + * Checkin of the NetBSD src/, supped 960203 * * Revision 1.3 1995/10/07 21:46:02 jtc * Overlay our pcvt with pcvt 3.32 sources. All of our fixes have been diff --git a/sys/arch/i386/isa/pcvt/pcvt_conf.h b/sys/arch/i386/isa/pcvt/pcvt_conf.h index 379475bf49f..7a21fb3c8e3 100644 --- a/sys/arch/i386/isa/pcvt/pcvt_conf.h +++ b/sys/arch/i386/isa/pcvt/pcvt_conf.h @@ -179,7 +179,7 @@ #endif #if !defined PCVT_PRETTYSCRNS /* ---------- DEFAULT: OFF ------------ */ -# define PCVT_PRETTYSCRNS 0 /* for the cost of some microseconds of */ +# define PCVT_PRETTYSCRNS 1 /* for the cost of some microseconds of */ #elif PCVT_PRETTYSCRNS != 0 /* cpu time this adds a more "pretty" */ # undef PCVT_PRETTYSCRNS /* version to the screensaver, an "*" */ # define PCVT_PRETTYSCRNS 1 /* in random locations of the display. */ @@ -462,7 +462,7 @@ #define COLOR_KERNEL_FG FG_LIGHTGREY /* kernel messages, foreground */ #endif #if !defined COLOR_KERNEL_BG -#define COLOR_KERNEL_BG BG_RED /* kernel messages, background */ +#define COLOR_KERNEL_BG BG_BLUE /* kernel messages, background */ #endif #if !defined MONO_KERNEL_FG /* monochrome displays */ diff --git a/sys/arch/i386/isa/pcvt/pcvt_drv.c b/sys/arch/i386/isa/pcvt/pcvt_drv.c index 0f71a01d6fd..220b4465b3a 100644 --- a/sys/arch/i386/isa/pcvt/pcvt_drv.c +++ b/sys/arch/i386/isa/pcvt/pcvt_drv.c @@ -336,7 +336,7 @@ pcattach(struct isa_device *dev) #if PCVT_NETBSD > 101 sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_TTY, pcintr, - (void *)0, sc->sc_dev.dv_xname); + (void *)0); #else /* PCVT_NETBSD > 100 */ vthand.ih_fun = pcrint; vthand.ih_arg = 0; diff --git a/sys/arch/i386/isa/pcvt/pcvt_hdr.h b/sys/arch/i386/isa/pcvt/pcvt_hdr.h index 615e19abeb3..b41ea8e2d3a 100644 --- a/sys/arch/i386/isa/pcvt/pcvt_hdr.h +++ b/sys/arch/i386/isa/pcvt/pcvt_hdr.h @@ -72,8 +72,6 @@ #define PCVT_REL "3.32" /* driver attach announcement */ /* see also: pcvt_ioctl.h */ -#if PCVT_FREEBSD >= 200 - #include <sys/param.h> #include <sys/conf.h> #include <sys/ioctl.h> @@ -88,110 +86,65 @@ #include <sys/malloc.h> #include <sys/time.h> -#else /* ! PCVT_FREEBSD >= 200 */ - -#include "param.h" -#include "conf.h" -#include "ioctl.h" -#include "proc.h" -#include "user.h" -#include "tty.h" -#include "uio.h" -#include "callout.h" -#include "systm.h" -#include "kernel.h" -#include "syslog.h" -#include "malloc.h" -#include "time.h" - -#endif /* PCVT_FREEBSD >= 200 */ - #include "pcvt_conf.h" #if PCVT_NETBSD > 9 -#include "device.h" +#include <sys/device.h> #endif #if PCVT_NETBSD > 9 #if PCVT_NETBSD > 101 -#include "i386/isa/isa_machdep.h" -#include "dev/isa/isavar.h" +#include <i386/isa/isa_machdep.h> +#include <dev/isa/isavar.h> #else -#include "i386/isa/isavar.h" +#include <i386/isa/isavar.h> #endif - -#include "i386/cpufunc.h" -#elif PCVT_FREEBSD >= 200 -#include <i386/isa/isa_device.h> +#include <machine/cpufunc.h> #else -#include "i386/isa/isa_device.h" +#include <i386/isa/isa_device.h> #endif -#if PCVT_FREEBSD >= 200 #include <i386/isa/icu.h> -#else -#include "i386/isa/icu.h" -#endif #if PCVT_NETBSD > 100 #if PCVT_NETBSD > 101 -#include "dev/isa/isareg.h" +#include <dev/isa/isareg.h> #else -#include "i386/isa/isareg.h" +#include <i386/isa/isareg.h> #endif -#elif PCVT_FREEBSD >= 200 -#include <i386/isa/isa.h> #else -#include "i386/isa/isa.h" +#include <i386/isa/isa.h> #endif #if PCVT_NETBSD > 9 -#include "dev/cons.h" +#include <dev/cons.h> #if PCVT_NETBSD > 100 -#include "dev/ic/mc146818reg.h" -#include "i386/isa/nvram.h" +#include <dev/ic/mc146818reg.h> +#include <i386/isa/nvram.h> #endif -#elif PCVT_FREEBSD >= 200 -#include <i386/i386/cons.h> #else -#include "i386/i386/cons.h" +#include <i386/i386/cons.h> #endif #if PCVT_NETBSD <= 9 -#if PCVT_FREEBSD >= 200 #include <machine/psl.h> #include <machine/frame.h> -#else /* ! PCVT_FREEBSD >= 200 */ -#include "machine/psl.h" -#include "machine/frame.h" -#endif /* PCVT_FREEBSD >= 200 */ #endif /* PCVT_NETBSD <= 9 */ -#if PCVT_FREEBSD >= 200 #include <machine/stdarg.h> -#else -#include "machine/stdarg.h" -#endif #if PCVT_NETBSD > 9 #include "pcvt_ioctl.h" -#elif PCVT_FREEBSD >= 200 -#include <machine/pcvt_ioctl.h> #else -#include "machine/pcvt_ioctl.h" +#include <machine/pcvt_ioctl.h> #endif -#if PCVT_FREEBSD >= 200 #include <machine/pc/display.h> #if PCVT_FREEBSD > 200 #include <machine/clock.h> #include <machine/md_var.h> #endif #include <vm/vm_kern.h> -#else /* PCVT_FREEBSD >= 200 */ -#include "machine/pc/display.h" -#include "vm/vm_kern.h" -#endif /* PCVT_FREEBSD >= 200 */ #if PCVT_FREEBSD > 205 #include <sys/devconf.h> @@ -252,9 +205,9 @@ in the config file" #if PCVT_NETBSD #if PCVT_NETBSD == 9 -#include "machine/cpufunc.h" /* NetBSD 0.9 [...and earlier -currents] */ +#include <machine/cpufunc.h> /* NetBSD 0.9 [...and earlier -currents] */ #else -#include "machine/pio.h" /* recent NetBSD -currents */ +#include <machine/pio.h> /* recent NetBSD -currents */ #define NEW_AVERUNNABLE /* averunnable changes for younger currents */ #endif /* PCVT_NETBSD == 9 */ #endif /* PCVT_NETBSD */ @@ -763,9 +716,7 @@ EXTERN u_short user_attr; /* character attributes */ #if !PCVT_EMU_MOUSE -#if PCVT_NETBSD > 100 -/* nothing */ -#elif PCVT_NETBSD +#if PCVT_NETBSD EXTERN struct tty *pc_tty[PCVT_NSCREENS]; #elif !(PCVT_FREEBSD > 110 && PCVT_FREEBSD < 200) EXTERN struct tty pccons[PCVT_NSCREENS]; @@ -775,9 +726,7 @@ EXTERN struct tty *pccons[PCVT_NSCREENS]; #else /* PCVT_EMU_MOUSE */ -#if PCVT_NETBSD > 100 -/* nothing */ -#elif PCVT_NETBSD +#if PCVT_NETBSD EXTERN struct tty *pc_tty[PCVT_NSCREENS + 1]; #elif !(PCVT_FREEBSD > 110 && PCVT_FREEBSD < 200) EXTERN struct tty pccons[PCVT_NSCREENS + 1]; diff --git a/sys/arch/i386/isa/pcvt/pcvt_ioctl.h b/sys/arch/i386/isa/pcvt/pcvt_ioctl.h index bcef870bed9..a3e7d413406 100644 --- a/sys/arch/i386/isa/pcvt/pcvt_ioctl.h +++ b/sys/arch/i386/isa/pcvt/pcvt_ioctl.h @@ -75,10 +75,8 @@ #define PCVTIDMAJOR 3 /* driver id - major release */ #define PCVTIDMINOR 32 /* driver id - minor release */ -#if defined(KERNEL) || defined(_KERNEL) -#include "ioctl.h" -#else #include <sys/ioctl.h> +#if !defined(KERNEL) && !defined(_KERNEL) #include <sys/types.h> #endif diff --git a/sys/arch/i386/isa/pcvt/pcvt_kbd.c b/sys/arch/i386/isa/pcvt/pcvt_kbd.c index c7925fd407e..d13008c230b 100644 --- a/sys/arch/i386/isa/pcvt/pcvt_kbd.c +++ b/sys/arch/i386/isa/pcvt/pcvt_kbd.c @@ -1215,7 +1215,13 @@ loop: * less than half a second */ now = time; + +#if PCVT_NETBSD > 100 + timersub(&now,&mouse.lastmove,&now); +#else timevalsub(&now, &mouse.lastmove); +#endif + mouse.lastmove = time; accel = (now.tv_sec == 0 && now.tv_usec diff --git a/sys/arch/i386/isa/pms.c b/sys/arch/i386/isa/pms.c index 9cc0a6407ce..882b1a7951b 100644 --- a/sys/arch/i386/isa/pms.c +++ b/sys/arch/i386/isa/pms.c @@ -1,4 +1,4 @@ -/* $NetBSD: pms.c,v 1.23 1995/10/05 22:06:54 mycroft Exp $ */ +/* $NetBSD: pms.c,v 1.24 1995/12/24 02:30:28 mycroft Exp $ */ /*- * Copyright (c) 1994 Charles Hannum. @@ -193,7 +193,7 @@ pmsattach(parent, self, aux) sc->sc_state = 0; sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_TTY, pmsintr, - sc, sc->sc_dev.dv_xname); + sc); } int diff --git a/sys/arch/i386/isa/spkr.c b/sys/arch/i386/isa/spkr.c index 14fd48a7301..7db0a7b962c 100644 --- a/sys/arch/i386/isa/spkr.c +++ b/sys/arch/i386/isa/spkr.c @@ -1,4 +1,4 @@ -/* $NetBSD: spkr.c,v 1.18 1996/02/22 05:53:28 scottr Exp $ */ +/* $NetBSD: spkr.c,v 1.22 1996/03/18 01:26:12 jtk Exp $ */ /* * spkr.c -- device driver for console speaker on 80386 @@ -11,6 +11,9 @@ #include "spkr.h" #if NSPKR > 0 +#if NSPKR > 1 +#error only one speaker device per system +#endif #include <sys/param.h> #include <sys/kernel.h> @@ -411,17 +414,38 @@ size_t slen; static int spkr_active; /* exclusion flag */ static struct buf *spkr_inbuf; /* incoming buf */ -int spkrprobe (struct device *parent, void *match, void *aux) +int spkrprobe (parent, match, aux) + struct device *parent; + void *match; + void *aux; { - struct isa_attach_args *ia = aux; - - ia->ia_iosize = 0; - return 1; + register struct isa_attach_args *ia = aux; + struct cfdata *cf = match; + /* + * We only attach to the keyboard controller via + * the console drivers. (We really wish we could be the + * child of a real keyboard controller driver.) + */ + if ((parent == NULL) || + ((strcmp(parent->dv_cfdata->cf_driver->cd_name, "pc") != 0) && + (strcmp(parent->dv_cfdata->cf_driver->cd_name, "vt") != 0))) + return (0); + if (cf->cf_loc[1] != PITAUX_PORT) + return (0); + + return (1); } -void spkrattach (struct device *parent, struct device *self, void *aux) +static int spkr_attached = 0; + +void +spkrattach(parent, self, aux) + struct device *parent; + struct device *self; + void *aux; { - printf("\n"); + printf(" port 0x%x\n", self->dv_cfdata->cf_loc[1]); + spkr_attached = 1; } int spkropen(dev) @@ -431,7 +455,7 @@ dev_t dev; printf("spkropen: entering with dev = %x\n", dev); #endif /* DEBUG */ - if (minor(dev) != 0) + if (minor(dev) != 0 || !spkr_attached) return(ENXIO); else if (spkr_active) return(EBUSY); diff --git a/sys/arch/i386/isa/vector.s b/sys/arch/i386/isa/vector.s index ef282214161..82202e35044 100644 --- a/sys/arch/i386/isa/vector.s +++ b/sys/arch/i386/isa/vector.s @@ -292,8 +292,6 @@ INTR(15, IO_ICU2, ACK2) /* * These tables are used by the ISA configuration code. */ - .data - /* interrupt service routine entry points */ IDTVEC(intr) .long _Xintr0, _Xintr1, _Xintr2, _Xintr3, _Xintr4, _Xintr5, _Xintr6 @@ -328,14 +326,10 @@ IDTVEC(recurse) .long _Xsofttty, _Xsoftnet, _Xsoftclock /* Some bogus data, to keep vmstat happy, for now. */ - .globl _intrcnt, _eintrcnt -_intrcnt: - .long 0 -_eintrcnt: - - .globl _intrnames, _eintrnames + .globl _intrnames, _eintrnames, _intrcnt, _eintrcnt _intrnames: - .long 0 + .long 0 _eintrnames: - - .text +_intrcnt: + .long 0 +_eintrcnt: |