Patchwork [V2] ARM: Fix disable interrupt for M profile

login
register
mail settings
Submitter Fabien Chouteau
Date May 31, 2013, 9:20 a.m.
Message ID <1369992040-4039-1-git-send-email-chouteau@adacore.com>
Download mbox | patch
Permalink /patch/247873/
State New
Headers show

Comments

Fabien Chouteau - May 31, 2013, 9:20 a.m.
Fix the condition according to the requirement in the comment above.
Otherwise it's not possible to disable interrupt on M-profile.

Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
---
V2: The expression in the previous patch was wrong.

 cpu-exec.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/cpu-exec.c b/cpu-exec.c
index 31c089d..8626e78 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -462,8 +462,8 @@  int cpu_exec(CPUArchState *env)
                        We avoid this by disabling interrupts when
                        pc contains a magic address.  */
                     if (interrupt_request & CPU_INTERRUPT_HARD
-                        && ((IS_M(env) && env->regs[15] < 0xfffffff0)
-                            || !(env->uncached_cpsr & CPSR_I))) {
+                        && (!IS_M(env) || env->regs[15] < 0xfffffff0)
+                        && !(env->uncached_cpsr & CPSR_I)) {
                         env->exception_index = EXCP_IRQ;
                         cc->do_interrupt(cpu);
                         next_tb = 0;