diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-05-23 09:04:19 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-05-27 12:49:13 +0200 |
commit | 18e1e5bbf11e637c7aa40ac12e4e9bd109df677b (patch) | |
tree | d2ac9617407fff20c60ce11b26d849d25d5f427c /cpukit/score/cpu/arm/cpu_asm.S | |
parent | dosfs: Add RTEMS_DOSFS_SEMAPHORES_PER_INSTANCE (diff) | |
download | rtems-18e1e5bbf11e637c7aa40ac12e4e9bd109df677b.tar.bz2 |
arm: Fix CPSR and SPSR access
The GNU assembler translates for example a
msr spsr, rN
into
msr SPSR_fc, rN
This would update only a subset of the register and leads to an
incomplete exceptions restore sequence resulting in system corruption.
Correct is this:
msr SPSR_fsxc, rN
Diffstat (limited to 'cpukit/score/cpu/arm/cpu_asm.S')
-rw-r--r-- | cpukit/score/cpu/arm/cpu_asm.S | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cpukit/score/cpu/arm/cpu_asm.S b/cpukit/score/cpu/arm/cpu_asm.S index 22dd7a34b5..af8f1531b6 100644 --- a/cpukit/score/cpu/arm/cpu_asm.S +++ b/cpukit/score/cpu/arm/cpu_asm.S @@ -54,7 +54,7 @@ DEFINE_FUNCTION_ARM(_CPU_Context_switch) /* Start saving context */ - mrs r2, cpsr + mrs r2, CPSR stmia r0, {r2, r4, r5, r6, r7, r8, r9, r10, r11, r13, r14} #ifdef ARM_MULTILIB_VFP_D32 @@ -71,7 +71,7 @@ _restore: #endif ldmia r1, {r2, r4, r5, r6, r7, r8, r9, r10, r11, r13, r14} - msr cpsr, r2 + msr CPSR_fsxc, r2 #ifdef __thumb__ bx lr nop |