|
我在看情境分析的时候,在schedule的switch_to里:
#define switch_to(prev,next,last) do { \
asm volatile("pushl %%esi\n\t" \
"pushl %%edi\n\t" \
"pushl %%ebp\n\t" \
"movl %%esp,%0\n\t" /* save ESP */ \
"movl %3,%%esp\n\t" /* restore ESP */ \
"movl $1f,%1\n\t" /* save EIP */ \
"pushl %4\n\t" /* restore EIP */ \
"jmp __switch_to\n" \
"1:\t" \
"popl %%ebp\n\t" \
"popl %%edi\n\t" \
"popl %%esi\n\t" \
:"=m" (prev->thread.esp),"=m" (prev->thread.eip), \
"=b" (last) \
:"m" (next->thread.esp),"m" (next->thread.eip), \
"a" (prev), "d" (next), \
"b" (prev)); \
} while (0)
调用了__switch_to,来做TSS关于当前进程的内核空间堆栈指针的设置.但是__switch_to是带有两个形参的:
void __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
但是我仔细看了代码,在跳转到__switch_to之前,系统堆栈中并没有指向prev_p和next_p的指针,那么这个函数的两个实参从哪儿而来呢?
盼指教! |
|