Message-ID: <4HAF52$z9S@smth.org>
Subject: Re: �诤� switch_to ��一���苫�����指�!
Date: Sat, 12 Mar 2005 03:55:14 +0000
From: flyinwindy@smth.org-SPAM.no (����注��)
Path: news.cnusenet.org!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-cn.bbs.comp.unix.development.kernel.mbox.zip!g2news1.google.com!news4.google.com!news.glorb.com!news.alt.net!sjc-c01.usenetserver.com!maily.cic.tsinghua.edu.cn!SMTH
Newsgroups: cn.bbs.comp.unix.development.kernel
Organization: BBS 水木�华站
Mime-Version: 1.0
Content-Type: text/plain; charset="gb2312"
Content-Transfer-Encoding: 8bit
X-Filename: KernelTech/e/M.1110599666.F0
Xref: news.cnusenet.org cn.bbs.comp.unix.development.kernel:28717

���遣�没�屑����示 edi��诺�一������
ebp��诺诙����������
�烦����一��
�� �� judicious (�薹������) �拇������到: ��
: ��  ��: Re: �诤� switch_to ��一���苫�����指�!
: ����站: BBS 水木�华站 (Sat Mar 12 10:17:11 2005), 转��
: 
: 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.*]


--
��������
������纸


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