summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwuyangyong <[email protected]>2010-11-28 07:07:41 +0000
committerwuyangyong <[email protected]>2010-11-28 07:07:41 +0000
commitc7f84202bcfbcded172836f5734470f7af41a324 (patch)
tree45547127385cb2f213809210e4a2eb430f7a7089
parentf438f02b0fb2e4a8730bd49dfd9312b5204b097b (diff)
fix pendsv priority set by phoenix
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1126 bbd45198-f89e-11dd-88c7-29a3b14d5316
-rw-r--r--libcpu/arm/stm32/context_gcc.S4
-rw-r--r--libcpu/arm/stm32/context_iar.S4
-rw-r--r--libcpu/arm/stm32/context_rvds.S4
3 files changed, 9 insertions, 3 deletions
diff --git a/libcpu/arm/stm32/context_gcc.S b/libcpu/arm/stm32/context_gcc.S
index 04d45c1327..7124e77c44 100644
--- a/libcpu/arm/stm32/context_gcc.S
+++ b/libcpu/arm/stm32/context_gcc.S
@@ -146,7 +146,9 @@ rt_hw_context_switch_to:
/* set the PendSV exception priority */
LDR r0, =NVIC_SYSPRI2
LDR r1, =NVIC_PENDSV_PRI
- STR r1, [r0]
+ LDR.W r2, [r0,#0x00] ; read
+ ORR r1,r1,r2 ; modify
+ STR r1, [r0] ; write-back
LDR r0, =NVIC_INT_CTRL /* trigger the PendSV exception (causes context switch) */
LDR r1, =NVIC_PENDSVSET
diff --git a/libcpu/arm/stm32/context_iar.S b/libcpu/arm/stm32/context_iar.S
index ee2bb0f593..c4ad75abee 100644
--- a/libcpu/arm/stm32/context_iar.S
+++ b/libcpu/arm/stm32/context_iar.S
@@ -143,7 +143,9 @@ rt_hw_context_switch_to:
; set the PendSV exception priority
LDR r0, =NVIC_SYSPRI2
LDR r1, =NVIC_PENDSV_PRI
- STR r1, [r0]
+ LDR.W r2, [r0,#0x00] ; read
+ ORR r1,r1,r2 ; modify
+ STR r1, [r0] ; write-back
LDR r0, =NVIC_INT_CTRL ; trigger the PendSV exception (causes context switch)
LDR r1, =NVIC_PENDSVSET
diff --git a/libcpu/arm/stm32/context_rvds.S b/libcpu/arm/stm32/context_rvds.S
index e2dab09a80..15e526cca1 100644
--- a/libcpu/arm/stm32/context_rvds.S
+++ b/libcpu/arm/stm32/context_rvds.S
@@ -149,7 +149,9 @@ rt_hw_context_switch_to PROC
; set the PendSV exception priority
LDR r0, =NVIC_SYSPRI2
LDR r1, =NVIC_PENDSV_PRI
- STR r1, [r0]
+ LDR.W r2, [r0,#0x00] ; read
+ ORR r1,r1,r2 ; modify
+ STR r1, [r0] ; write-back
; trigger the PendSV exception (causes context switch)
LDR r0, =NVIC_INT_CTRL