diff options
author | se <se@FreeBSD.org> | 1995-03-16 17:31:19 +0000 |
---|---|---|
committer | se <se@FreeBSD.org> | 1995-03-16 17:31:19 +0000 |
commit | 9c613cfeaeb4019f90ec8d3ffdfc4142386b7463 (patch) | |
tree | 44140fef668a4b2ce58ec40af489682af470daf7 | |
parent | 0a1bcbbaf5027033cf9790da182ad8fffd3f9898 (diff) | |
download | FreeBSD-src-9c613cfeaeb4019f90ec8d3ffdfc4142386b7463.zip FreeBSD-src-9c613cfeaeb4019f90ec8d3ffdfc4142386b7463.tar.gz |
Prepare for shared interrupts (required by the new PCI code that adds
support for PCI PCI bridges, e.g. found on 4ch. Ethernet cards).
Submitted by: Wolfgang Stanglmeier <wolf@kintaro.cologne.de>
-rw-r--r-- | sys/amd64/isa/isa.c | 29 | ||||
-rw-r--r-- | sys/i386/isa/isa.c | 29 | ||||
-rw-r--r-- | sys/i386/isa/isa_device.h | 3 |
3 files changed, 58 insertions, 3 deletions
diff --git a/sys/amd64/isa/isa.c b/sys/amd64/isa/isa.c index 5bb18f4..0761ed9 100644 --- a/sys/amd64/isa/isa.c +++ b/sys/amd64/isa/isa.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)isa.c 7.2 (Berkeley) 5/13/91 - * $Id: isa.c,v 1.38 1995/02/25 18:29:10 phk Exp $ + * $Id: isa.c,v 1.39 1995/02/25 18:55:53 phk Exp $ */ /* @@ -105,6 +105,7 @@ u_long *intr_countp[ICU_LEN]; inthand2_t *intr_handler[ICU_LEN]; u_int intr_mask[ICU_LEN]; +u_int* intr_mptr[ICU_LEN]; int intr_unit[ICU_LEN]; struct kern_devconf kdc_isa0 = { @@ -955,6 +956,29 @@ isa_irq_pending(dvp) } int +update_intr_masks(void) +{ + int intr, n=0; + u_int mask,*maskptr; + for (intr=0; intr < ICU_LEN; intr ++) { + if (intr==2) continue; + maskptr = intr_mptr[intr]; + if (!maskptr) continue; + mask = *maskptr; + if (mask != intr_mask[intr]) { +#if 0 + printf ("intr_mask[%2d] old=%08x new=%08x ptr=%p.\n", + intr, intr_mask[intr], mask, maskptr); +#endif + intr_mask[intr]=mask; + n++; + } + + } + return (n); +} + +int register_intr(intr, device_id, flags, handler, maskptr, unit) int intr; int device_id; @@ -977,6 +1001,7 @@ register_intr(intr, device_id, flags, handler, maskptr, unit) disable_intr(); intr_countp[intr] = &intrcnt[device_id]; intr_handler[intr] = handler; + intr_mptr[intr] = maskptr; intr_mask[intr] = mask | (1 << intr); intr_unit[intr] = unit; setidt(ICU_OFFSET + intr, @@ -1009,6 +1034,7 @@ register_imask(dvp, mask) intr = ffs(dvp->id_irq) - 1; intr_mask[intr] = mask | (1 <<intr); } + (void) update_intr_masks(); } int @@ -1024,6 +1050,7 @@ unregister_intr(intr, handler) disable_intr(); intr_countp[intr] = &intrcnt[NR_DEVICES + intr]; intr_handler[intr] = isa_strayintr; + intr_mptr[intr] = NULL; intr_mask[intr] = HWI_MASK | SWI_MASK; intr_unit[intr] = intr; setidt(ICU_OFFSET + intr, slowintr[intr], SDT_SYS386IGT, SEL_KPL); diff --git a/sys/i386/isa/isa.c b/sys/i386/isa/isa.c index 5bb18f4..0761ed9 100644 --- a/sys/i386/isa/isa.c +++ b/sys/i386/isa/isa.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)isa.c 7.2 (Berkeley) 5/13/91 - * $Id: isa.c,v 1.38 1995/02/25 18:29:10 phk Exp $ + * $Id: isa.c,v 1.39 1995/02/25 18:55:53 phk Exp $ */ /* @@ -105,6 +105,7 @@ u_long *intr_countp[ICU_LEN]; inthand2_t *intr_handler[ICU_LEN]; u_int intr_mask[ICU_LEN]; +u_int* intr_mptr[ICU_LEN]; int intr_unit[ICU_LEN]; struct kern_devconf kdc_isa0 = { @@ -955,6 +956,29 @@ isa_irq_pending(dvp) } int +update_intr_masks(void) +{ + int intr, n=0; + u_int mask,*maskptr; + for (intr=0; intr < ICU_LEN; intr ++) { + if (intr==2) continue; + maskptr = intr_mptr[intr]; + if (!maskptr) continue; + mask = *maskptr; + if (mask != intr_mask[intr]) { +#if 0 + printf ("intr_mask[%2d] old=%08x new=%08x ptr=%p.\n", + intr, intr_mask[intr], mask, maskptr); +#endif + intr_mask[intr]=mask; + n++; + } + + } + return (n); +} + +int register_intr(intr, device_id, flags, handler, maskptr, unit) int intr; int device_id; @@ -977,6 +1001,7 @@ register_intr(intr, device_id, flags, handler, maskptr, unit) disable_intr(); intr_countp[intr] = &intrcnt[device_id]; intr_handler[intr] = handler; + intr_mptr[intr] = maskptr; intr_mask[intr] = mask | (1 << intr); intr_unit[intr] = unit; setidt(ICU_OFFSET + intr, @@ -1009,6 +1034,7 @@ register_imask(dvp, mask) intr = ffs(dvp->id_irq) - 1; intr_mask[intr] = mask | (1 <<intr); } + (void) update_intr_masks(); } int @@ -1024,6 +1050,7 @@ unregister_intr(intr, handler) disable_intr(); intr_countp[intr] = &intrcnt[NR_DEVICES + intr]; intr_handler[intr] = isa_strayintr; + intr_mptr[intr] = NULL; intr_mask[intr] = HWI_MASK | SWI_MASK; intr_unit[intr] = intr; setidt(ICU_OFFSET + intr, slowintr[intr], SDT_SYS386IGT, SEL_KPL); diff --git a/sys/i386/isa/isa_device.h b/sys/i386/isa/isa_device.h index 63c5408..fbad210 100644 --- a/sys/i386/isa/isa_device.h +++ b/sys/i386/isa/isa_device.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)isa_device.h 7.1 (Berkeley) 5/9/91 - * $Id: isa_device.h,v 1.17 1994/11/03 04:15:04 jkh Exp $ + * $Id: isa_device.h,v 1.18 1995/03/12 13:23:10 ugen Exp $ */ #ifndef _I386_ISA_ISA_DEVICE_H_ @@ -136,6 +136,7 @@ int isa_nmi __P((int cd)); int register_intr __P((int intr, int device_id, u_int flags, inthand2_t *handler, u_int *maskptr, int unit)); int unregister_intr __P((int intr, inthand2_t *handler)); +int update_intr_masks __P((void)); extern int isa_externalize(struct isa_device *, void *, size_t *); extern int isa_internalize(struct isa_device *, void **, size_t *); |