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

📄 usbconfigurationdescriptor.lst

📁 本代bootloader通过usb下载代码首先存放在sdram中
💻 LST
📖 第 1 页 / 共 2 页
字号:
     95          ///
     96          /// Note that if the pointer to an array is null (0), nothing is stored in
     97          /// it.
     98          /// \param configuration Pointer to the start of the whole Configuration 
     99          ///                      descriptor.
    100          /// \param interfaces    Pointer to the Interface descriptor array.
    101          /// \param endpoints     Pointer to the Endpoint descriptor array.
    102          /// \param others        Pointer to the class-specific descriptor array.
    103          //-----------------------------------------------------------------------------

   \                                 In section .text, align 4, keep-with-next
    104          void USBConfigurationDescriptor_Parse(
    105              const USBConfigurationDescriptor *configuration,
    106              USBInterfaceDescriptor **interfaces,
    107              USBEndpointDescriptor **endpoints,
    108              USBGenericDescriptor **others)
    109          {
   \                     USBConfigurationDescriptor_Parse:
   \   00000000   F0412DE9           PUSH     {R4-R8,LR}
   \   00000004   0040A0E1           MOV      R4,R0
   \   00000008   0150A0E1           MOV      R5,R1
   \   0000000C   0260A0E1           MOV      R6,R2
   \   00000010   0370A0E1           MOV      R7,R3
    110              // Get size of configuration to parse
    111              int size = USBConfigurationDescriptor_GetTotalLength(configuration);
   \   00000014   ........           BL       USBConfigurationDescriptor_GetTotalLength
    112              size -= sizeof(USBConfigurationDescriptor);
   \   00000018   098040E2           SUB      R8,R0,#+9
    113          
    114              // Start parsing descriptors
    115              USBGenericDescriptor *descriptor = (USBGenericDescriptor *) configuration;
   \   0000001C   010058E3           CMP      R8,#+1
   \   00000020   180000BA           BLT      ??USBConfigurationDescriptor_Parse_0
    116              while (size > 0) {
    117          
    118                  // Get next descriptor
    119                  descriptor = USBGenericDescriptor_GetNextDescriptor(descriptor);
   \                     ??USBConfigurationDescriptor_Parse_1:
   \   00000024   0400A0E1           MOV      R0,R4
   \   00000028   ........           BL       USBGenericDescriptor_GetNextDescriptor
   \   0000002C   0040A0E1           MOV      R4,R0
    120                  size -= USBGenericDescriptor_GetLength(descriptor);
   \   00000030   ........           BL       USBGenericDescriptor_GetLength
   \   00000034   008048E0           SUB      R8,R8,R0
    121          
    122                  // Store descriptor in correponding array
    123                  if (USBGenericDescriptor_GetType(descriptor)
    124                       == USBGenericDescriptor_INTERFACE) {
   \   00000038   0400A0E1           MOV      R0,R4
   \   0000003C   ........           BL       USBGenericDescriptor_GetType
   \   00000040   040050E3           CMP      R0,#+4
   \   00000044   0300001A           BNE      ??USBConfigurationDescriptor_Parse_2
    125          
    126                      if (interfaces) {
   \   00000048   000055E3           CMP      R5,#+0
   \   0000004C   0B00000A           BEQ      ??USBConfigurationDescriptor_Parse_3
    127                      
    128                          *interfaces = (USBInterfaceDescriptor *) descriptor;
   \   00000050   044085E4           STR      R4,[R5], #+4
    129                          interfaces++;
   \   00000054   090000EA           B        ??USBConfigurationDescriptor_Parse_3
    130                      }
    131                  }
    132                  else if (USBGenericDescriptor_GetType(descriptor)
    133                            == USBGenericDescriptor_ENDPOINT) {
   \                     ??USBConfigurationDescriptor_Parse_2:
   \   00000058   0400A0E1           MOV      R0,R4
   \   0000005C   ........           BL       USBGenericDescriptor_GetType
   \   00000060   050050E3           CMP      R0,#+5
   \   00000064   0300001A           BNE      ??USBConfigurationDescriptor_Parse_4
    134          
    135                      if (endpoints) {
   \   00000068   000056E3           CMP      R6,#+0
   \   0000006C   0300000A           BEQ      ??USBConfigurationDescriptor_Parse_3
    136                          
    137                          *endpoints = (USBEndpointDescriptor *) descriptor;
   \   00000070   044086E4           STR      R4,[R6], #+4
    138                          endpoints++;
   \   00000074   010000EA           B        ??USBConfigurationDescriptor_Parse_3
    139                      }
    140                  }
    141                  else if (others) {
   \                     ??USBConfigurationDescriptor_Parse_4:
   \   00000078   000057E3           CMP      R7,#+0
    142          
    143                      *others = descriptor;
   \   0000007C   04408714           STRNE    R4,[R7], #+4
    144                      others++;
    145                  }
    146              }
   \                     ??USBConfigurationDescriptor_Parse_3:
   \   00000080   010058E3           CMP      R8,#+1
   \   00000084   E6FFFFAA           BGE      ??USBConfigurationDescriptor_Parse_1
    147          
    148              // Null-terminate arrays
    149              if (interfaces) {
   \                     ??USBConfigurationDescriptor_Parse_0:
   \   00000088   000055E3           CMP      R5,#+0
    150          
    151                  *interfaces = 0;
   \   0000008C   0000A013           MOVNE    R0,#+0
   \   00000090   00008515           STRNE    R0,[R5, #+0]
    152              }
    153              if (endpoints) {
   \   00000094   000056E3           CMP      R6,#+0
    154          
    155                  *endpoints = 0;
   \   00000098   0000A013           MOVNE    R0,#+0
   \   0000009C   00008615           STRNE    R0,[R6, #+0]
    156              }
    157              if (others) {
   \   000000A0   000057E3           CMP      R7,#+0
    158          
    159                  *others = 0;
   \   000000A4   0000A013           MOVNE    R0,#+0
   \   000000A8   00008715           STRNE    R0,[R7, #+0]
    160              }
    161          }
   \   000000AC   F041BDE8           POP      {R4-R8,LR}
   \   000000B0   1EFF2FE1           BX       LR               ;; return
    162          

   Maximum stack usage in bytes:

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


   Section sizes:

     Function/Label                 Bytes
     --------------                 -----
     USBConfigurationDescriptor_GetTotalLength
                                      16
     USBConfigurationDescriptor_GetNumInterfaces
                                       8
     USBConfigurationDescriptor_IsSelfPowered
                                      20
     USBConfigurationDescriptor_Parse
                                     180

 
 224 bytes in section .text
 
 224 bytes of CODE memory

Errors: none
Warnings: none

⌨️ 快捷键说明

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