📄 os_task.lst
字号:
##############################################################################
# #
# IAR ARM ANSI C/C++ Compiler V4.42A/W32 KICKSTART 10/Jan/2008 16:48:30 #
# Copyright 1999-2005 IAR Systems. All rights reserved. #
# #
# Cpu mode = arm #
# Endian = little #
# Stack alignment = 4 #
# Source file = D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
# \uCOS-II\Source\os_task.c #
# Command line = D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
# \uCOS-II\Source\os_task.c -lCN #
# D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
# \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\Flash\List\ #
# -o D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Softw #
# are\EvalBoards\NXP\LPC2468-EA\IAR\OS-View\Flash\Obj\ #
# -z3 --no_cse --no_unroll --no_inline #
# --no_code_motion --no_tbaa --no_clustering #
# --no_scheduling --debug --cpu_mode arm --endian #
# little --cpu ARM7TDMI-S --stack_align 4 -e --fpu #
# None --dlib_config "C:\Program Files\IAR #
# Systems\Embedded Workbench 4.0 #
# Kickstart\arm\LIB\dl4tpannl8n.h" -I #
# D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
# \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\ -I #
# D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
# \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\..\..\..\..\. #
# .\ucos-ii\ports\arm\generic\iar\ -I #
# D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
# \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\..\..\..\..\. #
# .\ucos-ii\source\ -I D:\work\资料\嵌入式操作系统\UCO #
# S-II\Micrium\Software\EvalBoards\NXP\LPC2468-EA\IAR\ #
# OS-View\..\..\..\..\..\ucosview\source\ -I #
# D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
# \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\..\..\..\..\. #
# .\ucosview\ports\arm7\lpc2468\iar\ -I #
# D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
# \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\..\..\..\..\. #
# .\uc-lib\ -I D:\work\资料\嵌入式操作系统\UCOS-II\Mic #
# rium\Software\EvalBoards\NXP\LPC2468-EA\IAR\OS-View\ #
# ..\..\..\..\..\uc-cpu\ -I #
# D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
# \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\..\..\..\..\. #
# .\uc-cpu\arm\IAR\ -I D:\work\资料\嵌入式操作系统\UCO #
# S-II\Micrium\Software\EvalBoards\NXP\LPC2468-EA\IAR\ #
# OS-View\..\BSP\ -I "C:\Program Files\IAR #
# Systems\Embedded Workbench 4.0 Kickstart\arm\INC\" #
# List file = D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
# \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\Flash\List\os #
# _task.lst #
# Object file = D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
# \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\Flash\Obj\os_ #
# task.r79 #
# #
# #
##############################################################################
D:\work\资料\嵌入式操作系统\UCOS-II\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.84
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 F0432DE9 PUSH {R4-R9,LR}
\ 00000004 0050B0E1 MOVS R5,R0
\ 00000008 0140B0E1 MOVS R4,R1
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 */
\ 0000000C 0000A0E3 MOV R0,#+0
69 #endif
70
71
72
73 #if OS_ARG_CHK_EN > 0
74 if (oldprio >= OS_LOWEST_PRIO) {
\ 00000010 1F0055E3 CMP R5,#+31
\ 00000014 0300003A BCC ??OSTaskChangePrio_0
75 if (oldprio != OS_PRIO_SELF) {
\ 00000018 FF0055E3 CMP R5,#+255
\ 0000001C 0100000A BEQ ??OSTaskChangePrio_0
76 return (OS_ERR_PRIO_INVALID);
\ 00000020 2A00A0E3 MOV R0,#+42
\ 00000024 860000EA B ??OSTaskChangePrio_1
77 }
78 }
79 if (newprio >= OS_LOWEST_PRIO) {
\ ??OSTaskChangePrio_0:
\ 00000028 1F0054E3 CMP R4,#+31
\ 0000002C 0100003A BCC ??OSTaskChangePrio_2
80 return (OS_ERR_PRIO_INVALID);
\ 00000030 2A00A0E3 MOV R0,#+42
\ 00000034 820000EA B ??OSTaskChangePrio_1
81 }
82 #endif
83 OS_ENTER_CRITICAL();
\ ??OSTaskChangePrio_2:
\ 00000038 ........ _BLF OS_CPU_SR_Save,??OS_CPU_SR_Save??rA
84 if (OSTCBPrioTbl[newprio] != (OS_TCB *)0) { /* New priority must not already exist */
\ 0000003C 0410B0E1 MOVS R1,R4
\ 00000040 0420A0E3 MOV R2,#+4
\ 00000044 ........ LDR R3,??DataTable59 ;; OSTCBPrioTbl
\ 00000048 923121E0 MLA R1,R2,R1,R3
\ 0000004C 001091E5 LDR R1,[R1, #+0]
\ 00000050 000051E3 CMP R1,#+0
\ 00000054 0200000A BEQ ??OSTaskChangePrio_3
85 OS_EXIT_CRITICAL();
\ 00000058 ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rA
86 return (OS_ERR_PRIO_EXIST);
\ 0000005C 2800A0E3 MOV R0,#+40
\ 00000060 770000EA B ??OSTaskChangePrio_1
87 }
88 if (oldprio == OS_PRIO_SELF) { /* See if changing self */
\ ??OSTaskChangePrio_3:
\ 00000064 FF0055E3 CMP R5,#+255
\ 00000068 0200001A BNE ??OSTaskChangePrio_4
89 oldprio = OSTCBCur->OSTCBPrio; /* Yes, get priority */
\ 0000006C ........ LDR R1,??DataTable58 ;; OSTCBCur
\ 00000070 001091E5 LDR R1,[R1, #+0]
\ 00000074 2E50D1E5 LDRB R5,[R1, #+46]
90 }
91 ptcb = OSTCBPrioTbl[oldprio];
\ ??OSTaskChangePrio_4:
\ 00000078 0510B0E1 MOVS R1,R5
\ 0000007C 0420A0E3 MOV R2,#+4
\ 00000080 ........ LDR R3,??DataTable59 ;; OSTCBPrioTbl
\ 00000084 923121E0 MLA R1,R2,R1,R3
\ 00000088 001091E5 LDR R1,[R1, #+0]
92 if (ptcb == (OS_TCB *)0) { /* Does task to change exist? */
\ 0000008C 000051E3 CMP R1,#+0
\ 00000090 0200001A BNE ??OSTaskChangePrio_5
93 OS_EXIT_CRITICAL(); /* No, can't change its priority! */
\ 00000094 ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rA
94 return (OS_ERR_PRIO);
\ 00000098 2900A0E3 MOV R0,#+41
\ 0000009C 680000EA B ??OSTaskChangePrio_1
95 }
96 if (ptcb == (OS_TCB *)1) { /* Is task assigned to Mutex */
\ ??OSTaskChangePrio_5:
\ 000000A0 010051E3 CMP R1,#+1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -