]>
Commit | Line | Data |
---|---|---|
e1f414b6 | 1 | /** @file\r |
2 | Declaration of internal functions for Base Memory Library.\r | |
3 | \r | |
2bfb6009 | 4 | The following BaseMemoryLib instances contain the same copy of this file:\r |
842f5579 A |
5 | BaseMemoryLib\r |
6 | BaseMemoryLibMmx\r | |
7 | BaseMemoryLibSse2\r | |
8 | BaseMemoryLibRepStr\r | |
2bfb6009 LG |
9 | BaseMemoryLibOptDxe\r |
10 | BaseMemoryLibOptPei\r | |
842f5579 A |
11 | PeiMemoryLib\r |
12 | DxeMemoryLib\r | |
13 | \r | |
e1f414b6 | 14 | Copyright (c) 2006, Intel Corporation<BR>\r |
15 | All rights reserved. This program and the accompanying materials\r | |
16 | are licensed and made available under the terms and conditions of the BSD License\r | |
17 | which accompanies this distribution. The full text of the license may be found at\r | |
18 | http://opensource.org/licenses/bsd-license.php\r | |
19 | \r | |
20 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
21 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
22 | \r | |
e1f414b6 | 23 | **/\r |
24 | \r | |
25 | #ifndef __MEM_LIB_INTERNALS__\r | |
26 | #define __MEM_LIB_INTERNALS__\r | |
27 | \r | |
f734a10a A |
28 | #include <Base.h>\r |
29 | #include <Library/BaseMemoryLib.h>\r | |
30 | #include <Library/BaseLib.h>\r | |
31 | #include <Library/DebugLib.h>\r | |
32 | \r | |
e1f414b6 | 33 | \r |
34 | /**\r | |
35 | Copy Length bytes from Source to Destination.\r | |
36 | \r | |
42eedea9 | 37 | @param DestinationBuffer Target of copy\r |
38 | @param SourceBuffer Place to copy from\r | |
e1f414b6 | 39 | @param Length Number of bytes to copy\r |
40 | \r | |
41 | @return Destination\r | |
42 | \r | |
43 | **/\r | |
44 | VOID *\r | |
45 | EFIAPI\r | |
46 | InternalMemCopyMem (\r | |
47 | OUT VOID *DestinationBuffer,\r | |
48 | IN CONST VOID *SourceBuffer,\r | |
49 | IN UINTN Length\r | |
50 | );\r | |
51 | \r | |
52 | /**\r | |
53 | Set Buffer to Value for Size bytes.\r | |
54 | \r | |
55 | @param Buffer Memory to set.\r | |
38bbd3d9 | 56 | @param Length Number of bytes to set\r |
e1f414b6 | 57 | @param Value Value of the set operation.\r |
58 | \r | |
59 | @return Buffer\r | |
60 | \r | |
61 | **/\r | |
62 | VOID *\r | |
63 | EFIAPI\r | |
64 | InternalMemSetMem (\r | |
65 | OUT VOID *Buffer,\r | |
66 | IN UINTN Length,\r | |
67 | IN UINT8 Value\r | |
68 | );\r | |
69 | \r | |
70 | /**\r | |
71 | Fills a target buffer with a 16-bit value, and returns the target buffer.\r | |
72 | \r | |
73 | @param Buffer Pointer to the target buffer to fill.\r | |
74 | @param Length Number of bytes in Buffer to fill.\r | |
75 | @param Value Value with which to fill Length bytes of Buffer.\r | |
76 | \r | |
77 | @return Buffer\r | |
78 | \r | |
79 | **/\r | |
80 | VOID *\r | |
81 | EFIAPI\r | |
82 | InternalMemSetMem16 (\r | |
83 | OUT VOID *Buffer,\r | |
84 | IN UINTN Length,\r | |
85 | IN UINT16 Value\r | |
86 | );\r | |
87 | \r | |
88 | /**\r | |
89 | Fills a target buffer with a 32-bit value, and returns the target buffer.\r | |
90 | \r | |
91 | @param Buffer Pointer to the target buffer to fill.\r | |
92 | @param Length Number of bytes in Buffer to fill.\r | |
93 | @param Value Value with which to fill Length bytes of Buffer.\r | |
94 | \r | |
95 | @return Buffer\r | |
96 | \r | |
97 | **/\r | |
98 | VOID *\r | |
99 | EFIAPI\r | |
100 | InternalMemSetMem32 (\r | |
101 | OUT VOID *Buffer,\r | |
102 | IN UINTN Length,\r | |
103 | IN UINT32 Value\r | |
104 | );\r | |
105 | \r | |
106 | /**\r | |
107 | Fills a target buffer with a 64-bit value, and returns the target buffer.\r | |
108 | \r | |
109 | @param Buffer Pointer to the target buffer to fill.\r | |
110 | @param Length Number of bytes in Buffer to fill.\r | |
111 | @param Value Value with which to fill Length bytes of Buffer.\r | |
112 | \r | |
113 | @return Buffer\r | |
114 | \r | |
115 | **/\r | |
116 | VOID *\r | |
117 | EFIAPI\r | |
118 | InternalMemSetMem64 (\r | |
119 | OUT VOID *Buffer,\r | |
120 | IN UINTN Length,\r | |
121 | IN UINT64 Value\r | |
122 | );\r | |
123 | \r | |
124 | /**\r | |
125 | Set Buffer to 0 for Size bytes.\r | |
126 | \r | |
127 | @param Buffer Memory to set.\r | |
38bbd3d9 | 128 | @param Length Number of bytes to set\r |
e1f414b6 | 129 | \r |
130 | @return Buffer\r | |
131 | \r | |
132 | **/\r | |
133 | VOID *\r | |
134 | EFIAPI\r | |
135 | InternalMemZeroMem (\r | |
136 | OUT VOID *Buffer,\r | |
137 | IN UINTN Length\r | |
138 | );\r | |
139 | \r | |
140 | /**\r | |
141 | Compares two memory buffers of a given length.\r | |
142 | \r | |
143 | @param DestinationBuffer First memory buffer\r | |
144 | @param SourceBuffer Second memory buffer\r | |
145 | @param Length Length of DestinationBuffer and SourceBuffer memory\r | |
146 | regions to compare. Must be non-zero.\r | |
147 | \r | |
d531bfee | 148 | @return 0 All Length bytes of the two buffers are identical.\r |
149 | @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first\r | |
150 | mismatched byte in DestinationBuffer.\r | |
e1f414b6 | 151 | \r |
152 | **/\r | |
153 | INTN\r | |
154 | EFIAPI\r | |
155 | InternalMemCompareMem (\r | |
156 | IN CONST VOID *DestinationBuffer,\r | |
157 | IN CONST VOID *SourceBuffer,\r | |
158 | IN UINTN Length\r | |
159 | );\r | |
160 | \r | |
161 | /**\r | |
162 | Scans a target buffer for an 8-bit value, and returns a pointer to the\r | |
163 | matching 8-bit value in the target buffer.\r | |
164 | \r | |
165 | @param Buffer Pointer to the target buffer to scan.\r | |
166 | @param Length Number of bytes in Buffer to scan. Must be non-zero.\r | |
167 | @param Value Value to search for in the target buffer.\r | |
168 | \r | |
169 | @return Pointer to the first occurrence or NULL if not found.\r | |
170 | \r | |
171 | **/\r | |
172 | CONST VOID *\r | |
173 | EFIAPI\r | |
174 | InternalMemScanMem8 (\r | |
175 | IN CONST VOID *Buffer,\r | |
176 | IN UINTN Length,\r | |
177 | IN UINT8 Value\r | |
178 | );\r | |
179 | \r | |
180 | /**\r | |
181 | Scans a target buffer for a 16-bit value, and returns a pointer to the\r | |
182 | matching 16-bit value in the target buffer.\r | |
183 | \r | |
184 | @param Buffer Pointer to the target buffer to scan.\r | |
185 | @param Length Number of bytes in Buffer to scan. Must be non-zero.\r | |
186 | @param Value Value to search for in the target buffer.\r | |
187 | \r | |
188 | @return Pointer to the first occurrence or NULL if not found.\r | |
189 | \r | |
190 | **/\r | |
191 | CONST VOID *\r | |
192 | EFIAPI\r | |
193 | InternalMemScanMem16 (\r | |
194 | IN CONST VOID *Buffer,\r | |
195 | IN UINTN Length,\r | |
196 | IN UINT16 Value\r | |
197 | );\r | |
198 | \r | |
199 | /**\r | |
200 | Scans a target buffer for a 32-bit value, and returns a pointer to the\r | |
201 | matching 32-bit value in the target buffer.\r | |
202 | \r | |
203 | @param Buffer Pointer to the target buffer to scan.\r | |
204 | @param Length Number of bytes in Buffer to scan. Must be non-zero.\r | |
205 | @param Value Value to search for in the target buffer.\r | |
206 | \r | |
207 | @return Pointer to the first occurrence or NULL if not found.\r | |
208 | \r | |
209 | **/\r | |
210 | CONST VOID *\r | |
211 | EFIAPI\r | |
212 | InternalMemScanMem32 (\r | |
213 | IN CONST VOID *Buffer,\r | |
214 | IN UINTN Length,\r | |
215 | IN UINT32 Value\r | |
216 | );\r | |
217 | \r | |
218 | /**\r | |
219 | Scans a target buffer for a 64-bit value, and returns a pointer to the\r | |
220 | matching 64-bit value in the target buffer.\r | |
221 | \r | |
222 | @param Buffer Pointer to the target buffer to scan.\r | |
223 | @param Length Number of bytes in Buffer to scan. Must be non-zero.\r | |
224 | @param Value Value to search for in the target buffer.\r | |
225 | \r | |
226 | @return Pointer to the first occurrence or NULL if not found.\r | |
227 | \r | |
228 | **/\r | |
229 | CONST VOID *\r | |
230 | EFIAPI\r | |
231 | InternalMemScanMem64 (\r | |
232 | IN CONST VOID *Buffer,\r | |
233 | IN UINTN Length,\r | |
234 | IN UINT64 Value\r | |
235 | );\r | |
236 | \r | |
237 | #endif\r |