linuxÄÚºËÖпªÍ·´øÓÐ asmlinkage µÄº¯Êý±íʾʲô
Ç¿ÖÆÍ¨¹ý¶ÑÕ»´«µÝ²ÎÊý£¬²»ÒªÓüĴæÆ÷´«µÝ
×Ðϸ¿´Ò»ÏÂÓÐasmlinkageµÄµØ·½Í¨³£ÊÇϵͳµ÷Óõĺ¯Êý£¬ÒòΪÔÚϵͳµ÷ÓÃÖУ¬¼Ä´æÆ÷´ÓÓû§¿Õ¼ä´«¹ýÀ´ºóSAVE_ALLѹÈë¶ÑÕ»£¬½Ó×ŵ÷ÓÃÏàÓ¦µÄϵͳµ÷Óú¯Êý£¬ÕâÑùϵͳµ÷Óú¯ÊýÒ»¶¨Òª±£Ö¤ÊÇͨ¹ý¶ÑÕ»´«µÝ²ÎÊýµÄ
תÌùÒ»¶Î£º
The asmlinkage tag is one other thing that we should observe about this simple function. This is a #define for some gcc magic that tells the compiler that the function should not expect to find any of its arguments in registers (a common optimization), but only on the CPU's stack. Recall our earlier assertion that system_call consumes its first argument, the system call number, and allows up to four more arguments that are passed along to the real system call. system_call achieves this feat simply by leaving its other arguments (which were passed to it in registers) on the stack. All system calls are marked with the asmlinkage tag, so they all look to the stack for arguments. Of course, in sys_ni_syscall's case, this doesn't make any difference, because sys_ni_syscall doesn't take any arguments, but it's an issue for most other system calls. And, because you'll be seeing asmlinkage in front of many other functions, I thought you should know what it was about.
Ïà¹ØÎĵµ£º
ÈκÎÒ»¸öÓø߼¶ÓïÑÔ±àдµÄ²Ù×÷ϵͳ£¬ÆäÄÚºËÔ´´úÂëÖÐ×ÜÓÐÉÙ²¿·Ö´úÂëÊÇÓûã±àÓïÑÔ±àдµÄ¡£¶Á
¹ýUnix Sys VÔ´´úÂëµÄ¶ÁÕß¶¼ÖªµÀ£¬ÔÚÆäÔ¼3ÍòÐеĺËÐÄ´úÂëÖÐÓûã±àÓïÑÔ±àдµÄ´úÂëÔ¼2000ÐУ¬·Ö
³É²»µ½20¸öÀ©Õ¹ÃûΪ.sºÍ.mµÄÎļþ£¬ÆäÖд󲿷ÖÊǹØÓÚÖжÏÓëÒì³£´¦ÀíµÄµ×²ã³ÌÐò£¬»¹ÓоÍÊÇÓë³õʼ
»¯ÓÐ¹ØµÄ³Ì ......
ÒòΪ×Ô¼ºµÄɵ£¬ËùÒÔ²ÅÓÐµÄ´ËÆªÈÕÖ¾¡£Ò²ÐíÓÐÈË¿ÉÒÔ·¢ÏÖ£¬ÔÚÎÒ²©¿ÍÉÏÒѾÓÐÆªÃûΪ“LFSÅäÖÃIP¼°°²×°OpenSSH”£¬¶øÔÙдÕâÆªÈÕ¼ÇÊÇÒòΪ×Ô¼ºÔÚLinuxÏÂʹÓÃÁ˹âÅÌÀïµÄOpenSSH£¬È»ºó×°ÉϺóʹÓÃ×Ô¼ºÓ²ÅÌÉϵÄSSHʱÀÏÊÇÌáʾÒѾռÓ㬽á¹û·´¸´×°Á˺ü¸±é²ÅÒâʶµ½Õâ¸öÎÊÌ⣡~Õâ¾ÍºÃ±ÈÒ»¸öÈËÆïÔÚÂíÉÏÊýÂíµÄÊýĿһÑù£¬×ÜÊÇÉÙÒ» ......
Linux 2.6.19.x Äں˱àÒëÅäÖÃÑ¡Ïî¼ò½é
×÷Õߣº½ð²½¹ú
°æÈ¨ÉùÃ÷
±¾ÎÄ×÷ÕßÊÇһλ×ÔÓÉÈí¼þ°®ºÃÕߣ¬ËùÒÔ±¾ÎÄËäÈ»²»ÊÇÈí¼þ£¬µ«ÊDZ¾×Å GPL µÄ¾«Éñ·¢²¼¡£ÈκÎÈ˶¼¿ÉÒÔ×ÔÓÉʹÓá¢×ªÔØ¡¢¸´ÖƺÍÔÙ·Ö·¢£¬µ«±ØÐë±£Áô×÷ÕßÊðÃû£¬Ò಻µÃ¶ÔÉùÃ÷ÖеÄÈκÎÌõ¿î×÷ÈκÎÐÎʽµÄÐ޸ģ¬Ò²²»µÃ¸½¼ÓÈÎºÎÆäËüÌõ¼þ¡£Äú¿ÉÒÔ×ÔÓÉÁ´½Ó¡¢ÏÂÔØ¡¢´«²¥´ËÎĵµ ......
·½±ãµÄlinuxÃüÁîÊÖ²á
À´Ô´: ChinaUnix²©¿Í ¡¡ÈÕÆÚ£º 2006.07.24 00:31¡¡(¹²ÓÐ0ÌõÆÀÂÛ) ÎÒÒªÆÀÂÛ
NO
·ÖÀà
PS1
ÃüÁîÃû
Ó÷¨¼°²ÎÊý
¹¦ÄÜ×¢½â
¶ÔÓ¦Õ½Ú
1
Îļþ¹ÜÀí
#
ls
ls -a
Áгöµ±Ç°Ä¿Â¼ÏµÄËùÓÐÎļþ£¬°üÀ¨ÒÔ.Í·µÄÒþº¬Îļþ
Îļþ¹ÜÀí
#
ls
ls -l»òll
Áгöµ±Ç°Ä¿Â¼ÏÂÎļþµÄÏêϸР......