Ïê½âLinuxÄÚºË֮˫ÏòÑ»·Á´±í(ת)
ÕªÒª: ±¾ÎÄÏê½âÁËÄÚºËÖÐÃæÏò¶ÔÏóµÄlist½á¹¹µÄÔÀí£¬ÒÔ¼°ÈçºÎÒÔlistΪÄÚǶ¶ÔÏóÀ´¹¹Ôì×Ô¼ºµÄÁ´±í½á¹¹£¬ÈçºÎ´ÓÄÚǶlist¶ÔÏó»ñµÃ×Ô¶¨ÒåµÄ¶ÔÏóÖ¸Õ룻̽ÌÖÁ˸÷ÖÖºê»òÕߺ¯ÊýµÄÏêϸʹÓ÷½·¨¼°ÔõÑùÒÔͨÓÃlist½á¹¹À´²Ù×÷×Ô¶¨Òå¶ÔÏó¡£
¹Ø¼ü×Ö:Ë«ÏòÑ»·Á´±í£¬list£¬list_entry£¬typeof£¬containerof£¬list_for_each,list_for_each_entry
1¡¢Ë«Ñ»·Á´±í´«Í³ÊµÏÖ
2¡¢LinuxÄÚºËÖÐË«Ñ»·Á´±íʵÏÖ
3¡¢¶¨ÒåºÍ³õʼ»¯
4¡¢Í¨ÓÃÁ´±í²Ù×÷½Ó¿Ú
4.1Ìí¼Ó½Úµã 4.2ɾ³ý½Úµã 4.3Òƶ¯½Úµã 4.4Á´±íÅÐ¿Õ 4.5Á´±íºÏ²¢
5¡¢»ñÈ¡ËÞÖ÷¶ÔÏóÖ¸Õë
6¡¢±éÀú
6.1 List-headÁ´±í±éÀú 6.2±éÀúËÞÖ÷¶ÔÏó
7¡¢ÈçºÎʹÓÃLinuxÖеÄË«Ñ»·Á´±í
1¡¢Ë«Ñ»·Á´±í´«Í³ÊµÏÖ
ÔÚ´«Í³µÄË«Ñ»·Á´±íʵÏÖÖУ¬Èç¹û´´½¨Ä³ÖÖÊý¾Ý½á¹¹µÄË«Ñ»·Á´±í£¬Í¨³£²ÉÓõİ취ÊÇÔÚÕâ¸öÊý¾Ý½á¹¹µÄÀàÐͶ¨ÒåÖмÓÈëÁ½¸ö£¨Ö¸Ïò¸ÃÀàÐͶÔÏóµÄ£©Ö¸ÕënextºÍprev¡£ÀýÈ磺
typedef struct foo {
…
struct foo *prev;
struct foo *next;
…
} foo_t;
ÕâÀï¸ø³öÁ˶ÔÓ¦µÄ½Úµã½á¹¹¡¢¿ÕµÄË«Ñ»·Á´±íºÍ·Ç¿ÕµÄË«Ñ»·Á´±íʾÒâͼ¡£
2¡¢LinuxÄÚºËÖÐË«Ñ»·Á´±íʵÏÖ
ÔÚlinuxÄÚºËÖУ¬ÓдóÁ¿µÄÊý¾Ý½á¹¹ÐèÒªÓõ½Ë«Ñ»·Á´±í£¬ÀýÈç½ø³Ì¡¢Îļþ¡¢Ä£¿é¡¢Ò³ÃæµÈ¡£Èô²ÉÓÃË«Ñ»·Á´±íµÄ´«Í³ÊµÏÖ·½Ê½£¬ÐèҪΪÕâЩÊý¾Ý½á¹¹Î¬»¤¸÷×ÔµÄÁ´±í£¬²¢ÇÒΪÿ¸öÁ´±í¶¼ÒªÉè¼Æ²åÈ롢ɾ³ýµÈ²Ù×÷º¯Êý¡£ÒòΪÓÃÀ´Î¬³ÖÁ´±íµÄnextºÍprevÖ¸ÕëÖ¸Ïò¶ÔÓ¦ÀàÐ͵ĶÔÏó£¬Òò´ËÒ»ÖÖÊý¾Ý½á¹¹µÄÁ´±í²Ù×÷º¯Êý²»ÄÜÓÃÓÚ²Ù×÷ÆäËüÊý¾Ý½á¹¹µÄÁ´±í¡£
ÔÚLinuxÔ´´úÂëÊ÷µÄinclude/linux/list.hÎļþÖУ¬²ÉÓÃÁËÒ»ÖÖÀàÐÍÎ޹صÄË«Ñ»·Á´±íʵÏÖ·½Ê½¡£Æä˼ÏëÊǽ«Ö¸ÕëprevºÍnext´Ó¾ßÌåµÄÊý¾Ý½á¹¹ÖÐÌáÈ¡³öÀ´¹¹³ÉÒ»ÖÖͨÓõÄ"Ë«Á´±í"Êý¾Ý½á¹¹list_head¡£Èç¹ûÐèÒª¹¹ÔìijÀà¶ÔÏóµÄÌض¨Á´±í£¬ÔòÔÚÆä½á¹¹£¨±»³ÆΪËÞÖ÷Êý¾Ý½á¹¹£©Öж¨ÒåÒ»¸öÀàÐÍΪlist_headÀàÐ͵ijÉÔ±£¬Í¨¹ýÕâ¸ö³ÉÔ±½«ÕâÀà¶ÔÏóÁ¬½ÓÆðÀ´£¬ÐγÉËùÐèÁ´±í£¬²¢Í¨¹ýͨÓÃÁ´±íº¯Êý¶ÔÆä½øÐвÙ×÷¡£ÆäÓŵãÊÇÖ»Ðè±àдͨÓÃÁ´±íº¯Êý£¬¼´¿É¹¹ÔìºÍ²Ù×÷²»Í¬¶ÔÏóµÄÁ´±í£¬¶øÎÞÐèΪÿÀà¶ÔÏóµÄÿÖÖÁбí±àдרÓú¯Êý£¬ÊµÏÖÁË´úÂëµÄÖØÓá£
list_head½á¹¹
-----------struct list_head{}¼°³õʼ»¯ºê---------
struct list_head
{
 
Ïà¹ØÎĵµ£º
1. HCI²ãÐÒé¸ÅÊö£º
HCIÌṩһÌ×ͳһµÄ·½·¨À´·ÃÎÊBluetoothµ×²ã¡£ÈçͼËùʾ£º
´ÓͼÉÏ¿ÉÒÔ¿´³ö£¬Host Controller Interface(HCI) ¾ÍÊÇÓÃÀ´¹µÍ¨HostºÍModule¡£Hostͨ³£¾ÍÊÇPC£¬ ModuleÔòÊÇÒÔ¸÷ÖÖÎïÀíÁ¬½ÓÐÎʽ£¨USB,serial,pc-cardµÈ£©Á¬½Óµ½PCÉϵÄbluetooth Dongle¡£
ÔÚHostÕâÒ»¶Ë£ºapplication,SDP,L2capµÈÐÒé ......
£¨L2CAPÐÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPÐÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼Á¬½Ó¿ØÖƺÍÊÊÅäÐÒé (L2CAP) ΪÉϲãÐÒéÌṩÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àÐÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãÐÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......
ÿ¸öÖжÏÏòÁ¿¶¼ÓÐ×Ô¼ºµÄirq_desc_tÃèÊö·û£¬ËùÓеÄÕâЩÃèÊö·û×éÖ¯ÔÚÒ»ÆðÐγÉirq_descÊý×é¡£
typedef struct irq_desc {
hw_irq_controller *handler;Ö¸Ïòpic¶ÔÏó£¨hw_irq_controllerÃèÊö·û£©£¬·þÎñÓÚirqÏß
void *handler_data;Ö¸ ......
Today is the last day in 2009, I have no idea what should I do but just want to pray that my family, relatives and bosom friends would have a sweet life in the next year. Linux is a 2nd OS in my life, there are always something new can make me feel awesome, so I think that with continuou ......