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