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

LinuxÔ­×Ó²Ù×÷µÄ·ÖÎö


Linux
Ô­×Ó²Ù×÷µÄ·ÖÎö
±¾ÎÄÕë¶ÔLinuxÌṩµÄÔ­×Ó²Ù×÷º¯Êý
atomic_dec_and_test
×öÁËÏêϸµÄʵÀý·ÖÎö£¬½âÊÍÁËÆäÔ­×ÓÐԵı¾ÖÊÒâÒå¡£

²¢¶Ô
volatile
²úÉúµÄÎó½â×öÁ˽âÊÍ¡£

1.  
atomic_dec_and_test
·ÖÎö
£¨
1
£©ÏÈÀ´¿´
atomic_dec_and_test
µÄ¶¨Ò壺
 
11 #ifdef CONFIG_SMP
12 #define LOCK "lock ; "
13 #else
14 #define LOCK ""
15 #endif
 
 
137 static __inline__ int atomic_dec_and_test(atomic_t
_
v)
138 {
139 unsigned char c;
140
141 __asm__ __volatile__(
142 LOCK "decl %0; sete %1"
143 :"=m" (v->counter), "=qm" (c)
144 :"m" (v->counter) : "memory");
145 return c !
=
0;
146 }
 
11–15 this macro is used in the inline assembly part of
some of the functions that follow. It means that
the LOCK macro can always be used. But sometimes (the SMP
case) it invokes the machine
instruction to lock the bus; other times it has no
effect.
 
142 the SETE instruction sets parameter 1 (the unsigned
char c) to 1 if the zero bit is set in
EFLAGS (i.e. if the result of the subtraction was 0).
 
143 parameter 0 (the counter field) is write only ("=")
and may be in memory ("m"). Parameter 1
is the unsigned char c declared on line 139. It may be in
a general purpose register, or in
memory ("=qm").
 
144 parameter 2 is the input parameter i; it is expected
as an immediate integer operand and may be
in a general register ("ir") . Parameter 3 is
the other input, the value in (v-
.
counter)
beforehand. The "memory" operand constraint
tells the compiler that memory will be modified
in an unpredictable manner, so it will not keep memory
values cached in registers across the
group of assembler instructions.
 
145 if the result of the decrement was 0, then c was set
to 1 on line 142. In that case, c !
=
0 is TRUE.
Otherwise, c was set to 0, and c !
=
0 is FALS


Ïà¹ØÎĵµ£º

linux ÄÚºËÔ´´úÂëĿ¼½á¹¹¸ÅÊö

 ½øÈëlinuxÔ´´úÂëĿ¼£¬»á¿´µ½Èô¸É×ÓĿ¼ºÍÎļþ¡£ÏÖ´ú²Ù×÷ϵͳһ°ãÓɽø³Ì¹ÜÀí£¬ÄÚ´æ¹ÜÀí£¬Îļþϵͳ£¬Çý¶¯³ÌÐòºÍÍøÂçЭÒéÕ»×é³É¡£
  arch : °üº¬ÁËËùÓкÍÌåϵ½á¹¹Ïà¹ØµÄºËÐÄ´úÂë¡£ËüÏÂÃæµÄÿ¸ö×ÓĿ¼´ú±íÒ»ÖÖlinuxÖ§³ÖµÄÌåϵ½á¹¹¡£ÈçarmĿ¼¾ÍÊÇÓëARMÌåϵ½á¹¹¼æÈݵÄCPUµÄ×ÓĿ¼£»/arch/i386ÔòÊÇintel CPU¼°Æä¼æÈÝ ......

¹ØÓÚEeePcµÄLinuxÏ°²×°GCC±àÒëÆ÷

     ×î½üÓÉÓÚÐèÒª£¬°Ñ¼¸ÄêÇ°£¨Óеã¿äÕÅ£©µÄEeePc 1000ÄóöÀ´£¬ÏëÔÚËü×Ô´øµÄLinuxϵͳϽøÐбà³Ì¡£Ë­ÖªµÀ¾ÓȻûÓÐGCC±àÒëÆ÷£¬ËùÒÔÔ´Âë°²×°¿Ï¶¨ÊDz»ÐеÄÀ²¡£
    ºóÀ´ÔÚÖնˣ¨ctrl+alt+t£©ÀïÊäÈ룺sudo apt-get install gcc
    ·¢ÏÖÖ§³Öapt-get°²×°Èí¼þ£¬Ö»²»¹ýûÕÒµ½ ......

linux´î½¨LAMP

RedHat£¨CentOS5.3£©Æ½Ì¨ÏÂLAMP´î½¨Linux+Apache+Mysql+PHP
Ò»¡¢°²×°»·¾³£º
ϵͳƽ̨£ºCentOS5.3,ÄÚºË2.6.18-128.el5£¬ÎÄ×Ö½çÃ棨δ°²×°Í¼ÐνçÃ棩
¶þ¡¢Èí¼þÐèÇó¼°ÏµصØÖ·£º
httpd-2.2.13.tar.gz
MySQL-client-community-5.1.40-0.rhel5.i386.rpm MySQL-server-community-5.1.40-0.rhel5.i386.rpm     ......

Linux ³£ÓÃϵͳ¹ÜÀíµÄÃüÁî

 ¹Ø¼ü´Ê£º Linux    ϵͳ¹ÜÀí                                          
1¡¢²é¿´Ä³Îļþ ......

LinuxÖ®Makefile (Ò»)

 ¸ÅÊö
——
ʲôÊÇmakefile£¿»òÐíºÜ¶àWinodwsµÄ³ÌÐòÔ±¶¼²»ÖªµÀÕâ¸ö¶«Î÷£¬ÒòΪÄÇЩWindowsµÄIDE¶¼ÎªÄã×öÁËÕâ¸ö¹¤×÷£¬µ«ÎÒ¾õµÃÒª×÷Ò»¸öºÃµÄºÍprofessionalµÄ³ÌÐòÔ±£¬makefile»¹ÊÇÒª¶®¡£Õâ¾ÍºÃÏñÏÖÔÚÓÐÕâô¶àµÄHTMLµÄ±à¼­Æ÷£¬µ«Èç¹ûÄãÏë³ÉΪһ¸öרҵÈËÊ¿£¬Ä㻹ÊÇÒªÁ˽âHTMLµÄ±êʶµÄº¬Òå¡£ÌرðÔÚUnixϵÄÈí¼ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ