summaryrefslogtreecommitdiffstats
path: root/sys/pccard/pccard.c
diff options
context:
space:
mode:
authornate <nate@FreeBSD.org>1997-01-11 18:23:20 +0000
committernate <nate@FreeBSD.org>1997-01-11 18:23:20 +0000
commit74e2dbdd0962c9c9675a75887cb3494992d8d81e (patch)
treef7c60d90f7e55971345c032d841959b4d84a160d /sys/pccard/pccard.c
parent8a825f6d66e058aef45a59f2e60978de7197881d (diff)
downloadFreeBSD-src-74e2dbdd0962c9c9675a75887cb3494992d8d81e.zip
FreeBSD-src-74e2dbdd0962c9c9675a75887cb3494992d8d81e.tar.gz
Update the PCIC controller's imask with individual slot IRQ's.
Assuming that the intr_mask[] was updated by changing the maskptrs (the existing update_intr_masks() function will not work) this code was written so the PCIC controller insertion/removal events will not interrupt the card IRQ handler events. Some possible scenarios: + Card is removed during IRQ handler: - PCIC card handler is allowed to interrupt - card removal event is called, removing the driver and data structures * card interrupt handler continues w/out driver, data structures, and hardware OR (the code just committed) * card IRQ handler has no hardware to read/write to, but has code and data to run on (XXX- Assume it completes and doesn't spin forever) - PCIC card handler unloads the card driver The current situation at least leaves the card interrupt handlers the drivers and data structures to work with although the hardware can't be guaranteed. Reviewed by: bde
Diffstat (limited to 'sys/pccard/pccard.c')
-rw-r--r--sys/pccard/pccard.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/sys/pccard/pccard.c b/sys/pccard/pccard.c
index 623413e..75846ad 100644
--- a/sys/pccard/pccard.c
+++ b/sys/pccard/pccard.c
@@ -305,8 +305,11 @@ disable_slot(struct slot *sp)
unregister_intr(sp->irq, slot_irq_handler);
if (devp->drv->imask)
INTRUNMASK(*devp->drv->imask,(1<<sp->irq));
+ /* Remove from the PCIC controller imask */
+ if (sp->ctrl->imask)
+ INTRUNMASK(*(sp->ctrl->imask), (i<<sp->irq));
sp->irq = 0;
- }
+ }
splx(s);
}
}
@@ -439,7 +442,8 @@ pccard_alloc_slot(struct slot_ctrl *cp)
* allowed are passed as a mask.
*/
int
-pccard_alloc_intr(int imask, inthand2_t *hand, int unit, int *maskp)
+pccard_alloc_intr(u_int imask, inthand2_t *hand, int unit,
+ u_int *maskp, u_int *pcic_imask)
{
int irq;
unsigned int mask;
@@ -451,6 +455,8 @@ pccard_alloc_intr(int imask, inthand2_t *hand, int unit, int *maskp)
if (maskp)
INTRMASK (*maskp, mask);
if (register_intr(irq, 0, 0, hand, maskp, unit)==0) {
+ /* add this to the PCIC controller's mask */
+ INTRMASK(*pcic_imask, (1 << irq));
INTREN (mask);
return(irq);
}
@@ -506,7 +512,8 @@ allocate_driver(struct slot *sp, struct drv_desc *drvp)
* device relies on a different interrupt mask.
*/
irq = pccard_alloc_intr(drvp->irqmask,
- slot_irq_handler, (int)sp, dp->imask);
+ slot_irq_handler, (int)sp,
+ dp->imask, sp->ctrl->imask);
if (irq < 0)
return(EINVAL);
sp->irq = irq;
@@ -578,6 +585,9 @@ remove_device(struct pccard_dev *devp)
unregister_intr(sp->irq, slot_irq_handler);
if (devp->drv->imask)
INTRUNMASK(*devp->drv->imask,(1<<sp->irq));
+ /* Remove from PCIC controller imask */
+ if (sp->ctrl->imask)
+ INTRUNMASK(*(sp->ctrl->imask),(1<<sp->irq));
sp->irq = 0;
}
splx(s);
OpenPOWER on IntegriCloud