From 64d2c8adf9ce52580fe228d4e6566e288ed756a2 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 30 Mar 2012 14:55:17 +0200 Subject: NIOS2: Fix outermost interrupt check This fix is critical. The previous implementation leads to system corruption. --- cpukit/score/cpu/nios2/nios2-eic-il-low-level.S | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cpukit') diff --git a/cpukit/score/cpu/nios2/nios2-eic-il-low-level.S b/cpukit/score/cpu/nios2/nios2-eic-il-low-level.S index 8f8556f825..b7c38f3ad4 100644 --- a/cpukit/score/cpu/nios2/nios2-eic-il-low-level.S +++ b/cpukit/score/cpu/nios2/nios2-eic-il-low-level.S @@ -70,6 +70,9 @@ _Nios2_ISR_Dispatch_with_shadow_non_preemptive: /* Load Nios II specific thread dispatch disabled */ ldw r13, %gprel(_Nios2_Thread_dispatch_disabled)(gp) + /* Read status */ + rdctl r14, status + /* Fix return address */ subi ea, ea, 4 @@ -88,7 +91,7 @@ _Nios2_ISR_Dispatch_with_shadow_non_preemptive: beq r12, zero, no_thread_dispatch /* Is outermost interrupt? */ - andhi r14, sstatus, 0x3f + andhi r14, r14, 0x3f bne r14, zero, no_thread_dispatch /* Is Nios II specific thread dispatch allowed? */ -- cgit v1.2.3