📄 lib_mem.lst
字号:
##############################################################################
# #
# IAR ARM ANSI C/C++ Compiler V4.42A/W32 KICKSTART 13/Mar/2009 16:00:56 #
# Copyright 1999-2005 IAR Systems. All rights reserved. #
# #
# Cpu mode = thumb #
# Endian = little #
# Stack alignment = 4 #
# Source file = E:\UC_OS\Micrium\Software\uC-LIB\lib_mem.c #
# Command line = E:\UC_OS\Micrium\Software\uC-LIB\lib_mem.c -lCN #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\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\lib_mem.lst #
# Object file = E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\Flash\Obj\lib_mem.r79 #
# #
# #
##############################################################################
E:\UC_OS\Micrium\Software\uC-LIB\lib_mem.c
1 /*
2 *********************************************************************************************************
3 * uC/LIB
4 * CUSTOM LIBRARY MODULES
5 *
6 * (c) Copyright 2004-2007; Micrium, Inc.; Weston, FL
7 *
8 * All rights reserved. Protected by international copyright laws.
9 *
10 * uC/LIB is provided in source form for FREE evaluation, for educational
11 * use or peaceful research. If you plan on using uC/LIB in a commercial
12 * product you need to contact Micrium to properly license its use in your
13 * product. We provide ALL the source code for your convenience and to
14 * help you experience uC/LIB. The fact that the source code is provided
15 * does NOT mean that you can use it without paying a licensing fee.
16 *
17 * Knowledge of the source code may NOT be used to develop a similar product.
18 *
19 * Please help us continue to provide the Embedded community with the finest
20 * software available. Your honesty is greatly appreciated.
21 *********************************************************************************************************
22 */
23
24 /*
25 *********************************************************************************************************
26 *
27 * STANDARD MEMORY OPERATIONS
28 *
29 * Filename : lib_mem.c
30 * Version : V1.24
31 * Programmer(s) : ITJ
32 *********************************************************************************************************
33 * Note(s) : (1) NO compiler-supplied standard library functions are used in library or product software.
34 *
35 * (a) ALL standard library functions are implemented in the custom library modules :
36 *
37 * (1) \<Custom Library Directory>\lib*.*
38 *
39 * (2) \<Custom Library Directory>\Ports\<cpu>\<compiler>\lib*_a.*
40 *
41 * where
42 * <Custom Library Directory> directory path for custom library software
43 * <cpu> directory name for specific processor (CPU)
44 * <compiler> directory name for specific compiler
45 *
46 * (b) Product-specific library functions are implemented in individual products.
47 *********************************************************************************************************
48 */
49
50
51 /*
52 *********************************************************************************************************
53 * INCLUDE FILES
54 *********************************************************************************************************
55 */
56
57 #define LIB_MEM_MODULE
58 #include <lib_mem.h>
59
60
61 /*$PAGE*/
62 /*
63 *********************************************************************************************************
64 * LOCAL DEFINES
65 *********************************************************************************************************
66 */
67
68
69 /*
70 *********************************************************************************************************
71 * LOCAL CONSTANTS
72 *********************************************************************************************************
73 */
74
75
76 /*
77 *********************************************************************************************************
78 * LOCAL DATA TYPES
79 *********************************************************************************************************
80 */
81
82
83 /*
84 *********************************************************************************************************
85 * LOCAL TABLES
86 *********************************************************************************************************
87 */
88
89
90 /*
91 *********************************************************************************************************
92 * LOCAL GLOBAL VARIABLES
93 *********************************************************************************************************
94 */
95
96
97 /*
98 *********************************************************************************************************
99 * LOCAL FUNCTION PROTOTYPES
100 *********************************************************************************************************
101 */
102
103
104 /*
105 *********************************************************************************************************
106 * LOCAL CONFIGURATION ERRORS
107 *********************************************************************************************************
108 */
109
110
111 /*$PAGE*/
112 /*
113 *********************************************************************************************************
114 * Mem_Clr()
115 *
116 * Description : Clear data buffer (see Note #2).
117 *
118 * Argument(s) : pmem Pointer to memory buffer to clear.
119 *
120 * size Number of data buffer octets to clear.
121 *
122 * Return(s) : none.
123 *
124 * Caller(s) : various.
125 *
126 * Note(s) : (1) Null clears allowed (i.e. 0-octet size).
127 *
128 * See also 'Mem_Set() Note #1'.
129 *
130 * (2) Clear data by setting each data octet to 0.
131 *********************************************************************************************************
132 */
133
\ In segment CODE, align 4, keep-with-next
134 void Mem_Clr (void *pmem,
135 CPU_SIZE_T size)
136 {
\ Mem_Clr:
\ 00000000 00B5 PUSH {LR}
137 Mem_Set((void *)pmem,
138 (CPU_INT08U)0, /* See Note #2. */
139 (CPU_SIZE_T)size);
\ 00000002 0A00 MOVS R2,R1
\ 00000004 0021 MOVS R1,#+0
\ 00000006 ........ BL Mem_Set
140 }
\ 0000000A 00BD POP {PC} ;; return
141
142
143 /*$PAGE*/
144 /*
145 *********************************************************************************************************
146 * Mem_Set()
147 *
148 * Description : Fill data buffer with specified data octet.
149 *
150 * Argument(s) : pmem Pointer to memory buffer to fill with specified data octet.
151 *
152 * data_val Data fill octet value.
153 *
154 * size Number of data buffer octets to fill.
155 *
156 * Return(s) : none.
157 *
158 * Caller(s) : various.
159 *
160 * Note(s) : (1) Null sets allowed (i.e. 0-octet size).
161 *
162 * (2) For best CPU performance, optimized to fill data buffer using 'CPU_ALIGN'-sized data words.
163 *
164 * (a) Since many word-aligned processors REQUIRE that multi-octet words be accessed on
165 * word-aligned addresses, 'CPU_ALIGN'd words MUST be accessed on 'CPU_ALIGN'd addresses.
166 *
167 * (3) Modulo arithmetic is used to determine whether a memory buffer starts on a 'CPU_ALIGN'
168 * address boundary.
169 *
170 * Modulo arithmetic in ANSI-C REQUIREs operations performed on integer values. Thus,
171 * address values MUST be cast to an appropriately-sized integer value PRIOR to any
172 * mem_align_modulo arithmetic operation.
173 *********************************************************************************************************
174 */
175
\ In segment CODE, align 4, keep-with-next
176 void Mem_Set (void *pmem,
177 CPU_INT08U data_val,
178 CPU_SIZE_T size)
179 {
\ Mem_Set:
\ 00000000 30B5 PUSH {R4,R5,LR}
180 CPU_SIZE_T size_rem;
181 CPU_ALIGN data_align;
182 CPU_ALIGN *pmem_align;
183 CPU_INT08U *pmem_08;
184 CPU_INT08U mem_align_modulo;
185 CPU_INT08U i;
186
187
188 if (size < 1) { /* See Note #1. */
\ 00000002 002A CMP R2,#+0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -