Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/sunxi Adjust irq mask/unmask along with enable/...



details:   https://anonhg.NetBSD.org/src/rev/5b64497ca14e
branches:  trunk
changeset: 827344:5b64497ca14e
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Tue Oct 24 15:07:09 2017 +0000

description:
Adjust irq mask/unmask along with enable/disable to make qemu happy

diffstat:

 sys/arch/arm/sunxi/sunxi_intc.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (43 lines):

diff -r 4099a963d518 -r 5b64497ca14e sys/arch/arm/sunxi/sunxi_intc.c
--- a/sys/arch/arm/sunxi/sunxi_intc.c   Tue Oct 24 15:06:23 2017 +0000
+++ b/sys/arch/arm/sunxi/sunxi_intc.c   Tue Oct 24 15:07:09 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_intc.c,v 1.2 2017/10/11 00:17:03 jmcneill Exp $ */
+/* $NetBSD: sunxi_intc.c,v 1.3 2017/10/24 15:07:09 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
 #define        _INTR_PRIVATE
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_intc.c,v 1.2 2017/10/11 00:17:03 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_intc.c,v 1.3 2017/10/24 15:07:09 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -96,6 +96,7 @@
        KASSERT((mask & sc->sc_enabled_irqs[group]) == 0);
        sc->sc_enabled_irqs[group] |= mask;
        INTC_WRITE(sc, INTC_EN_REG(group), sc->sc_enabled_irqs[group]);
+       INTC_WRITE(sc, INTC_MASK_REG(group), ~sc->sc_enabled_irqs[group]);
 }
 
 static void
@@ -106,6 +107,7 @@
 
        sc->sc_enabled_irqs[group] &= ~mask;
        INTC_WRITE(sc, INTC_EN_REG(group), sc->sc_enabled_irqs[group]);
+       INTC_WRITE(sc, INTC_MASK_REG(group), ~sc->sc_enabled_irqs[group]);
 }
 
 static void
@@ -246,7 +248,7 @@
        /* Disable IRQs */
        for (i = 0; i < INTC_MAX_GROUPS; i++) {
                INTC_WRITE(sc, INTC_EN_REG(i), 0);
-               INTC_WRITE(sc, INTC_MASK_REG(i), 0);
+               INTC_WRITE(sc, INTC_MASK_REG(i), ~0U);
                INTC_WRITE(sc, INTC_IRQ_PEND_REG(i),
                    INTC_READ(sc, INTC_IRQ_PEND_REG(i)));
        }



Home | Main Index | Thread Index | Old Index