]> git.proxmox.com Git - mirror_qemu.git/commitdiff
nvic: Fix ARMv7M MPU_RBAR reads
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 3 Nov 2017 18:13:33 +0000 (18:13 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 20 Nov 2017 13:39:48 +0000 (13:39 +0000)
Fix an incorrect mask expression in the handling of v7M MPU_RBAR
reads that meant that we would always report the ADDR field as zero.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 1509732813-22957-1-git-send-email-peter.maydell@linaro.org

hw/intc/armv7m_nvic.c

index be46639b63230471459ef9baa337c89e6795865e..5d9c8834ad550ceaf70250b80628b23e3061313c 100644 (file)
@@ -977,7 +977,7 @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs)
         if (region >= cpu->pmsav7_dregion) {
             return 0;
         }
-        return (cpu->env.pmsav7.drbar[region] & 0x1f) | (region & 0xf);
+        return (cpu->env.pmsav7.drbar[region] & ~0x1f) | (region & 0xf);
     }
     case 0xda0: /* MPU_RASR (v7M), MPU_RLAR (v8M) */
     case 0xda8: /* MPU_RASR_A1 (v7M), MPU_RLAR_A1 (v8M) */