Kernel/ARM: faster context save
This commit is contained in:
parent
fb4b3da7da
commit
df0c35f0f5
1 changed files with 7 additions and 9 deletions
|
@ -61,15 +61,13 @@ IMPORT(svc_stack)
|
||||||
|
|
||||||
/* Save the register context to the proc structure */
|
/* Save the register context to the proc structure */
|
||||||
.macro save_process_ctx
|
.macro save_process_ctx
|
||||||
push {lr}
|
add sp, sp, #8 /* srsdb pushed cpsr and pc on the stack */
|
||||||
ldr lr, [sp, #12] /* proc ptr */
|
ldr lr, [sp] /* lr = proc_ptr */
|
||||||
stm lr, {r0-r14}^
|
stm lr, {r0-r14}^ /* proc_ptr->p_reg.r0-r14 = r0-r14 */
|
||||||
ldr r12, [sp, #8]
|
ldr r12, [sp, #-8] /* r12 = pc stored on the stack */
|
||||||
str r12, [lr, #PSREG]
|
str r12, [lr, #PCREG] /* proc_ptr->p_reg.pc = r12 */
|
||||||
ldr r12, [sp, #4]
|
ldr r12, [sp, #-4] /* r12 = cpsr stored on the stack */
|
||||||
str r12, [lr, #PCREG]
|
str r12, [lr, #PSREG] /* proc_ptr->p_reg.psr = r12 */
|
||||||
pop {lr}
|
|
||||||
add sp, sp, #8
|
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro exception_handler exc_name, exc_num, lr_offset
|
.macro exception_handler exc_name, exc_num, lr_offset
|
||||||
|
|
Loading…
Reference in a new issue