⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 list.lst

📁 本代码已经经过修改
💻 LST
📖 第 1 页 / 共 2 页
字号:
   \   00000002   5368               LDR         R3,[R2, #+0x4]
   \   00000004   4B60               STR         R3,[R1, #+0x4]
    117          	pxNewListItem->pxPrevious = pxList->pxIndex;
   \   00000006   8368               LDR         R3,[R0, #+0x8]
   \   00000008   8B60               STR         R3,[R1, #+0x8]
    118          	pxIndex->pxNext->pxPrevious = ( volatile xListItem * ) pxNewListItem;
   \   0000000A   5368               LDR         R3,[R2, #+0x4]
   \   0000000C   9960               STR         R1,[R3, #+0x8]
    119          	pxIndex->pxNext = ( volatile xListItem * ) pxNewListItem;
   \   0000000E   5160               STR         R1,[R2, #+0x4]
    120          	pxList->pxIndex = ( volatile xListItem * ) pxNewListItem;
   \   00000010   8160               STR         R1,[R0, #+0x8]
    121          
    122          	/* Remember which list the item is in. */
    123          	pxNewListItem->pvContainer = ( void * ) pxList;
   \   00000012   0861               STR         R0,[R1, #+0x10]
    124          
    125          	( pxList->uxNumberOfItems )++;
   \   00000014   0168               LDR         R1,[R0, #+0]
   \   00000016   491C               ADD         R1,R1,#+0x1
   \   00000018   0160               STR         R1,[R0, #+0]
    126          }
   \   0000001A   7047               BX          LR                 ;; return
    127          /*-----------------------------------------------------------*/
    128          

   \                                 In segment CODE, align 4, keep-with-next
    129          void vListInsert( xList *pxList, xListItem *pxNewListItem )
    130          {
   \                     vListInsert:
   \   00000000   10B4               PUSH        {R4}
    131          volatile xListItem *pxIterator;
    132          register portTickType xValueOfInsertion;
    133          
    134          	/* Insert the new list item into the list, sorted in ulListItem order. */
    135          	xValueOfInsertion = pxNewListItem->xItemValue;
   \   00000002   0B68               LDR         R3,[R1, #+0]
    136          
    137          	/* If the list already contains a list item with the same item value then
    138          	the new list item should be placed after it.  This ensures that TCB's which
    139          	are stored in ready lists (all of which have the same ulListItem value)
    140          	get an equal share of the CPU.  However, if the xItemValue is the same as 
    141          	the back marker the iteration loop below will not end.  This means we need
    142          	to guard against this by checking the value first and modifying the 
    143          	algorithm slightly if necessary. */
    144          	if( xValueOfInsertion == portMAX_DELAY )
   \   00000004   4268               LDR         R2,[R0, #+0x4]
   \   00000006   0024               MOV         R4,#+0
   \   00000008   E443               MVN         R4,R4              ;; #-1
   \   0000000A   A342               CMP         R3,R4
   \   0000000C   06D1               BNE         ??vListInsert_0
    145          	{
    146          		for( pxIterator = pxList->pxHead; pxIterator->pxNext->xItemValue < xValueOfInsertion; pxIterator = pxIterator->pxNext )
   \                     ??vListInsert_1:
   \   0000000E   5368               LDR         R3,[R2, #+0x4]
   \   00000010   1B68               LDR         R3,[R3, #+0]
   \   00000012   A342               CMP         R3,R4
   \   00000014   06D0               BEQ         ??vListInsert_2
   \   00000016   5268               LDR         R2,[R2, #+0x4]
   \   00000018   F9E7               B           ??vListInsert_1
    147          		{
    148          			/* There is nothing to do here, we are just iterating to the 
    149          			wanted insertion position. */
    150          		}
    151          	}
    152          	else
    153          	{
    154          		for( pxIterator = pxList->pxHead; pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext )
   \                     ??vListInsert_3:
   \   0000001A   5268               LDR         R2,[R2, #+0x4]
   \                     ??vListInsert_0:
   \   0000001C   5468               LDR         R4,[R2, #+0x4]
   \   0000001E   2468               LDR         R4,[R4, #+0]
   \   00000020   A342               CMP         R3,R4
   \   00000022   FAD2               BCS         ??vListInsert_3
    155          		{
    156          			/* There is nothing to do here, we are just iterating to the 
    157          			wanted insertion position. */
    158          		}
    159          	}
    160          
    161          	pxNewListItem->pxNext = pxIterator->pxNext;
   \                     ??vListInsert_2:
   \   00000024   5368               LDR         R3,[R2, #+0x4]
   \   00000026   4B60               STR         R3,[R1, #+0x4]
    162          	pxNewListItem->pxNext->pxPrevious = ( volatile xListItem * ) pxNewListItem;
   \   00000028   9960               STR         R1,[R3, #+0x8]
    163          	pxNewListItem->pxPrevious = pxIterator;
   \   0000002A   8A60               STR         R2,[R1, #+0x8]
    164          	pxIterator->pxNext = ( volatile xListItem * ) pxNewListItem;
   \   0000002C   5160               STR         R1,[R2, #+0x4]
    165          
    166          	/* Remember which list the item is in.  This allows fast removal of the
    167          	item later. */
    168          	pxNewListItem->pvContainer = ( void * ) pxList;
   \   0000002E   0861               STR         R0,[R1, #+0x10]
    169          
    170          	( pxList->uxNumberOfItems )++;
   \   00000030   0168               LDR         R1,[R0, #+0]
   \   00000032   491C               ADD         R1,R1,#+0x1
   \   00000034   0160               STR         R1,[R0, #+0]
    171          }
   \   00000036   10BC               POP         {R4}
   \   00000038   00B0               ADD         SP,#+0
   \   0000003A   7047               BX          LR                 ;; return
    172          /*-----------------------------------------------------------*/
    173          

   \                                 In segment CODE, align 4, keep-with-next
    174          void vListRemove( xListItem *pxItemToRemove )
    175          {
    176          xList * pxList;
    177          
    178          	pxItemToRemove->pxNext->pxPrevious = pxItemToRemove->pxPrevious;
   \                     vListRemove:
   \   00000000   4168               LDR         R1,[R0, #+0x4]
   \   00000002   8268               LDR         R2,[R0, #+0x8]
   \   00000004   8A60               STR         R2,[R1, #+0x8]
    179          	pxItemToRemove->pxPrevious->pxNext = pxItemToRemove->pxNext;
   \   00000006   8168               LDR         R1,[R0, #+0x8]
   \   00000008   4268               LDR         R2,[R0, #+0x4]
   \   0000000A   4A60               STR         R2,[R1, #+0x4]
    180          	
    181          	/* The list item knows which list it is in.  Obtain the list from the list
    182          	item. */
    183          	pxList = ( xList * ) pxItemToRemove->pvContainer;
   \   0000000C   0169               LDR         R1,[R0, #+0x10]
    184          
    185          	/* Make sure the index is left pointing to a valid item. */
    186          	if( pxList->pxIndex == pxItemToRemove )
   \   0000000E   8A68               LDR         R2,[R1, #+0x8]
   \   00000010   8242               CMP         R2,R0
   \   00000012   01D1               BNE         ??vListRemove_0
    187          	{
    188          		pxList->pxIndex = pxItemToRemove->pxPrevious;
   \   00000014   8268               LDR         R2,[R0, #+0x8]
   \   00000016   8A60               STR         R2,[R1, #+0x8]
    189          	}
    190          
    191          	pxItemToRemove->pvContainer = NULL;
   \                     ??vListRemove_0:
   \   00000018   0022               MOV         R2,#+0
   \   0000001A   0261               STR         R2,[R0, #+0x10]
    192          	( pxList->uxNumberOfItems )--;
   \   0000001C   0868               LDR         R0,[R1, #+0]
   \   0000001E   401E               SUB         R0,R0,#+0x1
   \   00000020   0860               STR         R0,[R1, #+0]
    193          }
   \   00000022   00B0               ADD         SP,#+0
   \   00000024   7047               BX          LR                 ;; return
    194          /*-----------------------------------------------------------*/
    195          

   Maximum stack usage in bytes:

     Function            CSTACK
     --------            ------
     vListInitialise         0
     vListInitialiseItem     0
     vListInsert             8
     vListInsertEnd          0
     vListRemove             4


   Segment part sizes:

     Function/Label      Bytes
     --------------      -----
     vListInitialise       36
     vListInitialiseItem    6
     vListInsertEnd        28
     vListInsert           60
     vListRemove           38
      Others               40

 
 208 bytes in segment CODE
 
 168 bytes of CODE memory (+ 40 bytes shared)

Errors: none
Warnings: none

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -