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