我是zoro
分类: LINUX
2010-12-24 15:23:13
用到的常量
S_FRAME_SIZE 72
S_PC 60
.macro irq_save_user_regs
sub sp, sp, #S_FRAME_SIZE
stmia sp, {r0 - r12} @ Calling r0-r12
add r8, sp, #S_PC @ !!!! R8 NEEDS to be saved !!!! a reserved stack spot would be good.
stmdb r8, {sp, lr}^ @ Calling SP, LR
str lr, [r8, #0] @ Save calling PC
mrs r6, spsr
str r6, [r8, #4] @ Save CPSR
str r0, [r8, #8] @ Save OLD_R0
mov r0, sp
.endm
在此之前硬件做的事情
1. CPSR -à SPSR_irq
2. PC -à LR_irq
|
ß-- SP1 高 |
R0_irq |
|
Cpsr_user |
|
Lr_irq/PC_user |
ß-r8 |
Lr_user |
|
R13_user |
|
R12 |
|
R11 |
|
R10 |
|
R9 |
|
R8 |
|
R7 |
|
R6 |
|
R5 |
|
R4 |
|
R3 |
|
R2 |
|
R1 |
|
R0 |
ß--SP=SP1-72 ß--r0 |