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

📄 os_view.lst

📁 lpc2478开发板基于IAR编译器移植ucos实验例程
💻 LST
📖 第 1 页 / 共 5 页
字号:
   \   00000088   ........           DC32     OSView_TaskStk
   \   0000008C   ........           DC32     OSView_TaskStk + 2044
   \   00000090   ........           DC32     OSView_Task
   \   00000094   ........           DC32     `?<Constant "uC/OS-View">`
    223          #endif
    224          
    225          /*$PAGE*/
    226          /*
    227          *********************************************************************************************************
    228          *                                           uC/OS-View TASK
    229          *********************************************************************************************************
    230          */
    231          
    232          #if OS_VIEW_PARSE_TASK > 0

   \                                 In segment CODE, align 4, keep-with-next
    233          static  void  OSView_Task (void *p_arg)
    234          {
   \                     OSView_Task:
   \   00000000   70402DE9           PUSH     {R4-R6,LR}
   \   00000004   04D04DE2           SUB      SP,SP,#+4
   \   00000008   0040B0E1           MOVS     R4,R0
    235              INT16U     len;
    236              INT8U      err;
    237          #if OS_SEM_EN == 0 && OS_MBOX_EN > 0
    238              void      *msg;
    239          #endif
    240          #if OS_CRITICAL_METHOD == 3                       /* Allocate storage for CPU status register          */
    241              OS_CPU_SR  cpu_sr = 0;
   \   0000000C   0000A0E3           MOV      R0,#+0
   \   00000010   0060B0E1           MOVS     R6,R0
    242          #endif
    243          
    244          
    245              (void)p_arg;
    246              while (1) {
    247          #if OS_SEM_EN > 0
    248                  (void)OSSemPend(OSView_Sem, 0, &err);     /* Wait for a packet to be received                  */
   \                     ??OSView_Task_0:
   \   00000014   0D20B0E1           MOVS     R2,SP
   \   00000018   0010A0E3           MOV      R1,#+0
   \   0000001C   ........           LDR      R0,??DataTable41  ;; OSView_Sem
   \   00000020   000090E5           LDR      R0,[R0, #+0]
   \   00000024   ........           _BLF     OSSemPend,??OSSemPend??rA
    249          #else
    250          #if OS_MBOX_EN > 0
    251                  (void)OSMboxPend(OSView_Mbox, 0, &err);   /* Wait for a packet to be received                  */
    252          #endif
    253          #endif
    254                  len = OSView_CmdParsePkt();               /* Parse packet and formulate a response             */
   \   00000028   ........           BL       OSView_CmdParsePkt
   \   0000002C   0050B0E1           MOVS     R5,R0
    255                  if (len > 0) {                            /* If we have a response                             */
   \   00000030   0558A0E1           MOV      R5,R5, LSL #+16
   \   00000034   2558B0E1           MOVS     R5,R5, LSR #+16
   \   00000038   010055E3           CMP      R5,#+1
   \   0000003C   F4FFFF3A           BCC      ??OSView_Task_0
    256                      OS_ENTER_CRITICAL();                  /* Setup transmission of the response                */
   \   00000040   ........           _BLF     OS_CPU_SR_Save,??OS_CPU_SR_Save??rA
   \   00000044   0060B0E1           MOVS     R6,R0
    257                      OSView_TxLen = len;
   \   00000048   ........           LDR      R0,??DataTable11  ;; OSView_TxLen
   \   0000004C   B050C0E1           STRH     R5,[R0, #+0]
    258                      OS_EXIT_CRITICAL();
   \   00000050   0600B0E1           MOVS     R0,R6
   \   00000054   ........           _BLF     OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rA
    259                      OSView_TxStart();
   \   00000058   ........           BL       OSView_TxStart
   \   0000005C   ECFFFFEA           B        ??OSView_Task_0
    260                  }
    261              }
    262          }
    263          #endif
    264          
    265          /*$PAGE*/
    266          /*
    267          *********************************************************************************************************
    268          *                                     uC/OS-View TASK CREATE HOOK
    269          *
    270          * Description: This function MUST be called by uC/OS-II's Task Create Hook function: OSTaskCreateHook().
    271          *********************************************************************************************************
    272          */
    273          

   \                                 In segment CODE, align 4, keep-with-next
    274          void  OSView_TaskCreateHook (OS_TCB *ptcb)
    275          {
   \                     OSView_TaskCreateHook:
   \   00000000   10402DE9           PUSH     {R4,LR}
   \   00000004   0040B0E1           MOVS     R4,R0
    276              ptcb->OSTCBCyclesStart = OSView_TimeGetCycles();        /* Get the current start time for this task.       */
   \   00000008   ........           BL       OSView_TimeGetCycles
   \   0000000C   3C0084E5           STR      R0,[R4, #+60]
    277              ptcb->OSTCBCyclesTot   = 0;                             /* Update the task's total execution time          */
   \   00000010   0000A0E3           MOV      R0,#+0
   \   00000014   380084E5           STR      R0,[R4, #+56]
    278          }
   \   00000018   1080BDE8           POP      {R4,PC}          ;; return
    279          
    280          /*$PAGE*/
    281          /*
    282          *********************************************************************************************************
    283          *                                     uC/OS-View TASK SWITCH HOOK
    284          *
    285          * Description: This function MUST be called by uC/OS-II's Task Switch Hook function: OSTaskSwHook().
    286          *********************************************************************************************************
    287          */
    288          

   \                                 In segment CODE, align 4, keep-with-next
    289          void  OSView_TaskSwHook (void)
    290          {
   \                     OSView_TaskSwHook:
   \   00000000   10402DE9           PUSH     {R4,LR}
    291              INT32U  cycles;
    292          
    293          
    294              cycles                         = OSView_TimeGetCycles();    /* This task is done                           */
   \   00000004   ........           BL       OSView_TimeGetCycles
   \   00000008   0040B0E1           MOVS     R4,R0
    295              OSTCBCur->OSTCBCyclesTot      += cycles - OSTCBCur->OSTCBCyclesStart;
   \   0000000C   ........           LDR      R0,??DataTable26  ;; OSTCBCur
   \   00000010   000090E5           LDR      R0,[R0, #+0]
   \   00000014   ........           LDR      R1,??DataTable26  ;; OSTCBCur
   \   00000018   001091E5           LDR      R1,[R1, #+0]
   \   0000001C   381091E5           LDR      R1,[R1, #+56]
   \   00000020   011094E0           ADDS     R1,R4,R1
   \   00000024   ........           LDR      R2,??DataTable26  ;; OSTCBCur
   \   00000028   002092E5           LDR      R2,[R2, #+0]
   \   0000002C   3C2092E5           LDR      R2,[R2, #+60]
   \   00000030   021051E0           SUBS     R1,R1,R2
   \   00000034   381080E5           STR      R1,[R0, #+56]
    296              OSTCBHighRdy->OSTCBCyclesStart = cycles;                    /* Save absolute #cycles at task activation    */
   \   00000038   08009FE5           LDR      R0,??OSView_TaskSwHook_0  ;; OSTCBHighRdy
   \   0000003C   000090E5           LDR      R0,[R0, #+0]
   \   00000040   3C4080E5           STR      R4,[R0, #+60]
    297          }
   \   00000044   1080BDE8           POP      {R4,PC}          ;; return
   \                     ??OSView_TaskSwHook_0:
   \   00000048   ........           DC32     OSTCBHighRdy
    298          
    299          /*
    300          *********************************************************************************************************
    301          *                                       Update 32-bits cycles counter
    302          *
    303          * Description: This function must be called by uC/OS-II's OSTimeTickHook() and is used to maintain a
    304          *              32-bit counter of clock or other cycles.
    305          *
    306          * Returns    : None
    307          *
    308          * Note(s)    : Changes the global variable OSView_CyclesCtr
    309          *********************************************************************************************************
    310          */
    311          

   \                                 In segment CODE, align 4, keep-with-next
    312          void  OSView_TickHook (void)
    313          {
   \                     OSView_TickHook:
   \   00000000   00402DE9           PUSH     {LR}
    314              (void)OSView_TimeGetCycles();
   \   00000004   ........           BL       OSView_TimeGetCycles
    315          }
   \   00000008   0080BDE8           POP      {PC}             ;; return
    316          
    317          /*$PAGE*/
    318          /*
    319          *********************************************************************************************************
    320          *                                           Get time [cycles]
    321          *
    322          * Description: This routine is required for task execution time measurement.  This function needs to
    323          *              return time as accurately as possible and in a 32-bit variable.
    324          *
    325          * Returns    : A 32-bit representation of time.
    326          *********************************************************************************************************
    327          */
    328          

   \                                 In segment CODE, align 4, keep-with-next
    329          INT32U  OSView_TimeGetCycles (void)
    330          {
   \                     OSView_TimeGetCycles:
   \   00000000   F0402DE9           PUSH     {R4-R7,LR}
    331              INT32U     cycles;
    332          #if OS_VIEW_TMR_32_BITS > 0
    333              INT32U     cnts32;
    334              INT32U     cnts32_delta;
    335          #else
    336              INT16U     cnts16;
    337              INT16U     cnts16_delta;
    338          #endif
    339          #if OS_CRITICAL_METHOD == 3                                    /* Allocate storage for CPU status register         */
    340              OS_CPU_SR  cpu_sr = 0;
   \   00000004   0000A0E3           MOV      R0,#+0
   \   00000008   0070B0E1           MOVS     R7,R0
    341          #endif
    342          
    343          
    344          
    345              OS_ENTER_CRITICAL();
   \   0000000C   ........           _BLF     OS_CPU_SR_Save,??OS_CPU_SR_Save??rA
   \   00000010   0070B0E1           MOVS     R7,R0
    346          #if OS_VIEW_TMR_32_BITS > 0
    347              cnts32              = OSView_TmrRd();                      /* Read current counts of the free running counter  */
   \   00000014   ........           _BLF     OSView_TmrRd,??OSView_TmrRd??rA
   \   00000018   0050B0E1           MOVS     R5,R0
    348              cnts32_delta        = cnts32 - OSView_TmrCntsPrev;
   \   0000001C   ........           LDR      R0,??DataTable16  ;; OSView_TmrCntsPrev
   \   00000020   000090E5           LDR      R0,[R0, #+0]
   \   00000024   000055E0           SUBS     R0,R5,R0
   \   00000028   0060B0E1           MOVS     R6,R0
    349              OSView_TmrCntsPrev  = cnts32;                              /* Save current counts for next time                */
   \   0000002C   ........           LDR      R0,??DataTable16  ;; OSView_TmrCntsPrev
   \   00000030   005080E5           STR      R5,[R0, #+0]
    350              OSView_CyclesCtr   += cnts32_delta;
   \   00000034   ........           LDR      R0,??DataTable19  ;; OSView_CyclesCtr
   \   00000038   ........           LDR      R1,??DataTable19  ;; OSView_CyclesCtr
   \   0000003C   001091E5           LDR      R1,[R1, #+0]
   \   00000040   011096E0           ADDS     R1,R6,R1
   \   00000044   001080E5           STR      R1,[R0, #+0]
    351          #else
    352              cnts16              = (INT16U)OSView_TmrRd();              /* Read current counts of the free running counter  */
    353              cnts16_delta        = cnts16 - OSView_TmrCntsPrev;
    354              OSView_TmrCntsPrev  = cnts16;                              /* Save current counts for next time                */
    355              OSView_CyclesCtr   += (INT32U)cnts16_delta;
    356          #endif
    357              cycles              = OSView_CyclesCtr;
   \   00000048   ........           LDR      R0,??DataTable19  ;; OSView_CyclesCtr

⌨️ 快捷键说明

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