Message-ID: <4H9dNF$_jh@smth.org>
Subject: �诤� switch_to ��一���苫�����指�!
Date: Fri, 11 Mar 2005 12:51:42 +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!news3.google.com!newshub.sdsu.edu!newsfeed.media.kyoto-u.ac.jp!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/x/M.1110545247.j0
Xref: news.cnusenet.org cn.bbs.comp.unix.development.kernel:28702

���诤��� ���群���
  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: 166.111.250.86]