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

📄 os_cpu_c.lst

📁 编译环境是 iar EWARM ,STM32 下的UCOSII
💻 LST
📖 第 1 页 / 共 3 页
字号:
   \                     OSTaskDelHook:
   \   00000000   00B5               PUSH     {LR}
    127          #if OS_APP_HOOKS_EN > 0
    128              App_TaskDelHook(ptcb);
   \   00000002   ........           _BLF     App_TaskDelHook,??App_TaskDelHook??rT
    129          #else
    130              (void)ptcb;                                  /* Prevent compiler warning                           */
    131          #endif
    132          }
   \   00000006   00BD               POP      {PC}             ;; return
    133          #endif
    134          
    135          /*
    136          *********************************************************************************************************
    137          *                                             IDLE TASK HOOK
    138          *
    139          * Description: This function is called by the idle task.  This hook has been added to allow you to do
    140          *              such things as STOP the CPU to conserve power.
    141          *
    142          * Arguments  : none
    143          *
    144          * Note(s)    : 1) Interrupts are enabled during this call.
    145          *********************************************************************************************************
    146          */
    147          #if OS_CPU_HOOKS_EN > 0 && OS_VERSION >= 251

   \                                 In segment CODE, align 4, keep-with-next
    148          void  OSTaskIdleHook (void)
    149          {
   \                     OSTaskIdleHook:
   \   00000000   00B5               PUSH     {LR}
    150          #if OS_APP_HOOKS_EN > 0
    151              App_TaskIdleHook();
   \   00000002   ........           _BLF     App_TaskIdleHook,??App_TaskIdleHook??rT
    152          #endif
    153          }
   \   00000006   00BD               POP      {PC}             ;; return
    154          #endif
    155          
    156          /*
    157          *********************************************************************************************************
    158          *                                           STATISTIC TASK HOOK
    159          *
    160          * Description: This function is called every second by uC/OS-II's statistics task.  This allows your
    161          *              application to add functionality to the statistics task.
    162          *
    163          * Arguments  : none
    164          *********************************************************************************************************
    165          */
    166          
    167          #if OS_CPU_HOOKS_EN > 0

   \                                 In segment CODE, align 4, keep-with-next
    168          void  OSTaskStatHook (void)
    169          {
   \                     OSTaskStatHook:
   \   00000000   00B5               PUSH     {LR}
    170          #if OS_APP_HOOKS_EN > 0
    171              App_TaskStatHook();
   \   00000002   ........           _BLF     App_TaskStatHook,??App_TaskStatHook??rT
    172          #endif
    173          }
   \   00000006   00BD               POP      {PC}             ;; return
    174          #endif
    175          
    176          /*
    177          *********************************************************************************************************
    178          *                                        INITIALIZE A TASK'S STACK
    179          *
    180          * Description: This function is called by either OSTaskCreate() or OSTaskCreateExt() to initialize the
    181          *              stack frame of the task being created.  This function is highly processor specific.
    182          *
    183          * Arguments  : task          is a pointer to the task code
    184          *
    185          *              p_arg         is a pointer to a user supplied data area that will be passed to the task
    186          *                            when the task first executes.
    187          *
    188          *              ptos          is a pointer to the top of stack.  It is assumed that 'ptos' points to
    189          *                            a 'free' entry on the task stack.  If OS_STK_GROWTH is set to 1 then
    190          *                            'ptos' will contain the HIGHEST valid address of the stack.  Similarly, if
    191          *                            OS_STK_GROWTH is set to 0, the 'ptos' will contains the LOWEST valid address
    192          *                            of the stack.
    193          *
    194          *              opt           specifies options that can be used to alter the behavior of OSTaskStkInit().
    195          *                            (see uCOS_II.H for OS_TASK_OPT_xxx).
    196          *
    197          * Returns    : Always returns the location of the new top-of-stack once the processor registers have
    198          *              been placed on the stack in the proper order.
    199          *
    200          * Note(s)    : 1) Interrupts are enabled when your task starts executing.
    201          *              2) All tasks run in Thread mode, using process stack.
    202          *********************************************************************************************************
    203          */
    204          

   \                                 In segment CODE, align 4, keep-with-next
    205          OS_STK *OSTaskStkInit (void (*task)(void *p_arg), void *p_arg, OS_STK *ptos, INT16U opt)
    206          {
    207              OS_STK *stk;
    208          
    209          
    210              (void)opt;                                   /* 'opt' is not used, prevent warning                 */
    211              stk       = ptos;                            /* Load stack pointer                                 */
    212          
    213                                                           /* Registers stacked as if auto-saved on exception    */
    214              *(stk)    = (INT32U)0x01000000L;             /* xPSR                                               */
   \                     OSTaskStkInit:
   \   00000000   5FF08073           MOVS     R3,#+16777216
   \   00000004   1360               STR      R3,[R2, #+0]
    215              *(--stk)  = (INT32U)task;                    /* Entry Point                                        */
   \   00000006   121F               SUBS     R2,R2,#+4
   \   00000008   1060               STR      R0,[R2, #+0]
    216              *(--stk)  = (INT32U)0xFFFFFFFEL;             /* R14 (LR) (init value will cause fault if ever used)*/
   \   0000000A   121F               SUBS     R2,R2,#+4
   \   0000000C   7FF00100           MVNS     R0,#+1
   \   00000010   1060               STR      R0,[R2, #+0]
    217              *(--stk)  = (INT32U)0x12121212L;             /* R12                                                */
   \   00000012   121F               SUBS     R2,R2,#+4
   \   00000014   5FF01230           MOVS     R0,#+303174162
   \   00000018   1060               STR      R0,[R2, #+0]
    218              *(--stk)  = (INT32U)0x03030303L;             /* R3                                                 */
   \   0000001A   121F               SUBS     R2,R2,#+4
   \   0000001C   5FF00330           MOVS     R0,#+50529027
   \   00000020   1060               STR      R0,[R2, #+0]
    219              *(--stk)  = (INT32U)0x02020202L;             /* R2                                                 */
   \   00000022   121F               SUBS     R2,R2,#+4
   \   00000024   5FF00230           MOVS     R0,#+33686018
   \   00000028   1060               STR      R0,[R2, #+0]
    220              *(--stk)  = (INT32U)0x01010101L;             /* R1                                                 */
   \   0000002A   121F               SUBS     R2,R2,#+4
   \   0000002C   4008               LSRS     R0,R0,#+1
   \   0000002E   1060               STR      R0,[R2, #+0]
    221              *(--stk)  = (INT32U)p_arg;                   /* R0 : argument                                      */
   \   00000030   121F               SUBS     R2,R2,#+4
   \   00000032   1160               STR      R1,[R2, #+0]
    222          
    223                                                           /* Remaining registers saved on process stack         */
    224              *(--stk)  = (INT32U)0x11111111L;             /* R11                                                */
   \   00000034   121F               SUBS     R2,R2,#+4
   \   00000036   5FF01130           MOVS     R0,#+286331153
   \   0000003A   1060               STR      R0,[R2, #+0]
    225              *(--stk)  = (INT32U)0x10101010L;             /* R10                                                */
   \   0000003C   121F               SUBS     R2,R2,#+4
   \   0000003E   5FF01030           MOVS     R0,#+269488144
   \   00000042   1060               STR      R0,[R2, #+0]
    226              *(--stk)  = (INT32U)0x09090909L;             /* R9                                                 */
   \   00000044   121F               SUBS     R2,R2,#+4
   \   00000046   5FF00930           MOVS     R0,#+151587081
   \   0000004A   1060               STR      R0,[R2, #+0]
    227              *(--stk)  = (INT32U)0x08080808L;             /* R8                                                 */
   \   0000004C   121F               SUBS     R2,R2,#+4
   \   0000004E   5FF00830           MOVS     R0,#+134744072
   \   00000052   1060               STR      R0,[R2, #+0]
    228              *(--stk)  = (INT32U)0x07070707L;             /* R7                                                 */
   \   00000054   121F               SUBS     R2,R2,#+4
   \   00000056   5FF00730           MOVS     R0,#+117901063
   \   0000005A   1060               STR      R0,[R2, #+0]
    229              *(--stk)  = (INT32U)0x06060606L;             /* R6                                                 */
   \   0000005C   121F               SUBS     R2,R2,#+4
   \   0000005E   5FF00630           MOVS     R0,#+101058054
   \   00000062   1060               STR      R0,[R2, #+0]
    230              *(--stk)  = (INT32U)0x05050505L;             /* R5                                                 */
   \   00000064   121F               SUBS     R2,R2,#+4
   \   00000066   5FF00530           MOVS     R0,#+84215045
   \   0000006A   1060               STR      R0,[R2, #+0]
    231              *(--stk)  = (INT32U)0x04040404L;             /* R4                                                 */
   \   0000006C   121F               SUBS     R2,R2,#+4
   \   0000006E   5FF00430           MOVS     R0,#+67372036
   \   00000072   1060               STR      R0,[R2, #+0]
    232          
    233              return (stk);
   \   00000074   1000               MOVS     R0,R2
   \   00000076   7047               BX       LR               ;; return
    234          }
    235          
    236          /*
    237          *********************************************************************************************************
    238          *                                           TASK SWITCH HOOK
    239          *
    240          * Description: This function is called when a task switch is performed.  This allows you to perform other
    241          *              operations during a context switch.
    242          *
    243          * Arguments  : none
    244          *
    245          * Note(s)    : 1) Interrupts are disabled during this call.
    246          *              2) It is assumed that the global pointer 'OSTCBHighRdy' points to the TCB of the task that
    247          *                 will be 'switched in' (i.e. the highest priority task) and, 'OSTCBCur' points to the
    248          *                 task being switched out (i.e. the preempted task).
    249          *********************************************************************************************************
    250          */
    251          #if (OS_CPU_HOOKS_EN > 0) && (OS_TASK_SW_HOOK_EN > 0)

   \                                 In segment CODE, align 4, keep-with-next
    252          void  OSTaskSwHook (void)
    253          {
   \                     OSTaskSwHook:
   \   00000000   00B5               PUSH     {LR}
    254          #if OS_APP_HOOKS_EN > 0
    255              App_TaskSwHook();
   \   00000002   ........           _BLF     App_TaskSwHook,??App_TaskSwHook??rT
    256          #endif
    257          }

⌨️ 快捷键说明

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