ENTRY(system_call) 02. RING0_INT_FRAME # can't unwind into user space anyway 03. pushl %eax # save orig_eax 04. CFI_ADJUST_CFA_OFFSET 4 05. SAVE_ALL 06. GET_THREAD_INFO(%ebp) 07. # system call tracing in operation / emulation 08. testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%ebp) 09. jnz syscall_trace_entry 10. cmpl $(nr_syscalls), %eax 11. jae syscall_badsys 12.syscall_call: 13. call *sys_call_table(,%eax,4)/*跳轉到具體的系統調用函數*/ 14. movl %eax,PT_EAX(%esp) # store the return value 15.syscall_exit: 16. LOCKDEP_SYS_EXIT 17. DISABLE_INTERRUPTS(CLBR_ANY) # make sure we don't miss an interrupt 18. # setting need_resched or sigpending 19. # between sampling and the iret 20. TRACE_IRQS_OFF 21. movl TI_flags(%ebp), %ecx 22. testl $_TIF_ALLWORK_MASK, %ecx # current->work 23. jne syscall_exit_work ........ 具體的系統調用函數存放在sys_call_table表中,在調用system_call具體的系統調用號存放在eax寄存器中。《解決方案》謝謝分享
[火星人 ] linux內核分析之系統調用已經有398次圍觀