📄 os_mbox.lst
字号:
##############################################################################
# #
# IAR ARM ANSI C/C++ Compiler V4.42A/W32 KICKSTART 10/Jan/2008 14:56: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_mbox.c #
# Command line = D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
# \uCOS-II\Source\os_mbox.c -lCN #
# D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
# \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\RAM\List\ -o #
# D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
# \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\RAM\Obj\ -z2 #
# --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\..\..\..\..\..\uc-lib\ -I #
# D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
# \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\..\..\..\..\. #
# .\uc-cpu\ -I D:\work\资料\嵌入式操作系统\UCOS-II\Mic #
# rium\Software\EvalBoards\NXP\LPC2468-EA\IAR\OS-View\ #
# ..\..\..\..\..\uc-cpu\arm\IAR\ -I #
# D:\work\资料\嵌入式操作系统\UCOS-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\RAM\List\os_m #
# box.lst #
# Object file = D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
# \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\RAM\Obj\os_mb #
# ox.r79 #
# #
# #
##############################################################################
D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software\uCOS-II\Source\os_mbox.c
1 /*
2 *********************************************************************************************************
3 * uC/OS-II
4 * The Real-Time Kernel
5 * MESSAGE MAILBOX MANAGEMENT
6 *
7 * (c) Copyright 1992-2007, Jean J. Labrosse, Weston, FL
8 * All Rights Reserved
9 *
10 * File : OS_MBOX.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 #if OS_MBOX_EN > 0
29 /*
30 *********************************************************************************************************
31 * ACCEPT MESSAGE FROM MAILBOX
32 *
33 * Description: This function checks the mailbox to see if a message is available. Unlike OSMboxPend(),
34 * OSMboxAccept() does not suspend the calling task if a message is not available.
35 *
36 * Arguments : pevent is a pointer to the event control block
37 *
38 * Returns : != (void *)0 is the message in the mailbox if one is available. The mailbox is cleared
39 * so the next time OSMboxAccept() is called, the mailbox will be empty.
40 * == (void *)0 if the mailbox is empty or,
41 * if 'pevent' is a NULL pointer or,
42 * if you didn't pass the proper event pointer.
43 *********************************************************************************************************
44 */
45
46 #if OS_MBOX_ACCEPT_EN > 0
\ In segment CODE, align 4, keep-with-next
47 void *OSMboxAccept (OS_EVENT *pevent)
48 {
\ OSMboxAccept:
\ 00000000 70402DE9 PUSH {R4-R6,LR}
\ 00000004 0040B0E1 MOVS R4,R0
49 void *msg;
50 #if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status register */
51 OS_CPU_SR cpu_sr = 0;
\ 00000008 0000A0E3 MOV R0,#+0
\ 0000000C 0060B0E1 MOVS R6,R0
52 #endif
53
54
55
56 #if OS_ARG_CHK_EN > 0
57 if (pevent == (OS_EVENT *)0) { /* Validate 'pevent' */
\ 00000010 000054E3 CMP R4,#+0
\ 00000014 0100001A BNE ??OSMboxAccept_0
58 return ((void *)0);
\ 00000018 0000A0E3 MOV R0,#+0
\ 0000001C 0D0000EA B ??OSMboxAccept_1
59 }
60 #endif
61 if (pevent->OSEventType != OS_EVENT_TYPE_MBOX) { /* Validate event block type */
\ ??OSMboxAccept_0:
\ 00000020 0000D4E5 LDRB R0,[R4, #+0]
\ 00000024 010050E3 CMP R0,#+1
\ 00000028 0100000A BEQ ??OSMboxAccept_2
62 return ((void *)0);
\ 0000002C 0000A0E3 MOV R0,#+0
\ 00000030 080000EA B ??OSMboxAccept_1
63 }
64 OS_ENTER_CRITICAL();
\ ??OSMboxAccept_2:
\ 00000034 ........ _BLF OS_CPU_SR_Save,??OS_CPU_SR_Save??rA
\ 00000038 0060B0E1 MOVS R6,R0
65 msg = pevent->OSEventPtr;
\ 0000003C 040094E5 LDR R0,[R4, #+4]
\ 00000040 0050B0E1 MOVS R5,R0
66 pevent->OSEventPtr = (void *)0; /* Clear the mailbox */
\ 00000044 0000A0E3 MOV R0,#+0
\ 00000048 040084E5 STR R0,[R4, #+4]
67 OS_EXIT_CRITICAL();
\ 0000004C 0600B0E1 MOVS R0,R6
\ 00000050 ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rA
68 return (msg); /* Return the message received (or NULL) */
\ 00000054 0500B0E1 MOVS R0,R5
\ ??OSMboxAccept_1:
\ 00000058 7080BDE8 POP {R4-R6,PC} ;; return
69 }
70 #endif
71 /*$PAGE*/
72 /*
73 *********************************************************************************************************
74 * CREATE A MESSAGE MAILBOX
75 *
76 * Description: This function creates a message mailbox if free event control blocks are available.
77 *
78 * Arguments : msg is a pointer to a message that you wish to deposit in the mailbox. If
79 * you set this value to the NULL pointer (i.e. (void *)0) then the mailbox
80 * will be considered empty.
81 *
82 * Returns : != (OS_EVENT *)0 is a pointer to the event control clock (OS_EVENT) associated with the
83 * created mailbox
84 * == (OS_EVENT *)0 if no event control blocks were available
85 *********************************************************************************************************
86 */
87
\ In segment CODE, align 4, keep-with-next
88 OS_EVENT *OSMboxCreate (void *msg)
89 {
\ OSMboxCreate:
\ 00000000 70402DE9 PUSH {R4-R6,LR}
\ 00000004 0040B0E1 MOVS R4,R0
90 OS_EVENT *pevent;
91 #if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status register */
92 OS_CPU_SR cpu_sr = 0;
\ 00000008 0000A0E3 MOV R0,#+0
\ 0000000C 0060B0E1 MOVS R6,R0
93 #endif
94
95
96
97 if (OSIntNesting > 0) { /* See if called from ISR ... */
\ 00000010 ........ LDR R0,??DataTable10 ;; OSIntNesting
\ 00000014 0000D0E5 LDRB R0,[R0, #+0]
\ 00000018 010050E3 CMP R0,#+1
\ 0000001C 0100003A BCC ??OSMboxCreate_0
98 return ((OS_EVENT *)0); /* ... can't CREATE from an ISR */
\ 00000020 0000A0E3 MOV R0,#+0
\ 00000024 1D0000EA B ??OSMboxCreate_1
99 }
100 OS_ENTER_CRITICAL();
\ ??OSMboxCreate_0:
\ 00000028 ........ _BLF OS_CPU_SR_Save,??OS_CPU_SR_Save??rA
\ 0000002C 0060B0E1 MOVS R6,R0
101 pevent = OSEventFreeList; /* Get next free event control block */
\ 00000030 ........ LDR R0,??DataTable9 ;; OSEventFreeList
\ 00000034 000090E5 LDR R0,[R0, #+0]
\ 00000038 0050B0E1 MOVS R5,R0
102 if (OSEventFreeList != (OS_EVENT *)0) { /* See if pool of free ECB pool was empty */
\ 0000003C ........ LDR R0,??DataTable9 ;; OSEventFreeList
\ 00000040 000090E5 LDR R0,[R0, #+0]
\ 00000044 000050E3 CMP R0,#+0
\ 00000048 0400000A BEQ ??OSMboxCreate_2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -