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

📄 os_cpu_c.lst

📁 lpc2478开发板基于IAR编译器移植ucos实验例程
💻 LST
📖 第 1 页 / 共 4 页
字号:
    155              OS_CPU_IntDisMeasInit();
    156          #endif
    157          
    158          #if OS_CPU_FPU_EN > 0
    159              OS_CPU_FP_Init();                                                   /* Initialize support for VFP register save / restore       */
    160          #endif
    161          }
   \                     OSInitHookEnd:
   \   00000000   0EF0A0E1           MOV      PC,LR            ;; return
    162          #endif
    163          
    164          /*
    165          *********************************************************************************************************
    166          *                                          TASK CREATION HOOK
    167          *
    168          * Description: This function is called when a task is created.
    169          *
    170          * Arguments  : ptcb   is a pointer to the task control block of the task being created.
    171          *
    172          * Note(s)    : 1) Interrupts are disabled during this call.
    173          *********************************************************************************************************
    174          */
    175          #if OS_CPU_HOOKS_EN > 0

   \                                 In segment CODE, align 4, keep-with-next
    176          void  OSTaskCreateHook (OS_TCB *ptcb)
    177          {
   \                     OSTaskCreateHook:
   \   00000000   10402DE9           PUSH     {R4,LR}
   \   00000004   0040B0E1           MOVS     R4,R0
    178          #if OS_CPU_FPU_EN > 0
    179              INT8U  err;
    180              void  *pblk;
    181          #endif
    182          
    183          
    184          #if OS_CPU_FPU_EN > 0
    185              if (ptcb->OSTCBOpt & OS_TASK_OPT_SAVE_FP) {                         /* See if task needs FP support                             */
    186                  pblk = OSMemGet(OSFPPartPtr, &err);                             /* Yes, Get storage for VFP registers                       */
    187                  if (pblk != (void *)0) {                                        /*      Did we get a memory block?                          */
    188                      ptcb->OSTCBExtPtr = pblk;                                   /*      Yes, Link to task's TCB                             */
    189                      OS_CPU_FP_Save(pblk);                                       /*           Save the VFP registers in block                */
    190                  }
    191              }
    192          #endif
    193          
    194          #if OS_VIEW_MODULE > 0
    195              OSView_TaskCreateHook(ptcb);
   \   00000008   0400B0E1           MOVS     R0,R4
   \   0000000C   ........           _BLF     OSView_TaskCreateHook,??OSView_TaskCreateHook??rA
    196          #else
    197              (void)ptcb;                                                         /* Prevent compiler warning                                 */
    198          #endif
    199          }
   \   00000010   1080BDE8           POP      {R4,PC}          ;; return
    200          #endif
    201          
    202          
    203          /*
    204          *********************************************************************************************************
    205          *                                           TASK DELETION HOOK
    206          *
    207          * Description: This function is called when a task is deleted.
    208          *
    209          * Arguments  : ptcb   is a pointer to the task control block of the task being deleted.
    210          *
    211          * Note(s)    : 1) Interrupts are disabled during this call.
    212          *********************************************************************************************************
    213          */
    214          #if OS_CPU_HOOKS_EN > 0

   \                                 In segment CODE, align 4, keep-with-next
    215          void  OSTaskDelHook (OS_TCB *ptcb)
    216          {
    217          #if OS_CPU_FPU_EN > 0
    218              if (ptcb->OSTCBOpt & OS_TASK_OPT_SAVE_FP) {                         /* See if task had FP support                               */
    219                  if (ptcb->OSTCBExtPtr != (void *)0) {                           /* Yes, OSTCBExtPtr must not be NULL                        */
    220                      OSMemPut(OSFPPartPtr, ptcb->OSTCBExtPtr);                   /*      Return memory block to free pool                    */
    221                  }
    222              }
    223          #endif
    224          
    225              (void)ptcb;                                                         /* Prevent compiler warning                                 */
    226          }
   \                     OSTaskDelHook:
   \   00000000   0EF0A0E1           MOV      PC,LR            ;; return
    227          #endif
    228          
    229          /*
    230          *********************************************************************************************************
    231          *                                             IDLE TASK HOOK
    232          *
    233          * Description: This function is called by the idle task.  This hook has been added to allow you to do
    234          *              such things as STOP the CPU to conserve power.
    235          *
    236          * Arguments  : none
    237          *
    238          * Note(s)    : 1) Interrupts are enabled during this call.
    239          *********************************************************************************************************
    240          */
    241          #if OS_CPU_HOOKS_EN > 0 && OS_VERSION >= 251

   \                                 In segment CODE, align 4, keep-with-next
    242          void  OSTaskIdleHook (void)
    243          {
   \                     OSTaskIdleHook:
   \   00000000   00402DE9           PUSH     {LR}
    244          #if OS_CPU_ARM_DCC_EN > 0
    245              OSDCC_Handler();
   \   00000004   ........           _BLF     OSDCC_Handler,??OSDCC_Handler??rA
    246          #endif
    247          }
   \   00000008   0080BDE8           POP      {PC}             ;; return
    248          #endif
    249          
    250          /*
    251          *********************************************************************************************************
    252          *                                           STATISTIC TASK HOOK
    253          *
    254          * Description: This function is called every second by uC/OS-II's statistics task.  This allows your
    255          *              application to add functionality to the statistics task.
    256          *
    257          * Arguments  : none
    258          *********************************************************************************************************
    259          */
    260          
    261          #if OS_CPU_HOOKS_EN > 0

   \                                 In segment CODE, align 4, keep-with-next
    262          void  OSTaskStatHook (void)
    263          {
    264          }
   \                     OSTaskStatHook:
   \   00000000   0EF0A0E1           MOV      PC,LR            ;; return
    265          #endif
    266          
    267          /*
    268          *********************************************************************************************************
    269          *                                        INITIALIZE A TASK'S STACK
    270          *
    271          * Description: This function is called by either OSTaskCreate() or OSTaskCreateExt() to initialize the
    272          *              stack frame of the task being created.  This function is highly processor specific.
    273          *
    274          * Arguments  : task          is a pointer to the task code
    275          *
    276          *              p_arg         is a pointer to a user supplied data area that will be passed to the task
    277          *                            when the task first executes.
    278          *
    279          *              ptos          is a pointer to the top of stack.  It is assumed that 'ptos' points to
    280          *                            a 'free' entry on the task stack.  If OS_STK_GROWTH is set to 1 then
    281          *                            'ptos' will contain the HIGHEST valid address of the stack.  Similarly, if
    282          *                            OS_STK_GROWTH is set to 0, the 'ptos' will contains the LOWEST valid address
    283          *                            of the stack.
    284          *
    285          *              opt           specifies options that can be used to alter the behavior of OSTaskStkInit().
    286          *                            (see uCOS_II.H for OS_TASK_OPT_xxx).
    287          *
    288          * Returns    : Always returns the location of the new top-of-stack' once the processor registers have
    289          *              been placed on the stack in the proper order.
    290          *
    291          * Note(s)    : 1) Interrupts are enabled when your task starts executing.
    292          *              2) All tasks run in SVC mode.
    293          *********************************************************************************************************
    294          */
    295          

   \                                 In segment CODE, align 4, keep-with-next
    296          OS_STK *OSTaskStkInit (void (*task)(void *p_arg), void *p_arg, OS_STK *ptos, INT16U opt)
    297          {
   \                     OSTaskStkInit:
   \   00000000   30002DE9           PUSH     {R4,R5}
   \   00000004   00C0B0E1           MOVS     R12,R0
    298              OS_STK *stk;
    299              INT32U  task_addr;
    300          
    301          
    302              opt       = opt;                                                    /* 'opt' is not used, prevent warning                       */
    303              stk       = ptos;                                                   /* Load stack pointer                                       */
   \   00000008   0200B0E1           MOVS     R0,R2
    304              task_addr = (INT32U)task & ~1;                                      /* Mask off lower bit in case task is thumb mode            */
   \   0000000C   0150DCE3           BICS     R5,R12,#0x1
   \   00000010   0540B0E1           MOVS     R4,R5
    305              *(stk)    = (INT32U)task_addr;                                      /* Entry Point                                              */
   \   00000014   004080E5           STR      R4,[R0, #+0]
    306              *(--stk)  = (INT32U)0x14141414L;                                    /* R14 (LR)                                                 */
   \   00000018   040050E2           SUBS     R0,R0,#+4
   \   0000001C   C4509FE5           LDR      R5,??OSTaskStkInit_0  ;; 0x14141414
   \   00000020   005080E5           STR      R5,[R0, #+0]
    307              *(--stk)  = (INT32U)0x12121212L;                                    /* R12                                                      */
   \   00000024   040050E2           SUBS     R0,R0,#+4
   \   00000028   BC509FE5           LDR      R5,??OSTaskStkInit_0+0x4  ;; 0x12121212
   \   0000002C   005080E5           STR      R5,[R0, #+0]
    308              *(--stk)  = (INT32U)0x11111111L;                                    /* R11                                                      */
   \   00000030   040050E2           SUBS     R0,R0,#+4
   \   00000034   B4509FE5           LDR      R5,??OSTaskStkInit_0+0x8  ;; 0x11111111
   \   00000038   005080E5           STR      R5,[R0, #+0]
    309              *(--stk)  = (INT32U)0x10101010L;                                    /* R10                                                      */
   \   0000003C   040050E2           SUBS     R0,R0,#+4
   \   00000040   AC509FE5           LDR      R5,??OSTaskStkInit_0+0xC  ;; 0x10101010
   \   00000044   005080E5           STR      R5,[R0, #+0]

⌨️ 快捷键说明

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