Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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.


Ïà¹ØÎĵµ£º

LinuxÄÚºËÈëÃÅ£¨Èý£©—— CÓïÑÔ»ù±¾¹¦

    linuxÊÇÒ»¸ö¸´ÔÓµÄÈí¼þϵͳ£¬ÆäÄÚºËÔ´´úÂëÍùÍù»áÓõ½Ò»Ð©ÔÚÓ¦ÓóÌÐòÉè¼ÆÖв¿³£¼ûÓïÑԳɷֺͱà³Ì¼¼ÇÉ£¬ÕâЩ¶¼ÊÇ·ÖÎöÄÚºËÔ´´úÂëµÄ»ù±¾¹¦£¬Ï£Íû´ó¼ÒÄÜÖصãÕÆÎÕ¡£
    Ê×ÏÈ£¬gcc±àÒëÆ÷´ÓÓïÑÔÀïÎüÊÕÁË“inline”ºÍ“const”¡£inlineº¯ÊýµÄ´óÁ¿Ê¹Óã¬ÓÐÀûÓÚÌá¸ßÔËÐ ......

LinuxÄÚºËÈëÃÅ£¨ËÄ£©—— Äں˻ã±àÓïÑÔ¹æÔò

    ÈκÎÒ»¸öÓø߼¶ÓïÑÔ±àдµÄ²Ù×÷ϵͳ£¬ÆäÄÚºËÔ´´úÂëÖÐ×ÜÓÐÉÙ²¿·Ö´úÂëÊÇÓûã±àÓïÑÔ±àдµÄ¡£¶Á
¹ýUnix Sys VÔ´´úÂëµÄ¶ÁÕ߶¼ÖªµÀ£¬ÔÚÆäÔ¼3ÍòÐеĺËÐÄ´úÂëÖÐÓûã±àÓïÑÔ±àдµÄ´úÂëÔ¼2000ÐУ¬·Ö
³É²»µ½20¸öÀ©Õ¹ÃûΪ.sºÍ.mµÄÎļþ£¬ÆäÖд󲿷ÖÊǹØÓÚÖжÏÓëÒì³£´¦ÀíµÄµ×²ã³ÌÐò£¬»¹ÓоÍÊÇÓë³õʼ
»¯ÓÐ¹ØµÄ³Ì ......

½ÌÄãÈçºÎ²é¿´linux°æ±¾


1. ²é¿´Äں˰汾ÃüÁ
1) [root@q1test01 ~]# cat /proc/version
Linux version 2.6.9-22.ELsmp (bhcompile@crowe.devel.redhat.com) (gcc version 3.4.4 20050721 (Red Hat
3.4.4-2)) #1 SMP Mon Sep 19 18:00:54 EDT 2005
2) [root@q1test01 ~]# uname -a
Linux q1test01 2.6.9-22.ELsmp #1 SMP Mon Sep 19 ......

linuxÃüÁîÊÖ²á


 
·½±ãµÄlinuxÃüÁîÊÖ²á
 
À´Ô´: ChinaUnix²©¿Í ¡¡ÈÕÆÚ£º 2006.07.24 00:31¡¡(¹²ÓÐ0ÌõÆÀÂÛ) ÎÒÒªÆÀÂÛ
 
NO
·ÖÀà
PS1
ÃüÁîÃû
Ó÷¨¼°²ÎÊý
¹¦ÄÜ×¢½â
¶ÔÓ¦Õ½Ú
1
Îļþ¹ÜÀí
#
ls
ls -a
Áгöµ±Ç°Ä¿Â¼ÏµÄËùÓÐÎļþ£¬°üÀ¨ÒÔ.Í·µÄÒþº¬Îļþ
Îļþ¹ÜÀí
#
ls
ls -l»òll
Áгöµ±Ç°Ä¿Â¼ÏÂÎļþµÄÏêϸР......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ