📄 os_task.lst
字号:
##############################################################################
# #
# IAR ARM ANSI C/C++ Compiler V4.42A/W32 KICKSTART 13/Mar/2009 16:01:03 #
# Copyright 1999-2005 IAR Systems. All rights reserved. #
# #
# Cpu mode = thumb #
# Endian = little #
# Stack alignment = 4 #
# Source file = E:\UC_OS\Micrium\Software\uCOS-II\Source\os_task.c #
# Command line = E:\UC_OS\Micrium\Software\uCOS-II\Source\os_task.c #
# -lCN E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210 #
# B-EVAL\IAR\OS-Probe\Flash\List\ -o #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\Flash\Obj\ -z6 --no_unroll #
# --no_inline --no_tbaa --no_scheduling --debug #
# --cpu_mode thumb --endian little --cpu cortex-M3 #
# --stack_align 4 -e --fpu None --dlib_config #
# "C:\Program Files\IAR Systems\Embedded Workbench #
# 4.0 Kickstart\arm\LIB\dl7mptnnl8n.h" -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\ -I E:\UC_OS\Micrium\Software\EvalBoa #
# rds\ST\STM3210B-EVAL\IAR\OS-Probe\..\..\..\..\..\uco #
# s-ii\ports\arm-cortex-m3\generic\iar\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\ucos-ii\source\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uc-lib\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uc-cpu\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uc-cpu\ARM-Cortex-M3\I #
# AR\ -I E:\UC_OS\Micrium\Software\EvalBoards\ST\STM32 #
# 10B-EVAL\IAR\OS-Probe\..\..\..\..\..\cpu\st\stm32\in #
# c\ -I E:\UC_OS\Micrium\Software\EvalBoards\ST\STM321 #
# 0B-EVAL\IAR\OS-Probe\..\BSP\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Commun #
# ication\Generic\RS-232\Source\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Commun #
# ication\Generic\RS-232\Ports\ST\STM32\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Commun #
# ication\Generic\Source\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Plugin #
# s\uCOS-II\ -I "C:\Program Files\IAR #
# Systems\Embedded Workbench 4.0 Kickstart\arm\INC\" #
# List file = E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\Flash\List\os_task.lst #
# Object file = E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\Flash\Obj\os_task.r79 #
# #
# #
##############################################################################
E:\UC_OS\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-2007, Jean J. Labrosse, Weston, FL
8 * All Rights Reserved
9 *
10 * File : OS_TASK.C
11 * By : Jean J. Labrosse
12 * Version : V2.85
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 > 0
\ In segment CODE, align 4, keep-with-next
51 INT8U OSTaskChangePrio (INT8U oldprio, INT8U newprio)
52 {
\ OSTaskChangePrio:
\ 00000000 2DE9F04F PUSH {R4-R11,LR}
\ 00000004 8846 MOV R8,R1
\ 00000006 0400 MOVS R4,R0
53 #if OS_EVENT_EN
54 OS_EVENT *pevent;
55 #endif
56 OS_TCB *ptcb;
57 INT8U x;
58 INT8U y;
59 #if OS_LOWEST_PRIO <= 63
60 INT8U bitx;
61 INT8U bity;
62 #else
63 INT16U bitx;
64 INT16U bity;
65 #endif
66 INT8U y_old;
67 #if OS_CRITICAL_METHOD == 3
68 OS_CPU_SR cpu_sr = 0; /* Storage for CPU status register */
69 #endif
70
71
72
73 #if OS_ARG_CHK_EN > 0
74 if (oldprio >= OS_LOWEST_PRIO) {
\ 00000008 1F2C CMP R4,#+31
\ 0000000A 03D3 BCC.N ??OSTaskChangePrio_0
75 if (oldprio != OS_PRIO_SELF) {
\ 0000000C FF2C CMP R4,#+255
\ 0000000E 01D0 BEQ.N ??OSTaskChangePrio_0
76 return (OS_ERR_PRIO_INVALID);
\ ??OSTaskChangePrio_1:
\ 00000010 2A20 MOVS R0,#+42
\ 00000012 7FE0 B.N ??OSTaskChangePrio_2
77 }
78 }
79 if (newprio >= OS_LOWEST_PRIO) {
\ ??OSTaskChangePrio_0:
\ 00000014 4046 MOV R0,R8
\ 00000016 1F28 CMP R0,#+31
\ 00000018 FAD2 BCS.N ??OSTaskChangePrio_1
80 return (OS_ERR_PRIO_INVALID);
81 }
82 #endif
83 OS_ENTER_CRITICAL();
\ 0000001A ........ _BLF OS_CPU_SR_Save,??OS_CPU_SR_Save??rT
\ 0000001E .... LDR.N R2,??DataTable10 ;; OSTCBPrioTbl
\ 00000020 4146 MOV R1,R8
\ 00000022 12EB8101 ADDS R1,R2,R1, LSL #+2
\ 00000026 0B68 LDR R3,[R1, #+0]
\ 00000028 002B CMP R3,#+0
\ 0000002A 03D0 BEQ.N ??OSTaskChangePrio_3
84 if (OSTCBPrioTbl[newprio] != (OS_TCB *)0) { /* New priority must not already exist */
85 OS_EXIT_CRITICAL();
\ 0000002C ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rT
86 return (OS_ERR_PRIO_EXIST);
\ 00000030 2820 MOVS R0,#+40
\ 00000032 6FE0 B.N ??OSTaskChangePrio_2
87 }
88 if (oldprio == OS_PRIO_SELF) { /* See if changing self */
\ ??OSTaskChangePrio_3:
\ 00000034 FF2C CMP R4,#+255
\ 00000036 03D1 BNE.N ??OSTaskChangePrio_4
89 oldprio = OSTCBCur->OSTCBPrio; /* Yes, get priority */
\ 00000038 .... LDR.N R3,??DataTable13 ;; OSTCBCur
\ 0000003A 1B68 LDR R3,[R3, #+0]
\ 0000003C 2E33 ADDS R3,R3,#+46
\ 0000003E 1C78 LDRB R4,[R3, #+0]
\ ??OSTaskChangePrio_4:
\ 00000040 12EB8404 ADDS R4,R2,R4, LSL #+2
\ 00000044 2268 LDR R2,[R4, #+0]
\ 00000046 9146 MOV R9,R2
90 }
91 ptcb = OSTCBPrioTbl[oldprio];
92 if (ptcb == (OS_TCB *)0) { /* Does task to change exist? */
\ 00000048 002A CMP R2,#+0
\ 0000004A 03D1 BNE.N ??OSTaskChangePrio_5
93 OS_EXIT_CRITICAL(); /* No, can't change its priority! */
\ 0000004C ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rT
94 return (OS_ERR_PRIO);
\ 00000050 2920 MOVS R0,#+41
\ 00000052 5FE0 B.N ??OSTaskChangePrio_2
95 }
96 if (ptcb == OS_TCB_RESERVED) { /* Is task assigned to Mutex */
\ ??OSTaskChangePrio_5:
\ 00000054 012A CMP R2,#+1
\ 00000056 03D1 BNE.N ??OSTaskChangePrio_6
97 OS_EXIT_CRITICAL(); /* No, can't change its priority! */
\ 00000058 ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rT
98 return (OS_ERR_TASK_NOT_EXIST);
\ 0000005C 4320 MOVS R0,#+67
\ 0000005E 59E0 B.N ??OSTaskChangePrio_2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -