arm-linux에서 시스콜 관련 레지스터 질문입니다.
- 지금부터 주석입니다
파일은 linux/arch/arm/kernel/entry-header.S
These are the registers used in the syscall hadler and allow us to have in
theory up to 7 arguments to a function - r0 to r6
r7 is reserved for the system call number for thumb mode.
Note that tbl == wht is intentional.
We must set at least "tsk" and "why" whten calling ret_with_reschedule.
여기까지 주석입니다
scno. req r7 @syscall number
tbl .req r8 @syscall table pointer
why .req r8 @linux syscall (i=0)
tsk .req r9 @current task
주석 Get the system call number
.macro get_scno
#ifdef CONFIG_ARM_THUMB
tst r8, #T_BIT @this is SPSR from save_user_regs
addne scno, r7, #OS_NUMBER << 20 @ put OS number in
ldreq scno, [lr, #-4]
#else
mask_pc lr, lr
ldr scno,[lr,#-4] @get SWI instruction
#endif
.endm
소스코드입니다
r7 is reserved for the system call number for thumb mode.
~~~~~
~~
scno. req r7 @syscall number
이부분인데요
r7 레지스터가 Thumb 모드 상태에서 시스콜 사용시 시스콜 넘버로 사용하기 위해서
예약되어 있다. 이정도같은데요
그위에 r7레지스터를 scno로 정의할때 시스콜넘버로 사용한다는 주석이 있습니다
음 궁금한건
r7 레지스터가 Thumb모드 상태일때에 시스콜 넘버를 위해서 쓰이는지 아니면
ARM 상태일때도 시스콜 넘버를 위해서 쓰이는지... 궁금합니다
댓글 달기