linux-2.6.26內(nèi)核中ARM中斷實(shí)現(xiàn)詳解(2)
#define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0)))
表示函數(shù)的參數(shù)傳遞是通過(guò)堆棧完成的。
3.7 描述3.3節(jié)中的ret_to_user 中斷返回過(guò)程,/arch/arm/kernel/entry-common.S
ENTRY(ret_to_user)
ret_slow_syscall:
disable_irq @ disable interrupts
ldr r1, [tsk, #TI_FLAGS]
tst r1, #_TIF_WORK_MASK
bne work_pending
no_work_pending:
/* perform. architecture specific actions before user return */
arch_ret_to_user r1, lr
@ slow_restore_user_regs
ldr r1, [sp, #S_PSR] @ get calling cpsr
ldr lr, [sp, #S_PC]! @ get pc
msr spsr_cxsf, r1 @ save in spsr_svc
ldmdb sp, {r0 - lr}^ @ get calling r0 - lr
mov r0, r0
add sp, sp, #S_FRAME_SIZE - S_PC
movs pc, lr @ return move spsr_svc into cpsr
第三章主要跟蹤了從中斷發(fā)生到調(diào)用到對(duì)應(yīng)中斷號(hào)的desc->handle_irq(irq, desc)中斷函數(shù)的過(guò)程。后面的章節(jié)還會(huì)繼續(xù)講解后面的內(nèi)容。
linux操作系統(tǒng)文章專題:linux操作系統(tǒng)詳解(linux不再難懂)
評(píng)論