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ÔÚÐéÄâ»úÉÏ£¬Ôݲ»ÖªµÀ²»ÔÚÐéÄâ»úÉÏÇé¿öÊÇÔõÑùµÄ¡£Ê¹ÓÃhost£onlyÁªÍø¡£
1.°²×°serv-u
2.linuxÉÏÉèÖÃip£¬Ê¹Ö®ÓëwindowÉÏVmnet1Á¬½ÓµÄipÔÚÒ»¸öÍø¶Î¡£ÔÒò¿ÉÄÜÊÇ£¬winÉϵÄVmnet1Ï൱ÓÚÖ÷»ú£¨192.168.1.1£©¡£
vi /etc/sysconfig/network-scripts/ifcfg-eth0 £º
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
IPADDR ......
Linuxϵͳ¶¼ÊÇÒÔÎļþµÄÐÎʽÀ´·ÃÎÊÓ²¼þÉ豸µÄ£¬¸÷ÖÖÉ豸ÊÇÒÔϵͳÉ豸ÎļþµÄÐÎʽ´æÔÚÓÚϵͳÉ豸Ŀ¼£¯devÖеġ£ÕâЩÎļþÓÃÓÚ·ÃÎÊϵͳÖÐËùÓв»Í¬ÀàÐ͵ÄÓ²¼þ¡£ÀýÈ磬£¯dev£¯mouseÎļþ¶ÔÓ¦Êó±êÉ豸Îļþ£¬ÓÃÓÚ¶ÁÈ¡Êó±êÊäÈëµÄ£»£¯dev£¯fd0Îļþ¶ÔÓ¦ÈíÇýÉ豸Îļþ£¬ÓÃÓÚ´¦ÀíÈíÅ̶ÁдµÄ£»
LinuxÎļþϵͳÖÐÿ¸öÎļþÓà i½Úµã À´±êʶ£¬¹Ø ......
linuxÊÇÒ»¸ö¸´ÔÓµÄÈí¼þϵͳ£¬ÆäÄÚºËÔ´´úÂëÍùÍù»áÓõ½Ò»Ð©ÔÚÓ¦ÓóÌÐòÉè¼ÆÖв¿³£¼ûÓïÑԳɷֺͱà³Ì¼¼ÇÉ£¬ÕâЩ¶¼ÊÇ·ÖÎöÄÚºËÔ´´úÂëµÄ»ù±¾¹¦£¬Ï£Íû´ó¼ÒÄÜÖØµãÕÆÎÕ¡£
Ê×ÏÈ£¬gcc±àÒëÆ÷´ÓÓïÑÔÀïÎüÊÕÁË“inline”ºÍ“const”¡£inlineº¯ÊýµÄ´óÁ¿Ê¹Óã¬ÓÐÀûÓÚÌá¸ßÔËÐ ......
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 ......