diff options
author | Patrick Wildt <patrick@cvs.openbsd.org> | 2016-08-06 11:04:48 +0000 |
---|---|---|
committer | Patrick Wildt <patrick@cvs.openbsd.org> | 2016-08-06 11:04:48 +0000 |
commit | 45dd434047193ad4ffdba23112428172d9bf12b9 (patch) | |
tree | ff90245b17e89300482bc18fac68c127b7c67d5a /sys/arch/arm | |
parent | 70abd43de7f6fa40cf4e9206d0d104911f401488 (diff) |
Rework ampintc's interrupt disestablish code to make it actually do
its job. Recalculate the mask after the handler is taken from the
list to properly set the new prioritization.
ok kettenis@
Diffstat (limited to 'sys/arch/arm')
-rw-r--r-- | sys/arch/arm/cortex/ampintc.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/sys/arch/arm/cortex/ampintc.c b/sys/arch/arm/cortex/ampintc.c index c6e9d9954f7..048af313f4c 100644 --- a/sys/arch/arm/cortex/ampintc.c +++ b/sys/arch/arm/cortex/ampintc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ampintc.c,v 1.10 2016/08/04 15:52:52 kettenis Exp $ */ +/* $OpenBSD: ampintc.c,v 1.11 2016/08/06 11:04:47 patrick Exp $ */ /* * Copyright (c) 2007,2009,2011 Dale Rahn <drahn@openbsd.org> * @@ -583,17 +583,25 @@ ampintc_intr_establish(int irqno, int level, int (*func)(void *), void ampintc_intr_disestablish(void *cookie) { -#if 0 - int psw; - struct intrhand *ih = cookie; - int irqno = ih->ih_irq; + struct ampintc_softc *sc = ampintc; + struct intrhand *ih = cookie; + int psw; + +#ifdef DEBUG_INTC + printf("ampintc_intr_disestablish irq %d level %d [%s]\n", + ih->ih_irq, ih->ih_ipl, ih->ih_name); +#endif + psw = disable_interrupts(PSR_I); - TAILQ_REMOVE(&sc->sc_ampintc_handler[irqno].iq_list, ih, ih_list); + + TAILQ_REMOVE(&sc->sc_ampintc_handler[ih->ih_irq].iq_list, ih, ih_list); if (ih->ih_name != NULL) evcount_detach(&ih->ih_count); - free(ih, M_DEVBUF, 0); + free(ih, M_DEVBUF, sizeof(*ih)); + + ampintc_calc_mask(); + restore_interrupts(psw); -#endif } const char * |