summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/or1k
diff options
context:
space:
mode:
authorHesham ALMatary <heshamelmatary@gmail.com>2014-09-15 17:33:30 -0500
committerJoel Sherrill <joel.sherrill@oarcorp.com>2014-09-16 09:53:01 -0500
commite0aef221a2c910c8caa01a1d97e886042df1a9ac (patch)
tree56223df2b4acfd3bc82da8abdf2b1fa18d14057b /cpukit/score/cpu/or1k
parentor1ksim: work-around to make or1ksim tick timer accurate. (diff)
downloadrtems-e0aef221a2c910c8caa01a1d97e886042df1a9ac.tar.bz2
score/cpu/or1k: Follow no_cpu ISR_Handler algorithm.
This patch adjusts ISR_Handler to exactly follow the pseudo code introduced in http://rtems.org/onlinedocs/doc-current/share/rtems/html/porting/Interrupts-Interrupt-Dispatching.html It adds two new checkings on _Thread_Dispatch_disable_level and _ISR_Nest_level after returning from the C handler.
Diffstat (limited to 'cpukit/score/cpu/or1k')
-rw-r--r--cpukit/score/cpu/or1k/or1k-exception-handler-low.S10
1 files changed, 10 insertions, 0 deletions
diff --git a/cpukit/score/cpu/or1k/or1k-exception-handler-low.S b/cpukit/score/cpu/or1k/or1k-exception-handler-low.S
index 3a0425b6d5..96d0c8e740 100644
--- a/cpukit/score/cpu/or1k/or1k-exception-handler-low.S
+++ b/cpukit/score/cpu/or1k/or1k-exception-handler-low.S
@@ -149,6 +149,16 @@ jump_to_c_handler:
l.sw 0(r6), r5
l.sw 0(r8), r7
+ /* Check if _ISR_Nest_level > 0 */
+ l.sfgtui r5, 0
+ l.bf exception_frame_restore
+ l.nop
+
+ /* Check if _Thread_Dispatch_disable_level > 0 */
+ l.sfgtui r7, 0
+ l.bf exception_frame_restore
+ l.nop
+
/* Check if dispatch needed */
l.movhi r31, hi(DISPATCH_NEEDED)
l.ori r31, r31, lo(DISPATCH_NEEDED)