Changeset 18e1e5b in rtems for cpukit/score/cpu/arm/cpu_asm.S


Ignore:
Timestamp:
May 23, 2013, 7:04:19 AM (8 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
d9bd5cd6
Parents:
e67025e
git-author:
Sebastian Huber <sebastian.huber@…> (05/23/13 07:04:19)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/27/13 10:49:13)
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/cpu/arm/cpu_asm.S

    re67025e r18e1e5b  
    5555DEFINE_FUNCTION_ARM(_CPU_Context_switch)
    5656/* Start saving context */
    57         mrs     r2, cpsr
     57        mrs     r2, CPSR
    5858        stmia   r0,  {r2, r4, r5, r6, r7, r8, r9, r10, r11, r13, r14}
    5959
     
    7272
    7373        ldmia   r1,  {r2, r4, r5, r6, r7, r8, r9, r10, r11, r13, r14}
    74         msr     cpsr, r2
     74        msr     CPSR_fsxc, r2
    7575#ifdef __thumb__
    7676        bx      lr
Note: See TracChangeset for help on using the changeset viewer.