Message-ID: <4HAJke$_Tf@smth.org>
Subject: Re: �诤� switch_to ��一���苫�����指�!
Date: Sat, 12 Mar 2005 07:01:51 +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!news1.google.com!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/h/M.1110610888.r0
Xref: news.cnusenet.org cn.bbs.comp.unix.development.kernel:28723

thx
������.谢谢
�� �� judicious (�薹������) �拇������到: ��
: ��  ��: Re: �诤� switch_to ��一���苫�����指�!
: ����站: BBS 水木�华站 (Sat Mar 12 13:35:34 2005), 转��
: 
: 
: ��说���写����看�����歉��本���诤耍�
: �铱���一�����希���确�����应��������模�
: �歉�__switch_to��应����FASTCALL���叨����
: extern void __switch_to(struct task_struct *prev, struct task_struct *next) __attribute__((regparm(3))) ;
: ����示__switch_to����保��3���拇������诓���荩����堑�顺��约��为eax,edx,ecx��
: ��么�看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"       //����__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),                           \
:                         ~~~~prev->eax ~~~~next->edx,�����������拇��菥徒���税�
:    "b" (prev));                                      \
: } while (0)
: �� �� flyinwindy (����注��) �拇������到: ��
: : ���遣�没�屑����示 edi��诺�一������
: : ebp��诺诙����������
: : �烦����一��
: : ...................
: 
: --
: 
: �� �薷�:��judicious �� Mar 12 13:56:56 �薷谋��摹�[FROM: 202.118.70.*]
: �� ��源:��BBS 水木�华站 smth.org��[FROM: 202.118.70.*]


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


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