diff options
author | Sergey Sorokin <afarallax@yandex.ru> | 2015-09-07 10:39:30 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2015-09-07 10:39:30 +0100 |
commit | 771842585f3119f69641ed90a97d56eb9ed6f5ae (patch) | |
tree | 8ba83dc8ad25d5877f05a623059085bb1a3163a7 /target-arm/cpu.h | |
parent | 5125f9cd2532f0aca25d966ecd27d0e30d4af7c9 (diff) |
target-arm: Fix arm_excp_unmasked() function
There is an error in arm_excp_unmasked() function:
bitwise operator & is used with integer and bool operands
causing an incorrect zeroed result.
The patch fixes it.
Signed-off-by: Sergey Sorokin <afarallax@yandex.ru>
Message-id: 1441209238-16881-1-git-send-email-afarallax@yandex.ru
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target-arm/cpu.h')
-rw-r--r-- | target-arm/cpu.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/target-arm/cpu.h b/target-arm/cpu.h index c794afcdbf..4bd5dc875c 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -1520,8 +1520,8 @@ static inline bool arm_excp_unmasked(CPUState *cs, unsigned int excp_idx, CPUARMState *env = cs->env_ptr; unsigned int cur_el = arm_current_el(env); bool secure = arm_is_secure(env); - uint32_t scr; - uint32_t hcr; + bool scr; + bool hcr; bool pstate_unmasked; int8_t unmasked = 0; @@ -1548,7 +1548,7 @@ static inline bool arm_excp_unmasked(CPUState *cs, unsigned int excp_idx, * set then FIQs can be masked by CPSR.F when non-secure but only * when FIQs are only routed to EL3. */ - scr &= !((env->cp15.scr_el3 & SCR_FW) && !hcr); + scr = scr && !((env->cp15.scr_el3 & SCR_FW) && !hcr); pstate_unmasked = !(env->daif & PSTATE_F); break; |