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

📄 po_kernel.lst

📁 at91sam7x256 FREERTOS sd卡的读写程序
💻 LST
📖 第 1 页 / 共 3 页
字号:

   \                                 In segment CODE, align 4, keep-with-next
    180          int po_rngNBytes( RING_ID * pRingId )
    181          {
   \                     po_rngNBytes:
   \   00000000   10B5               PUSH        {R4,LR}
   \   00000002   041C               MOV         R4,R0
    182            int _len;
    183          
    184            po_lock();
   \   00000004   ........           _BLF        po_lock,??po_lock??rT
    185            _len = (pRingId->last - pRingId->first) - pRingId->NbOctetsLibres;
   \   00000008   E068               LDR         R0,[R4, #+12]
   \   0000000A   2168               LDR         R1,[R4, #+0]
   \   0000000C   401A               SUB         R0,R0,R1
   \   0000000E   2169               LDR         R1,[R4, #+16]
   \   00000010   441A               SUB         R4,R0,R1
    186            po_unlock();
   \   00000012   ........           _BLF        po_unlock,??po_unlock??rT
    187            return( _len );
   \   00000016   201C               MOV         R0,R4
   \   00000018   10BC               POP         {R4}
   \   0000001A   02BC               POP         {R1}
   \   0000001C   0847               BX          R1                 ;; return
    188          }
    189          
    190          /******************************************************************
    191          *
    192          * SUB-ROUTINE  po_rngFlush
    193          *
    194          *------------------------------------------------------------------
    195          *
    196          * purpose : flush rounding buffer
    197          *
    198          * input parameters : rounding buffer
    199          *
    200          *
    201          *
    202          * output parameters :
    203          *
    204          * global data :
    205          *
    206          ******************************************************************/
    207          #ifdef ADS_COMPIL
    208          void po_rngFlush( RING_ID * pRingId )
    209          #else

   \                                 In segment CODE_I, align 4, keep-with-next
    210          __ramfunc void po_rngFlush( RING_ID * pRingId )
    211          #endif
    212          {
   \                     po_rngFlush:
   \   00000000   10B5               PUSH        {R4,LR}
   \   00000002   041C               MOV         R4,R0
    213            po_lock();
   \   00000004   ........           BL          po_lock
    214            pRingId->current = pRingId->first;
   \   00000008   2068               LDR         R0,[R4, #+0]
   \   0000000A   A060               STR         R0,[R4, #+8]
    215            pRingId->free    = pRingId->first;
   \   0000000C   6060               STR         R0,[R4, #+4]
    216            pRingId->NbOctetsLibres = pRingId->last - pRingId->first;
   \   0000000E   E068               LDR         R0,[R4, #+12]
   \   00000010   2168               LDR         R1,[R4, #+0]
   \   00000012   401A               SUB         R0,R0,R1
   \   00000014   2061               STR         R0,[R4, #+16]
    217            po_unlock();
   \   00000016   ........           BL          po_unlock
   \   0000001A   C046               NOP         
    218          }
   \   0000001C                      REQUIRE ?Subroutine13
   \   0000001C                      ;; // Fall through to label ?Subroutine13
    219          
    220          /******************************************************************
    221          *
    222          * SUB-ROUTINE  po_rngIsEmpty
    223          *
    224          *------------------------------------------------------------------
    225          *
    226          * purpose : return 0 if rounding buffer empty
    227          *
    228          * input parameters : rounding buffer
    229          *
    230          *
    231          *
    232          * output parameters :
    233          *
    234          * global data :
    235          *
    236          ******************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    237          int po_rngIsEmpty( RING_ID * pRingId )
    238          {
   \                     po_rngIsEmpty:
   \   00000000   30B5               PUSH        {R4,R5,LR}
   \   00000002   051C               MOV         R5,R0
    239            int _ret = 0;
   \   00000004   0024               MOV         R4,#+0
    240          
    241            po_lock();
   \   00000006   ........           _BLF        po_lock,??po_lock??rT
    242            if( pRingId->NbOctetsLibres == (pRingId->last - pRingId->first) )
   \   0000000A   2869               LDR         R0,[R5, #+16]
   \   0000000C   E968               LDR         R1,[R5, #+12]
   \   0000000E   2A68               LDR         R2,[R5, #+0]
   \   00000010   891A               SUB         R1,R1,R2
   \   00000012   8842               CMP         R0,R1
   \   00000014   00D1               BNE         ??po_rngIsEmpty_0
    243            {
    244              _ret = 1;
   \   00000016   0124               MOV         R4,#+1
    245            }
    246            po_unlock();
   \                     ??po_rngIsEmpty_0:
   \   00000018   ........           _BLF        po_unlock,??po_unlock??rT
    247          
    248            return( _ret );
   \   0000001C   201C               MOV         R0,R4
   \   0000001E   ....               B           ?Subroutine14
    249          }

   \                                 In segment CODE, align 4, keep-with-next
   \                     ?Subroutine14:
   \   00000000   30BC               POP         {R4,R5}
   \   00000002   02BC               POP         {R1}
   \   00000004   0847               BX          R1                 ;; return
   \   00000006   C046               NOP         
   \                     ??Subroutine14_0:
   \   00000008   ........           DC32        `?<Constant "malloc %d fault!">`
   \   0000000C   ........           DC32        _Stdout
    250          
    251          /******************************************************************
    252          *
    253          * SUB-ROUTINE  po_rngBufPut
    254          *
    255          *------------------------------------------------------------------
    256          *
    257          * purpose : write Bytes in FIFO
    258          *
    259          * input parameters : pRingId
    260          *                    buffer
    261          *                    len
    262          *
    263          * output parameters :
    264          *
    265          * global data :
    266          *
    267          ******************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    268          int po_rngBufPut( RING_ID * pRingId, char * buffer, int len )
    269          {
   \                     po_rngBufPut:
   \   00000000   F0B5               PUSH        {R4-R7,LR}
   \   00000002   041C               MOV         R4,R0
   \   00000004   0D1C               MOV         R5,R1
   \   00000006   161C               MOV         R6,R2
    270            char *_free;
    271            char *_first;
    272            char *_last;
    273            int  _NbOctetsLibres ;
    274            int  _i = len;
   \   00000008   171C               MOV         R7,R2
    275          
    276            po_lock();
   \   0000000A   ........           _BLF        po_lock,??po_lock??rT
    277          
    278            _NbOctetsLibres =  pRingId->NbOctetsLibres;
    279            _free = pRingId->free;
   \   0000000E   6068               LDR         R0,[R4, #+4]
    280            _first = pRingId->first;
   \   00000010   2168               LDR         R1,[R4, #+0]
    281            _last = pRingId->last;
   \   00000012   E268               LDR         R2,[R4, #+12]
    282          
    283            if( len > _NbOctetsLibres )
   \   00000014   2369               LDR         R3,[R4, #+16]
   \   00000016   B342               CMP         R3,R6
   \   00000018   0BDA               BGE         ??po_rngBufPut_0
    284            {
    285              TRACE_ERROR( "PB BufPut:len=%d\n\r", len );
    286              po_unlock();
   \   0000001A   ........           _BLF        po_unlock,??po_unlock??rT
    287              return -1;
   \   0000001E   0020               MOV         R0,#+0
   \   00000020   C043               MVN         R0,R0              ;; #-1
   \   00000022   11E0               B           ??po_rngBufPut_1
    288            }
    289          
    290            while( _i-- > 0 )
    291            {
    292              *_free++ = *buffer++;
   \                     ??po_rngBufPut_2:
   \   00000024   2B78               LDRB        R3,[R5, #+0]
   \   00000026   0370               STRB        R3,[R0, #+0]
   \   00000028   6D1C               ADD         R5,R5,#+1
   \   0000002A   401C               ADD         R0,R0,#+1
    293          
    294              if( _free >= _last )
   \   0000002C   9042               CMP         R0,R2
   \   0000002E   00D3               BCC         ??po_rngBufPut_0
    295              {
    296                _free = _first;
   \   00000030   081C               MOV         R0,R1
    297              }
    298            }
   \                     ??po_rngBufPut_0:
   \   00000032   3B1C               MOV         R3,R7
   \   00000034   7F1E               SUB         R7,R7,#+1
   \   00000036   012B               CMP         R3,#+1
   \   00000038   F4DA               BGE         ??po_rngBufPut_2
    299          
    300            pRingId->NbOctetsLibres -= len;
   \   0000003A   2169               LDR         R1,[R4, #+16]
   \   0000003C   891B               SUB         R1,R1,R6
   \   0000003E   2161               STR         R1,[R4, #+16]
    301          
    302            pRingId->free = _free;
   \   00000040   6060               STR         R0,[R4, #+4]
    303          
    304            po_unlock();
   \   00000042   ........           _BLF        po_unlock,??po_unlock??rT
    305          
    306            return( len );
   \   00000046   301C               MOV         R0,R6
   \                     ??po_rngBufPut_1:
   \   00000048   ....               B           ?Subroutine15
    307          }

   \                                 In segment CODE, align 4, keep-with-next
   \                     ?Subroutine15:
   \   00000000   F0BC               POP         {R4-R7}
   \   00000002   02BC               POP         {R1}
   \   00000004   0847               BX          R1                 ;; return
    308          
    309          /******************************************************************
    310          *
    311          * SUB-ROUTINE  po_rngBufGet
    312          *
    313          *------------------------------------------------------------------
    314          *
    315          * purpose : read Bytes from FIFO
    316          *
    317          * input parameters : pRingId
    318          *                    buffer
    319          *                    len
    320          *
    321          * output parameters :
    322          *
    323          * global data :
    324          *
    325          ******************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    326          int po_rngBufGet( RING_ID * pRingId, char * buffer, int len )
    327          {
   \                     po_rngBufGet:
   \   00000000   F0B5               PUSH        {R4-R7,LR}
   \   00000002   041C               MOV         R4,R0
   \   00000004   0D1C               MOV         R5,R1
   \   00000006   161C               MOV         R6,R2
    328            char *_current;
    329            char *_first;
    330            char *_last;
    331            int _NbOctetsLibres;
    332            int _NbOctetsFifo;
    333            int _ret;
    334          
    335            po_lock();
   \   00000008   ........           _BLF        po_lock,??po_lock??rT
    336            //TRACE_DEBUG_L("rngBufGet\n\r");
    337          
    338            _current = pRingId->current;
   \   0000000C   A168               LDR         R1,[R4, #+8]
    339            _first   = pRingId->first;
   \   0000000E   2068               LDR         R0,[R4, #+0]
    340            _last    = pRingId->last;
   \   00000010   E268               LDR         R2,[R4, #+12]
    341            _NbOctetsLibres =  pRingId->NbOctetsLibres;
    342          
    343            _NbOctetsFifo = (_last - _first) - _NbOctetsLibres ;
   \   00000012   131A               SUB         R3,R2,R0
   \   00000014   2769               LDR         R7,[R4, #+16]
   \   00000016   DB1B               SUB         R3,R3,R7
    344            if( 0 == _NbOctetsFifo )
   \   00000018   03D1               BNE         ??po_rngBufGet_0
    345            {
    346              TRACE_ERROR( "PB BufGet\n\r" );
    347              po_unlock();
   \   0000001A   ........           _BLF        po_unlock,??po_unlock??rT
    348              return 0;
   \   0000001E   0020               MOV         R0,#+0
   \   00000020   16E0               B           ??po_rngBufGet_1
    349            }

⌨️ 快捷键说明

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