1.系统调用简易的伪代码
#systme call #asm pseudo code #系统调用处理过程的伪代码 .macro INTERRUPT_RETURN iret .endm .macro SAVE_ALL ... .endm .macro RESTORE_INT_REGS ... .endm ENTRY(system_call) SAVE_ALL system_call: call *sys_call_table(,%eax,4) movl %eax,PT_EAX(%esp) #store the return value syscall_exit: testl $_TIF_ALLWORK_MASK,%ecx #current->work jne syscall_exit_work restall_all: RESTORE_INT_REGS irq_return: INTERRUPT_RETURN ENDPROC(system_call) syscall_exit_work: testl $_TIF_WORK_SYSCALL_EXIT,%ecx jz work_pending END(syscall_exit_work) work_pending: testb $_TIF_NEED_RESCHED,%c1 jz work_notifysig work_resched: call schedule jz restall_all work_notifysig: ... END(work_pending)
2.系统调用简易的流程图