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

📄 os_view.lst

📁 IARSOURCECODE是基于LPC2478嵌入式软件IAR EWARM V4.42的应用实例代码
💻 LST
📖 第 1 页 / 共 5 页
字号:
    200              #endif
    201          #else
    202              #if OS_STK_GROWTH == 1
    203              (void)OSTaskCreate(OSView_Task,
    204                                 (void *)0,
    205                                 &OSView_TaskStk[OS_VIEW_TASK_STK_SIZE - 1],
    206                                 OS_VIEW_TASK_PRIO);
    207              #else
    208              (void)OSTaskCreate(OSView_Task,
    209                                 (void *)0,
    210                                 &OSView_TaskStk[0],
    211                                 OS_VIEW_TASK_PRIO);
    212              #endif
    213          #endif
    214          
    215          #if OS_TASK_NAME_SIZE > 10
    216              OSTaskNameSet(OS_VIEW_TASK_PRIO, (INT8U *)"uC/OS-View", &err);
   \   0000006C   0D20B0E1           MOVS     R2,SP
   \   00000070   1C109FE5           LDR      R1,??OSView_InitOS_0+0x10  ;; `?<Constant "uC/OS-View">`
   \   00000074   0300A0E3           MOV      R0,#+3
   \   00000078   ........           _BLF     OSTaskNameSet,??OSTaskNameSet??rA
    217          #else
    218          #if OS_TASK_NAME_SIZE > 7
    219              OSTaskNameSet(OS_VIEW_TASK_PRIO, (INT8U *)"OS-View", &err);
    220          #endif
    221          #endif
    222          }
   \   0000007C   04D08DE2           ADD      SP,SP,#+4        ;; stack cleaning
   \   00000080   0080BDE8           POP      {PC}             ;; return
   \                     ??OSView_InitOS_0:
   \   00000084   ........           DC32     `?<Constant "OS-View">`
   \   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   10402DE9           PUSH     {R4,LR}
   \   00000004   04D04DE2           SUB      SP,SP,#+4
    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;
   \   00000008   0000A0E3           MOV      R0,#+0
    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:
   \   0000000C   0D20B0E1           MOVS     R2,SP
   \   00000010   0010A0E3           MOV      R1,#+0
   \   00000014   ........           LDR      R0,??DataTable41  ;; OSView_Sem
   \   00000018   000090E5           LDR      R0,[R0, #+0]
   \   0000001C   ........           _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             */
   \   00000020   ........           BL       OSView_CmdParsePkt
   \   00000024   0040B0E1           MOVS     R4,R0
    255                  if (len > 0) {                            /* If we have a response                             */
   \   00000028   0448A0E1           MOV      R4,R4, LSL #+16
   \   0000002C   2448B0E1           MOVS     R4,R4, LSR #+16
   \   00000030   010054E3           CMP      R4,#+1
   \   00000034   F4FFFF3A           BCC      ??OSView_Task_0
    256                      OS_ENTER_CRITICAL();                  /* Setup transmission of the response                */
   \   00000038   ........           _BLF     OS_CPU_SR_Save,??OS_CPU_SR_Save??rA
    257                      OSView_TxLen = len;
   \   0000003C   ........           LDR      R1,??DataTable77  ;; OSView_TxLen
   \   00000040   B040C1E1           STRH     R4,[R1, #+0]
    258                      OS_EXIT_CRITICAL();
   \   00000044   ........           _BLF     OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rA
    259                      OSView_TxStart();
   \   00000048   ........           BL       OSView_TxStart
   \   0000004C   EEFFFFEA           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   00402DE9           PUSH     {LR}
    291              INT32U  cycles;
    292          
    293          
    294              cycles                         = OSView_TimeGetCycles();    /* This task is done                           */
   \   00000004   ........           BL       OSView_TimeGetCycles
    295              OSTCBCur->OSTCBCyclesTot      += cycles - OSTCBCur->OSTCBCyclesStart;
   \   00000008   ........           LDR      R1,??DataTable26  ;; OSTCBCur
   \   0000000C   001091E5           LDR      R1,[R1, #+0]
   \   00000010   ........           LDR      R2,??DataTable26  ;; OSTCBCur
   \   00000014   002092E5           LDR      R2,[R2, #+0]
   \   00000018   382092E5           LDR      R2,[R2, #+56]
   \   0000001C   022090E0           ADDS     R2,R0,R2
   \   00000020   ........           LDR      R3,??DataTable26  ;; OSTCBCur
   \   00000024   003093E5           LDR      R3,[R3, #+0]
   \   00000028   3C3093E5           LDR      R3,[R3, #+60]
   \   0000002C   032052E0           SUBS     R2,R2,R3
   \   00000030   382081E5           STR      R2,[R1, #+56]
    296              OSTCBHighRdy->OSTCBCyclesStart = cycles;                    /* Save absolute #cycles at task activation    */
   \   00000034   08109FE5           LDR      R1,??OSView_TaskSwHook_0  ;; OSTCBHighRdy
   \   00000038   001091E5           LDR      R1,[R1, #+0]
   \   0000003C   3C0081E5           STR      R0,[R1, #+60]
    297          }
   \   00000040   0080BDE8           POP      {PC}             ;; return
   \                     ??OSView_TaskSwHook_0:
   \   00000044   ........           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   30402DE9           PUSH     {R4,R5,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   0040A0E3           MOV      R4,#+0
    341          #endif
    342          
    343          
    344          
    345              OS_ENTER_CRITICAL();

⌨️ 快捷键说明

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