diff options
author | Patrick Wildt <patrick@cvs.openbsd.org> | 2018-03-30 19:30:58 +0000 |
---|---|---|
committer | Patrick Wildt <patrick@cvs.openbsd.org> | 2018-03-30 19:30:58 +0000 |
commit | b4a07e4693f0462b6cba002619dcdaacfd3ddce0 (patch) | |
tree | fc40104a1d80539fbef9a03ee0d9cdc8d4bf58bc /sys/arch | |
parent | fa00a502706230d6e39968ebc6c9c480f98d2b42 (diff) |
Replace MD disable/restore interrupt in the establish and disestablish
code in imxgpio(4) with splhigh() and splx() which is MI and should be
good enough for the job.
Discussed with kettenis@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/armv7/imx/imxgpio.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sys/arch/armv7/imx/imxgpio.c b/sys/arch/armv7/imx/imxgpio.c index ad16fbb1c7b..c81667ba3b0 100644 --- a/sys/arch/armv7/imx/imxgpio.c +++ b/sys/arch/armv7/imx/imxgpio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imxgpio.c,v 1.13 2018/03/30 19:26:38 patrick Exp $ */ +/* $OpenBSD: imxgpio.c,v 1.14 2018/03/30 19:30:57 patrick Exp $ */ /* * Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org> * Copyright (c) 2012-2013 Patrick Wildt <patrick@blueri.se> @@ -23,8 +23,6 @@ #include <sys/malloc.h> #include <sys/evcount.h> -#include <arm/cpufunc.h> - #include <machine/bus.h> #include <machine/fdt.h> #include <machine/intr.h> @@ -233,7 +231,7 @@ imxgpio_intr_establish(void *cookie, int *cells, int ipl, { struct imxgpio_softc *sc = (struct imxgpio_softc *)cookie; struct intrhand *ih; - int psw, val, reg, shift; + int s, val, reg, shift; int irqno = cells[0]; int level = cells[1]; @@ -254,7 +252,7 @@ imxgpio_intr_establish(void *cookie, int *cells, int ipl, ih->ih_level = level; ih->ih_sc = sc; - psw = disable_interrupts(PSR_I); + s = splhigh(); sc->sc_handlers[irqno] = ih; @@ -301,7 +299,7 @@ imxgpio_intr_establish(void *cookie, int *cells, int ipl, bus_space_write_4(sc->sc_iot, sc->sc_ioh, GPIO_IMR, bus_space_read_4(sc->sc_iot, sc->sc_ioh, GPIO_IMR) | 1 << irqno); - restore_interrupts(psw); + splx(s); return (ih); } @@ -311,9 +309,9 @@ imxgpio_intr_disestablish(void *cookie) struct intrhand *ih = cookie; struct imxgpio_softc *sc = ih->ih_sc; uint32_t mask; - int psw; + int s; - psw = disable_interrupts(PSR_I); + s = splhigh(); #ifdef DEBUG_INTC printf("%s: irq %d ipl %d [%s]\n", __func__, ih->ih_irq, ih->ih_ipl, @@ -331,7 +329,7 @@ imxgpio_intr_disestablish(void *cookie) imxgpio_recalc_ipl(sc); - restore_interrupts(psw); + splx(s); } void |