summaryrefslogtreecommitdiff
path: root/libcpu
diff options
context:
space:
mode:
authorwuyangyong <[email protected]>2011-05-06 15:25:31 +0000
committerwuyangyong <[email protected]>2011-05-06 15:25:31 +0000
commitc98fd0226f7065f844e4f939774b9276ee8c44d2 (patch)
tree273f81b7400347482502e81add051ed663592d5e /libcpu
parenta607e1485b072afdf1739bc87e964610fad05b86 (diff)
fix Nios II rt_hw_context_switch_interrupt bug
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1396 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'libcpu')
-rw-r--r--libcpu/nios/nios_ii/context_gcc.S6
1 files changed, 6 insertions, 0 deletions
diff --git a/libcpu/nios/nios_ii/context_gcc.S b/libcpu/nios/nios_ii/context_gcc.S
index 5550c20251..a389db162d 100644
--- a/libcpu/nios/nios_ii/context_gcc.S
+++ b/libcpu/nios/nios_ii/context_gcc.S
@@ -213,6 +213,11 @@ rt_hw_context_switch:
.global rt_hw_context_switch_interrupt
.type rt_hw_context_switch_interrupt, %function
rt_hw_context_switch_interrupt:
+ /* if( rt_thread_switch_interrput_flag != 0 ) _from_thread_not_change */
+ ldw r2,%gprel(rt_thread_switch_interrput_flag)(gp)
+ bne r2,zero,_from_thread_not_change
+
+_from_thread_change:
/* save ea -> rt_current_thread_entry */
addi ea,ea,-4
stw ea,%gprel(rt_current_thread_entry)(gp)
@@ -224,6 +229,7 @@ rt_hw_context_switch_interrupt:
/* update rt_interrupt_from_thread */
stw r4,%gprel(rt_interrupt_from_thread)(gp)
+_from_thread_not_change:
/* update rt_interrupt_to_thread */
stw r5,%gprel(rt_interrupt_to_thread)(gp)