From 18e1e5bbf11e637c7aa40ac12e4e9bd109df677b Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 23 May 2013 09:04:19 +0200 Subject: 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 --- cpukit/score/cpu/arm/cpu_asm.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cpukit/score/cpu/arm/cpu_asm.S') 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 -- cgit v1.2.3