- 论坛徽章:
- 0
|
本帖最后由 木叉叉木大 于 2010-07-05 13:17 编辑
此宏在 entry_armv.S
定义如下:- .macro usr_entry
- sub sp, sp, #S_FRAME_SIZE
- stmib sp, {r1 - r12}
- ldmia r0, {r1 - r3}
- add r0, sp, #S_PC @ here for interlock avoidance
- mov r4, #-1 @ "" "" "" ""
- str r1, [sp] @ save the "real" r0 copied
- @ from the exception stack
- #if __LINUX_ARM_ARCH__ < 6 && !defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG)
- #ifndef CONFIG_MMU
- #warning "NPTL on non MMU needs fixing"
- #else
- @ make sure our user space atomic helper is aborted
- cmp r2, #TASK_SIZE
- bichs r3, r3, #PSR_Z_BIT
- #endif
- #endif
- @
- @ We are now ready to fill in the remaining blanks on the stack:
- @
- @ r2 - lr_<exception>, already fixed up for correct return/restart
- @ r3 - spsr_<exception>
- @ r4 - orig_r0 (see pt_regs definition in ptrace.h)
- @
- @ Also, separately save sp_usr and lr_usr
- @
- stmia r0, {r2 - r4}
- stmdb r0, {sp, lr}^
- @
- @ Enable the alignment trap while in kernel mode
- @
- alignment_trap r0
- @
- @ Clear FP to mark the first stack frame
- @
- zero_fp
- .endm
复制代码 上面的这部分代码- @ Also, separately save sp_usr and lr_usr
- @
- stmia r0, {r2 - r4}
- stmdb r0, {sp, lr}^
复制代码 这里说存储 用户空间的sp和lr
但是现在是在管理模式,怎么是存储用户空间的sp和lr呢? |
|