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

📄 os_task.lst

📁 stm32+ucos-ii
💻 LST
📖 第 1 页 / 共 5 页
字号:
###############################################################################
#                                                                             #
# IAR ANSI C/C++ Compiler V6.10.2.52244/W32 for ARM     07/Aug/2011  12:10:30 #
# Copyright 1999-2010 IAR Systems AB.                                         #
#                                                                             #
#    Cpu mode     =  thumb                                                    #
#    Endian       =  little                                                   #
#    Source file  =  F:\stm32\我的程序\Micrium\Software\uCOS-II\Source\os_tas #
#                    k.c                                                      #
#    Command line =  F:\stm32\我的程序\Micrium\Software\uCOS-II\Source\os_tas #
#                    k.c -D USE_STDPERIPH_DRIVER -D STM32F10X_CL -lCN         #
#                    F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Flash\Lis #
#                    t\ -o F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Fla #
#                    sh\Obj\ --no_cse --no_unroll --no_inline                 #
#                    --no_code_motion --no_tbaa --no_clustering               #
#                    --no_scheduling --debug --endian=little --cpu=Cortex-M3  #
#                    -e --fpu=None --dlib_config                              #
#                    D:\arm\INC\c\DLib_Config_Normal.h -I                     #
#                    F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\APP\ -I   #
#                    F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\   #
#                    -I F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP #
#                    \ST\CMSIS\CM3\CoreSupport\ -I                            #
#                    F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\ST #
#                    \CMSIS\CM3\DeviceSupport\ST\STM32F10x\ -I                #
#                    F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\ST #
#                    \STM32F10x_StdPeriph_Driver\inc\ -I                      #
#                    F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\uC #
#                    OS-II\ -I F:\stm32\我的程序\Micrium\Software\EWARM\OS-II #
#                    \..\..\uCOS-II\Ports\ARM-Cortex-M3\Generic\IAR\ -I       #
#                    F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\..\uCO #
#                    S-II\Source\ -I F:\stm32\我的程序\Micrium\Software\EWARM #
#                    \OS-II\..\..\uC-LIB\ -I F:\stm32\我的程序\Micrium\Softwa #
#                    re\EWARM\OS-II\..\..\uC-LIB\Ports\ARM-Cortex-M3\IAR\ -I  #
#                    F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\..\uC- #
#                    CPU\ -I F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\. #
#                    .\..\uC-CPU\ARM-Cortex-M3\IAR\ -On --use_c++_inline      #
#    List file    =  F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Flash\Lis #
#                    t\os_task.lst                                            #
#    Object file  =  F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Flash\Obj #
#                    \os_task.o                                               #
#                                                                             #
#                                                                             #
###############################################################################

F:\stm32\我的程序\Micrium\Software\uCOS-II\Source\os_task.c
      1          /*
      2          *********************************************************************************************************
      3          *                                                uC/OS-II
      4          *                                          The Real-Time Kernel
      5          *                                            TASK MANAGEMENT
      6          *
      7          *                              (c) Copyright 1992-2010, Micrium, Weston, FL
      8          *                                           All Rights Reserved
      9          *
     10          * File    : OS_TASK.C
     11          * By      : Jean J. Labrosse
     12          * Version : V2.92
     13          *
     14          * LICENSING TERMS:
     15          * ---------------
     16          *   uC/OS-II is provided in source form for FREE evaluation, for educational use or for peaceful research.
     17          * If you plan on using  uC/OS-II  in a commercial product you need to contact Micri祄 to properly license
     18          * its use in your product. We provide ALL the source code for your convenience and to help you experience
     19          * uC/OS-II.   The fact that the  source is provided does  NOT  mean that you can use it without  paying a
     20          * licensing fee.
     21          *********************************************************************************************************
     22          */
     23          
     24          #ifndef  OS_MASTER_FILE
     25          #include <ucos_ii.h>
     26          #endif
     27          
     28          /*$PAGE*/
     29          /*
     30          *********************************************************************************************************
     31          *                                        CHANGE PRIORITY OF A TASK
     32          *
     33          * Description: This function allows you to change the priority of a task dynamically.  Note that the new
     34          *              priority MUST be available.
     35          *
     36          * Arguments  : oldp     is the old priority
     37          *
     38          *              newp     is the new priority
     39          *
     40          * Returns    : OS_ERR_NONE            is the call was successful
     41          *              OS_ERR_PRIO_INVALID    if the priority you specify is higher that the maximum allowed
     42          *                                     (i.e. >= OS_LOWEST_PRIO)
     43          *              OS_ERR_PRIO_EXIST      if the new priority already exist.
     44          *              OS_ERR_PRIO            there is no task with the specified OLD priority (i.e. the OLD task does
     45          *                                     not exist.
     46          *              OS_ERR_TASK_NOT_EXIST  if the task is assigned to a Mutex PIP.
     47          *********************************************************************************************************
     48          */
     49          
     50          #if OS_TASK_CHANGE_PRIO_EN > 0u

   \                                 In section .text, align 2, keep-with-next
     51          INT8U  OSTaskChangePrio (INT8U  oldprio,
     52                                   INT8U  newprio)
     53          {
   \                     OSTaskChangePrio:
   \   00000000   2DE9F14F           PUSH     {R0,R4-R11,LR}
   \   00000004   82B0               SUB      SP,SP,#+8
   \   00000006   0C00               MOVS     R4,R1
     54          #if (OS_EVENT_EN)
     55              OS_EVENT  *pevent;
     56          #if (OS_EVENT_MULTI_EN > 0u)
     57              OS_EVENT **pevents;
     58          #endif
     59          #endif
     60              OS_TCB    *ptcb;
     61              INT8U      y_new;
     62              INT8U      x_new;
     63              INT8U      y_old;
     64              OS_PRIO    bity_new;
     65              OS_PRIO    bitx_new;
     66              OS_PRIO    bity_old;
     67              OS_PRIO    bitx_old;
     68          #if OS_CRITICAL_METHOD == 3u
     69              OS_CPU_SR  cpu_sr = 0u;                                 /* Storage for CPU status register         */
   \   00000008   5FF0000B           MOVS     R11,#+0
     70          #endif
     71          
     72          
     73          /*$PAGE*/
     74          #if OS_ARG_CHK_EN > 0u
     75              if (oldprio >= OS_LOWEST_PRIO) {
     76                  if (oldprio != OS_PRIO_SELF) {
     77                      return (OS_ERR_PRIO_INVALID);
     78                  }
     79              }
     80              if (newprio >= OS_LOWEST_PRIO) {
     81                  return (OS_ERR_PRIO_INVALID);
     82              }
     83          #endif
     84              OS_ENTER_CRITICAL();
   \   0000000C   ........           BL       OS_CPU_SR_Save
   \   00000010   8346               MOV      R11,R0
     85              if (OSTCBPrioTbl[newprio] != (OS_TCB *)0) {             /* New priority must not already exist     */
   \   00000012   E4B2               UXTB     R4,R4            ;; ZeroExt  R4,R4,#+24,#+24
   \   00000014   ........           LDR.W    R0,??DataTable14
   \   00000018   50F82400           LDR      R0,[R0, R4, LSL #+2]
   \   0000001C   0028               CMP      R0,#+0
   \   0000001E   04D0               BEQ.N    ??OSTaskChangePrio_0
     86                  OS_EXIT_CRITICAL();
   \   00000020   5846               MOV      R0,R11
   \   00000022   ........           BL       OS_CPU_SR_Restore
     87                  return (OS_ERR_PRIO_EXIST);
   \   00000026   2820               MOVS     R0,#+40
   \   00000028   0BE1               B.N      ??OSTaskChangePrio_1
     88              }
     89              if (oldprio == OS_PRIO_SELF) {                          /* See if changing self                    */
   \                     ??OSTaskChangePrio_0:
   \   0000002A   9DF80800           LDRB     R0,[SP, #+8]
   \   0000002E   FF28               CMP      R0,#+255
   \   00000030   06D1               BNE.N    ??OSTaskChangePrio_2
     90                  oldprio = OSTCBCur->OSTCBPrio;                      /* Yes, get priority                       */
   \   00000032   ........           LDR.W    R0,??DataTable14_1
   \   00000036   0068               LDR      R0,[R0, #+0]
   \   00000038   90F83600           LDRB     R0,[R0, #+54]
   \   0000003C   8DF80800           STRB     R0,[SP, #+8]
     91              }
     92              ptcb = OSTCBPrioTbl[oldprio];
   \                     ??OSTaskChangePrio_2:
   \   00000040   9DF80800           LDRB     R0,[SP, #+8]
   \   00000044   ........           LDR.W    R1,??DataTable14
   \   00000048   51F82000           LDR      R0,[R1, R0, LSL #+2]
   \   0000004C   0700               MOVS     R7,R0
     93              if (ptcb == (OS_TCB *)0) {                              /* Does task to change exist?              */
   \   0000004E   002F               CMP      R7,#+0
   \   00000050   04D1               BNE.N    ??OSTaskChangePrio_3
     94                  OS_EXIT_CRITICAL();                                 /* No, can't change its priority!          */
   \   00000052   5846               MOV      R0,R11
   \   00000054   ........           BL       OS_CPU_SR_Restore
     95                  return (OS_ERR_PRIO);
   \   00000058   2920               MOVS     R0,#+41
   \   0000005A   F2E0               B.N      ??OSTaskChangePrio_1
     96              }
     97              if (ptcb == OS_TCB_RESERVED) {                          /* Is task assigned to Mutex               */
   \                     ??OSTaskChangePrio_3:
   \   0000005C   012F               CMP      R7,#+1
   \   0000005E   04D1               BNE.N    ??OSTaskChangePrio_4
     98                  OS_EXIT_CRITICAL();                                 /* No, can't change its priority!          */
   \   00000060   5846               MOV      R0,R11
   \   00000062   ........           BL       OS_CPU_SR_Restore
     99                  return (OS_ERR_TASK_NOT_EXIST);
   \   00000066   4320               MOVS     R0,#+67
   \   00000068   EBE0               B.N      ??OSTaskChangePrio_1
    100              }
    101          #if OS_LOWEST_PRIO <= 63u
    102              y_new                 = (INT8U)(newprio >> 3u);         /* Yes, compute new TCB fields             */
   \                     ??OSTaskChangePrio_4:
   \   0000006A   E4B2               UXTB     R4,R4            ;; ZeroExt  R4,R4,#+24,#+24
   \   0000006C   E008               LSRS     R0,R4,#+3
   \   0000006E   8046               MOV      R8,R0
    103              x_new                 = (INT8U)(newprio & 0x07u);
   \   00000070   14F00700           ANDS     R0,R4,#0x7
   \   00000074   8DF80300           STRB     R0,[SP, #+3]
    104          #else
    105              y_new                 = (INT8U)((INT8U)(newprio >> 4u) & 0x0Fu);
    106              x_new                 = (INT8U)(newprio & 0x0Fu);
    107          #endif
    108              bity_new              = (OS_PRIO)(1uL << y_new);
   \   00000078   0120               MOVS     R0,#+1
   \   0000007A   10FA08F0           LSLS     R0,R0,R8

⌨️ 快捷键说明

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