summaryrefslogtreecommitdiffstats
path: root/hw/gpio/pl061.c
diff options
context:
space:
mode:
authorVictor CLEMENT2015-06-02 15:56:23 +0200
committerPeter Maydell2015-06-02 15:56:25 +0200
commit0b2ff2ceb8a45cbe51ca13a1a32fc5bdeec71815 (patch)
tree916e23e70af189de62e8ec74e4559a32234a8202 /hw/gpio/pl061.c
parenttarget-arm: Add the GICv2m to the virt board (diff)
downloadqemu-0b2ff2ceb8a45cbe51ca13a1a32fc5bdeec71815.tar.gz
qemu-0b2ff2ceb8a45cbe51ca13a1a32fc5bdeec71815.tar.xz
qemu-0b2ff2ceb8a45cbe51ca13a1a32fc5bdeec71815.zip
pl061: fix wrong calculation of GPIOMIS register
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>
Diffstat (limited to 'hw/gpio/pl061.c')
-rw-r--r--hw/gpio/pl061.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/gpio/pl061.c b/hw/gpio/pl061.c
index bd03e99975..4ba730b476 100644
--- a/hw/gpio/pl061.c
+++ b/hw/gpio/pl061.c
@@ -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 */