BBS水木清华站∶精华区

发信人: chenl (bigmouth), 信区: Linux 
标  题: Re: 请熟悉汇编的大峡帮忙!!!! 
发信站: BBS 水木清华站 (Sat Aug  7 09:10:28 1999) WWW-POST 
 
【 在 xtime (逝者) 的大作中提到: 】 
 下面是Linux进程切换的原代码: 
 #define switch_to(prev,next) do { \ 
 __asm__("movl %2,"SYMBOL_NAME_STR(current_set)"\n\t" \  
In c: current_set=next; 
      __asm longjump (*(((char*(&next->tss.tr)-4)) 
/* swith the task, refer to the i386 task switch */ 
         "ljmp %0\n\t" \ 
         "cmpl %1,"SYMBOL_NAME_STR(last_task_used_math)"\n\t" \  
if(last_task_used_math_coprocessor){ 
save all debug register for the 
process "prev" 
use loaddebug(); 

return; 
wish this could give u help. 
 
         "jne 1f\n\t" \ 
         "clts\n" \  
         "1:" \  
         : /* no outputs */ \  
         :"m" (*(((char *)&next->tss.tr)-4)), \ 
         "r" (prev), "r" (next)); \  
         /* Now maybe reload the debug registers */ \ 
         if(prev->debugreg[7]){ \   
                 loaddebug(prev,0); \   
                 loaddebug(prev,1); \ 
                 loaddebug(prev,2); \   
                 loaddebug(prev,3); \   
                 loaddebug(prev,6); \  
         } \ 
 } while (0) 
 恳请大峡给予增援!向小生讲解以下该函数的大体意思。 
 
-- 
 
  舟摇摇而轻扬, 风飘飘以吹衣, 
  问征夫以前路, 恨晨光之曦微. 
 
※ 来源:·BBS 水木清华站 bbs.net.tsinghua.edu.cn·[FROM: 202.115.6.100]  

BBS水木清华站∶精华区