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

📄 usbconfigurationdescriptor.lst

📁 ATmel的AT91sam7SE芯片 USB固件开发源代码
💻 LST
📖 第 1 页 / 共 2 页
字号:
   \   0000001C   1EFF2FE1           BX       LR               ;; return
    104              }
    105          }
    106          
    107          /*
    108              Function: USBConfigurationDescriptor_Parse
    109                  Parses the given Configuration descriptor (followed by relevant
    110                  interface, endpoint and class-specific descriptors) into three arrays.
    111          
    112                  *Each array must have its size equal or greater to the number of
    113                  descriptors it stores plus one*. A null-value is inserted after the last
    114                  descriptor of each type to indicate the array end.
    115          
    116                  Note that if the pointer to an array is null (0), nothing is stored in
    117                  it.
    118          
    119              Parameters:
    120                  configuration - Pointer to the start of the whole Configuration descriptor.
    121                  interfaces - Pointer to the Interface descriptor array.
    122                  endpoints - Pointer to the Endpoint descriptor array.
    123                  others - Pointer to the class-specific descriptor array.
    124          */

   \                                 In section .text, align 4, keep-with-next
    125          void USBConfigurationDescriptor_Parse(
    126              const USBConfigurationDescriptor *configuration,
    127              USBInterfaceDescriptor **interfaces,
    128              USBEndpointDescriptor **endpoints,
    129              USBGenericDescriptor **others)
    130          {
   \                     USBConfigurationDescriptor_Parse:
   \   00000000   F1432DE9           PUSH     {R0,R4-R9,LR}
   \   00000004   0040B0E1           MOVS     R4,R0
   \   00000008   0170B0E1           MOVS     R7,R1
   \   0000000C   0280B0E1           MOVS     R8,R2
   \   00000010   0390B0E1           MOVS     R9,R3
    131              // Get size of configuration to parse
    132              int size = USBConfigurationDescriptor_GetTotalLength(configuration);
   \   00000014   0400B0E1           MOVS     R0,R4
   \   00000018   ........           BL       USBConfigurationDescriptor_GetTotalLength
   \   0000001C   0060B0E1           MOVS     R6,R0
    133              size -= sizeof(USBConfigurationDescriptor);
   \   00000020   096056E2           SUBS     R6,R6,#+9
    134          
    135              // Start parsing descriptors
    136              USBGenericDescriptor *descriptor = (USBGenericDescriptor *) configuration;
   \   00000024   0450B0E1           MOVS     R5,R4
    137              while (size > 0) {
   \                     ??USBConfigurationDescriptor_Parse_0:
   \   00000028   010056E3           CMP      R6,#+1
   \   0000002C   1D0000BA           BLT      ??USBConfigurationDescriptor_Parse_1
    138          
    139                  // Get next descriptor
    140                  descriptor = USBGenericDescriptor_GetNextDescriptor(descriptor);
   \   00000030   0500B0E1           MOVS     R0,R5
   \   00000034   ........           BL       USBGenericDescriptor_GetNextDescriptor
   \   00000038   0050B0E1           MOVS     R5,R0
    141                  size -= USBGenericDescriptor_GetLength(descriptor);
   \   0000003C   0500B0E1           MOVS     R0,R5
   \   00000040   ........           BL       USBGenericDescriptor_GetLength
   \   00000044   000056E0           SUBS     R0,R6,R0
   \   00000048   0060B0E1           MOVS     R6,R0
    142          
    143                  // Store descriptor in correponding array
    144                  if (USBGenericDescriptor_GetType(descriptor)
    145                       == USBGenericDescriptor_INTERFACE) {
   \   0000004C   0500B0E1           MOVS     R0,R5
   \   00000050   ........           BL       USBGenericDescriptor_GetType
   \   00000054   040050E3           CMP      R0,#+4
   \   00000058   0400001A           BNE      ??USBConfigurationDescriptor_Parse_2
    146          
    147                      if (interfaces) {
   \   0000005C   000057E3           CMP      R7,#+0
   \   00000060   F0FFFF0A           BEQ      ??USBConfigurationDescriptor_Parse_0
    148                      
    149                          *interfaces = (USBInterfaceDescriptor *) descriptor;
   \   00000064   005087E5           STR      R5,[R7, #+0]
    150                          interfaces++;
   \   00000068   047097E2           ADDS     R7,R7,#+4
   \   0000006C   EDFFFFEA           B        ??USBConfigurationDescriptor_Parse_0
    151                      }
    152                  }
    153                  else if (USBGenericDescriptor_GetType(descriptor)
    154                            == USBGenericDescriptor_ENDPOINT) {
   \                     ??USBConfigurationDescriptor_Parse_2:
   \   00000070   0500B0E1           MOVS     R0,R5
   \   00000074   ........           BL       USBGenericDescriptor_GetType
   \   00000078   050050E3           CMP      R0,#+5
   \   0000007C   0400001A           BNE      ??USBConfigurationDescriptor_Parse_3
    155          
    156                      if (endpoints) {
   \   00000080   000058E3           CMP      R8,#+0
   \   00000084   E7FFFF0A           BEQ      ??USBConfigurationDescriptor_Parse_0
    157                          
    158                          *endpoints = (USBEndpointDescriptor *) descriptor;
   \   00000088   005088E5           STR      R5,[R8, #+0]
    159                          endpoints++;
   \   0000008C   048098E2           ADDS     R8,R8,#+4
   \   00000090   E4FFFFEA           B        ??USBConfigurationDescriptor_Parse_0
    160                      }
    161                  }
    162                  else if (others) {
   \                     ??USBConfigurationDescriptor_Parse_3:
   \   00000094   000059E3           CMP      R9,#+0
   \   00000098   E2FFFF0A           BEQ      ??USBConfigurationDescriptor_Parse_0
    163          
    164                      *others = descriptor;
   \   0000009C   005089E5           STR      R5,[R9, #+0]
    165                      others++;
   \   000000A0   049099E2           ADDS     R9,R9,#+4
   \   000000A4   DFFFFFEA           B        ??USBConfigurationDescriptor_Parse_0
    166                  }
    167              }
    168          
    169              // Null-terminate arrays
    170              if (interfaces) {
   \                     ??USBConfigurationDescriptor_Parse_1:
   \   000000A8   000057E3           CMP      R7,#+0
   \   000000AC   0100000A           BEQ      ??USBConfigurationDescriptor_Parse_4
    171          
    172                  *interfaces = 0;
   \   000000B0   0000A0E3           MOV      R0,#+0
   \   000000B4   000087E5           STR      R0,[R7, #+0]
    173              }
    174              if (endpoints) {
   \                     ??USBConfigurationDescriptor_Parse_4:
   \   000000B8   000058E3           CMP      R8,#+0
   \   000000BC   0100000A           BEQ      ??USBConfigurationDescriptor_Parse_5
    175          
    176                  *endpoints = 0;
   \   000000C0   0000A0E3           MOV      R0,#+0
   \   000000C4   000088E5           STR      R0,[R8, #+0]
    177              }
    178              if (others) {
   \                     ??USBConfigurationDescriptor_Parse_5:
   \   000000C8   000059E3           CMP      R9,#+0
   \   000000CC   0100000A           BEQ      ??USBConfigurationDescriptor_Parse_6
    179          
    180                  *others = 0;
   \   000000D0   0000A0E3           MOV      R0,#+0
   \   000000D4   000089E5           STR      R0,[R9, #+0]
    181              }
    182          }
   \                     ??USBConfigurationDescriptor_Parse_6:
   \   000000D8   F843BDE8           POP      {R3-R9,LR}
   \   000000DC   1EFF2FE1           BX       LR               ;; return
    183          

   Maximum stack usage in bytes:

     Function                       .cstack
     --------                       -------
     USBConfigurationDescriptor_GetNumInterfaces
                                         0
     USBConfigurationDescriptor_GetTotalLength
                                         0
     USBConfigurationDescriptor_IsSelfPowered
                                         0
     USBConfigurationDescriptor_Parse
                                        32


   Section sizes:

     Function/Label                 Bytes
     --------------                 -----
     USBConfigurationDescriptor_GetTotalLength
                                      20
     USBConfigurationDescriptor_GetNumInterfaces
                                       8
     USBConfigurationDescriptor_IsSelfPowered
                                      32
     USBConfigurationDescriptor_Parse
                                     224

 
 284 bytes in section .text
 
 284 bytes of CODE memory

Errors: none
Warnings: none

⌨️ 快捷键说明

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