/branches/arm/kernel/arch/arm32/include/context.h |
---|
50,6 → 50,7 |
/* Structure containing registers that must be preserved across function calls. */ |
typedef struct { |
uint32_t cpu_mode; |
uintptr_t sp; |
uintptr_t pc; |
61,7 → 62,7 |
uint32_t r9; |
uint32_t r10; |
uint32_t r11; |
ipl_t ipl; |
} context_t; |
/branches/arm/kernel/arch/arm32/src/context.S |
---|
32,6 → 32,11 |
.global context_restore_arch |
context_save_arch: |
stmfd sp!, {r1} |
mrs r1, cpsr |
and r1, r1, #0x1f |
stmia r0!, {r1} |
ldmfd sp!, {r1} |
stmia r0!, {sp, lr} |
stmia r0!, {r4-r11} |
42,9 → 47,15 |
context_restore_arch: |
ldmia r0!, {r4} |
mrs r5, cpsr |
bic r5, r5, #0x1f |
orr r5, r5, r4 |
msr cpsr_c, r5 |
ldmia r0!, {sp, lr} |
ldmia r0!, {r4-r11} |
mov r0, #0 |
mov pc, lr |