📄 os_flag.lst
字号:
###############################################################################
# #
# IAR ANSI C/C++ Compiler V6.10.2.52244/W32 for ARM 07/Aug/2011 12:10:28 #
# Copyright 1999-2010 IAR Systems AB. #
# #
# Cpu mode = thumb #
# Endian = little #
# Source file = F:\stm32\我的程序\Micrium\Software\uCOS-II\Source\os_fla #
# g.c #
# Command line = F:\stm32\我的程序\Micrium\Software\uCOS-II\Source\os_fla #
# g.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_flag.lst #
# Object file = F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Flash\Obj #
# \os_flag.o #
# #
# #
###############################################################################
F:\stm32\我的程序\Micrium\Software\uCOS-II\Source\os_flag.c
1 /*
2 *********************************************************************************************************
3 * uC/OS-II
4 * The Real-Time Kernel
5 * EVENT FLAG MANAGEMENT
6 *
7 * (c) Copyright 1992-2010, Micrium, Weston, FL
8 * All Rights Reserved
9 *
10 * File : OS_FLAG.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 #if (OS_FLAG_EN > 0u) && (OS_MAX_FLAGS > 0u)
29 /*
30 *********************************************************************************************************
31 * LOCAL PROTOTYPES
32 *********************************************************************************************************
33 */
34
35 static void OS_FlagBlock(OS_FLAG_GRP *pgrp, OS_FLAG_NODE *pnode, OS_FLAGS flags, INT8U wait_type, INT32U timeout);
36 static BOOLEAN OS_FlagTaskRdy(OS_FLAG_NODE *pnode, OS_FLAGS flags_rdy);
37
38 /*$PAGE*/
39 /*
40 *********************************************************************************************************
41 * CHECK THE STATUS OF FLAGS IN AN EVENT FLAG GROUP
42 *
43 * Description: This function is called to check the status of a combination of bits to be set or cleared
44 * in an event flag group. Your application can check for ANY bit to be set/cleared or ALL
45 * bits to be set/cleared.
46 *
47 * This call does not block if the desired flags are not present.
48 *
49 * Arguments : pgrp is a pointer to the desired event flag group.
50 *
51 * flags Is a bit pattern indicating which bit(s) (i.e. flags) you wish to check.
52 * The bits you want are specified by setting the corresponding bits in
53 * 'flags'. e.g. if your application wants to wait for bits 0 and 1 then
54 * 'flags' would contain 0x03.
55 *
56 * wait_type specifies whether you want ALL bits to be set/cleared or ANY of the bits
57 * to be set/cleared.
58 * You can specify the following argument:
59 *
60 * OS_FLAG_WAIT_CLR_ALL You will check ALL bits in 'flags' to be clear (0)
61 * OS_FLAG_WAIT_CLR_ANY You will check ANY bit in 'flags' to be clear (0)
62 * OS_FLAG_WAIT_SET_ALL You will check ALL bits in 'flags' to be set (1)
63 * OS_FLAG_WAIT_SET_ANY You will check ANY bit in 'flags' to be set (1)
64 *
65 * NOTE: Add OS_FLAG_CONSUME if you want the event flag to be 'consumed' by
66 * the call. Example, to wait for any flag in a group AND then clear
67 * the flags that are present, set 'wait_type' to:
68 *
69 * OS_FLAG_WAIT_SET_ANY + OS_FLAG_CONSUME
70 *
71 * perr is a pointer to an error code and can be:
72 * OS_ERR_NONE No error
73 * OS_ERR_EVENT_TYPE You are not pointing to an event flag group
74 * OS_ERR_FLAG_WAIT_TYPE You didn't specify a proper 'wait_type' argument.
75 * OS_ERR_FLAG_INVALID_PGRP You passed a NULL pointer instead of the event flag
76 * group handle.
77 * OS_ERR_FLAG_NOT_RDY The desired flags you are waiting for are not
78 * available.
79 *
80 * Returns : The flags in the event flag group that made the task ready or, 0 if a timeout or an error
81 * occurred.
82 *
83 * Called from: Task or ISR
84 *
85 * Note(s) : 1) IMPORTANT, the behavior of this function has changed from PREVIOUS versions. The
86 * function NOW returns the flags that were ready INSTEAD of the current state of the
87 * event flags.
88 *********************************************************************************************************
89 */
90
91 #if OS_FLAG_ACCEPT_EN > 0u
\ In section .text, align 2, keep-with-next
92 OS_FLAGS OSFlagAccept (OS_FLAG_GRP *pgrp,
93 OS_FLAGS flags,
94 INT8U wait_type,
95 INT8U *perr)
96 {
\ OSFlagAccept:
\ 00000000 2DE9F84F PUSH {R3-R11,LR}
\ 00000004 0400 MOVS R4,R0
\ 00000006 0D00 MOVS R5,R1
\ 00000008 1600 MOVS R6,R2
\ 0000000A 1F00 MOVS R7,R3
97 OS_FLAGS flags_rdy;
98 INT8U result;
99 BOOLEAN consume;
100 #if OS_CRITICAL_METHOD == 3u /* Allocate storage for CPU status register */
101 OS_CPU_SR cpu_sr = 0u;
\ 0000000C 5FF0000B MOVS R11,#+0
102 #endif
103
104
105
106 #ifdef OS_SAFETY_CRITICAL
107 if (perr == (INT8U *)0) {
108 OS_SAFETY_CRITICAL_EXCEPTION();
109 return ((OS_FLAGS)0);
110 }
111 #endif
112
113 #if OS_ARG_CHK_EN > 0u
114 if (pgrp == (OS_FLAG_GRP *)0) { /* Validate 'pgrp' */
115 *perr = OS_ERR_FLAG_INVALID_PGRP;
116 return ((OS_FLAGS)0);
117 }
118 #endif
119 if (pgrp->OSFlagType != OS_EVENT_TYPE_FLAG) { /* Validate event block type */
\ 00000010 2078 LDRB R0,[R4, #+0]
\ 00000012 0528 CMP R0,#+5
\ 00000014 03D0 BEQ.N ??OSFlagAccept_0
120 *perr = OS_ERR_EVENT_TYPE;
\ 00000016 0120 MOVS R0,#+1
\ 00000018 3870 STRB R0,[R7, #+0]
121 return ((OS_FLAGS)0);
\ 0000001A 0020 MOVS R0,#+0
\ 0000001C 87E0 B.N ??OSFlagAccept_1
122 }
123 result = (INT8U)(wait_type & OS_FLAG_CONSUME);
\ ??OSFlagAccept_0:
\ 0000001E 16F08000 ANDS R0,R6,#0x80
\ 00000022 8146 MOV R9,R0
124 if (result != (INT8U)0) { /* See if we need to consume the flags */
\ 00000024 5FFA89F9 UXTB R9,R9 ;; ZeroExt R9,R9,#+24,#+24
\ 00000028 B9F1000F CMP R9,#+0
\ 0000002C 04D0 BEQ.N ??OSFlagAccept_2
125 wait_type &= ~OS_FLAG_CONSUME;
\ 0000002E 16F07F06 ANDS R6,R6,#0x7F
126 consume = OS_TRUE;
\ 00000032 0120 MOVS R0,#+1
\ 00000034 8246 MOV R10,R0
\ 00000036 01E0 B.N ??OSFlagAccept_3
127 } else {
128 consume = OS_FALSE;
\ ??OSFlagAccept_2:
\ 00000038 0020 MOVS R0,#+0
\ 0000003A 8246 MOV R10,R0
129 }
130 /*$PAGE*/
131 *perr = OS_ERR_NONE; /* Assume NO error until proven otherwise. */
\ ??OSFlagAccept_3:
\ 0000003C 0020 MOVS R0,#+0
\ 0000003E 3870 STRB R0,[R7, #+0]
132 OS_ENTER_CRITICAL();
\ 00000040 ........ BL OS_CPU_SR_Save
\ 00000044 8346 MOV R11,R0
133 switch (wait_type) {
\ 00000046 F6B2 UXTB R6,R6 ;; ZeroExt R6,R6,#+24,#+24
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -