BBS水木清华站∶精华区

发信人: holly (holly), 信区: Linux        
标  题: Re: 在读Linux源代码遇到的问题 
发信站: BBS 水木清华站 (Tue Nov  9 11:23:16 1999) 
 
【 在 limbo (每日逢君不见君) 的大作中提到: 】 
 
faint, 回这篇文章中间华东南地区网的路由断了 3 次, 
于是我就写了三次... 
 
 现在读include\asm-i386\bitops.h的一段代码时,几如读天书,这段代码如下: 
      extern __inline__ void set_bit(int nr, volatile void * addr) 
    { 
  __asm__ __volatile__( LOCK_PREFIX 
   "btsl %1,%0" 
   :"=m" (ADDR) 
   :"ir" (nr)); 
    } 
    问题: 
    (1) __asm__ 是什么意思? 难道和编译器有关? 
 
     inline assembler of gcc 
 
    (2) __volatile__ 是什么意思? 
 
     inhibit the optimization in these codes. Let the gcc create codes 
according to the assembler codes restrictly 
 
    (3) LOCK_PREFIX 是什么意思? 
    (4) "btsl %1, %0" 似乎是一个汇编指令, 我可以查到这是什么指令吗? 如何查? 
 
     Look the Intel's i386 instruction manual. NOTE gcc uses AT&T format, 
not Intel format. 
 
    (5) :(ADDR) 似乎是 %1 或 %0所对应的值,是对应%1还是%0? "=m"似乎是参数? 
 
      "=m", output to memory directive, the mmeory address is ADDR 
      ADDR -> %0, nr -> %1 
  
    (6) 以上这些问题的解决我可以查什么资料呢? 
    
     info gcc 
 
 
-- 
※ 来源:·BBS 水木清华站 bbs.net.tsinghua.edu.cn·[FROM: 202.120.13.24] 

BBS水木清华站∶精华区