pl061: fix wrong calculation of GPIOMIS register
authorVictor CLEMENT <victor.clement@openwide.fr>
Tue, 2 Jun 2015 13:56:23 +0000 (14:56 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 2 Jun 2015 13:56:25 +0000 (14:56 +0100)
The masked interrupt status register should be the state of the interrupt
after masking.
There should be a logical AND instead of a logical OR between the
interrupt status and the interrupt mask.

Signed-off-by: Victor CLEMENT <victor.clement@openwide.fr>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Message-id: 1433154824-6927-1-git-send-email-victor.clement@openwide.fr
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/gpio/pl061.c

index bd03e99..4ba730b 100644 (file)
@@ -173,7 +173,7 @@ static uint64_t pl061_read(void *opaque, hwaddr offset,
     case 0x414: /* Raw interrupt status */
         return s->istate;
     case 0x418: /* Masked interrupt status */
-        return s->istate | s->im;
+        return s->istate & s->im;
     case 0x420: /* Alternate function select */
         return s->afsel;
     case 0x500: /* 2mA drive */