From: jsg Date: Sat, 24 Feb 2018 12:46:45 +0000 (+0000) Subject: Enable interrupts while running interrupt handlers like we do on X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=bac9d37b78c42dff1ea6390945d7da79fb248efe;p=openbsd Enable interrupts while running interrupt handlers like we do on agintc(4) and ampintc(4). ok kettenis@ patrick@ --- diff --git a/sys/arch/arm64/dev/bcm2836_intr.c b/sys/arch/arm64/dev/bcm2836_intr.c index 27e45923fae..5a2beef6f02 100644 --- a/sys/arch/arm64/dev/bcm2836_intr.c +++ b/sys/arch/arm64/dev/bcm2836_intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bcm2836_intr.c,v 1.7 2018/02/23 21:47:08 kettenis Exp $ */ +/* $OpenBSD: bcm2836_intr.c,v 1.8 2018/02/24 12:46:45 jsg Exp $ */ /* * Copyright (c) 2007,2009 Dale Rahn * Copyright (c) 2015 Patrick Wildt @@ -80,7 +80,7 @@ struct intrhand { TAILQ_ENTRY(intrhand) ih_list; /* link on intrq list */ - int (*ih_fun)(void *); /* handler */ + int (*ih_func)(void *); /* handler */ void *ih_arg; /* arg for handler */ int ih_ipl; /* IPL_* */ int ih_flags; @@ -447,7 +447,7 @@ bcm_intc_call_handler(int irq, void *frame) { struct bcm_intc_softc *sc = bcm_intc; struct intrhand *ih; - int pri, s; + int pri, s, handled; void *arg; #ifdef DEBUG_INTC @@ -484,7 +484,10 @@ bcm_intc_call_handler(int irq, void *frame) else arg = frame; - if (ih->ih_fun(arg)) + enable_interrupts(); + handled = ih->ih_func(arg); + disable_interrupts(); + if (handled) ih->ih_count.ec_count++; #ifdef MULTIPROCESSOR @@ -558,7 +561,7 @@ bcm_intc_intr_establish(int irqno, int level, int (*func)(void *), psw = disable_interrupts(); ih = malloc(sizeof *ih, M_DEVBUF, M_WAITOK); - ih->ih_fun = func; + ih->ih_func = func; ih->ih_arg = arg; ih->ih_ipl = level & IPL_IRQMASK; ih->ih_flags = level & IPL_FLAGMASK;