[rtems commit] NIOS2: Fix outermost interrupt check
Sebastian Huber
sebh at rtems.org
Fri Mar 30 13:03:10 UTC 2012
Module: rtems
Branch: master
Commit: 64d2c8adf9ce52580fe228d4e6566e288ed756a2
Changeset: http://git.rtems.org/rtems/commit/?id=64d2c8adf9ce52580fe228d4e6566e288ed756a2
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Fri Mar 30 14:55:17 2012 +0200
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 files changed, 4 insertions(+), 1 deletions(-)
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 8f8556f..b7c38f3 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? */
More information about the vc
mailing list