pushl %4\n\t
jmp __switch_to\n\t
��模��call __switch_to����思����要����__switch_to�姆��氐�址�冉����,����使�������址���
��司筒������__switch_to()����������位����
edi��诺�应���堑�一������
ebp��诺�应���堑诙�������
�� �� flyinwindy (����注��) �拇������到: ��
: ���诤��� ���群���
:   schedule(void)
:   {
:         struct task_struct *prev, *next, *p;
: ...
:         switch_to(prev, next, prev);
: ...
: }
: #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"       //����__switch_to������么���� \
:                      "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)
: void __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
:  {
: }
: �������� __switch_to�值�������������么�������摹�
: ��一直��太���祝�����指��一��  �����屑�


--

�� ��源:��BBS 水木�华站 smth.org��[FROM: 202.118.70.*]