]>
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 | 11 | \r |
2fc59a00 | 12 | Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r |
c33c6476 | 13 | This program and the accompanying materials\r |
e1f414b6 | 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 | |
2fc59a00 | 16 | http://opensource.org/licenses/bsd-license.php.\r |
e1f414b6 | 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 | Copy Length bytes from Source to Destination.\r | |
33 | \r | |
2fc59a00 | 34 | @param DestinationBuffer The target of the copy request.\r |
35 | @param SourceBuffer The place to copy from.\r | |
36 | @param Length The number of bytes to copy.\r | |
e1f414b6 | 37 | \r |
38 | @return Destination\r | |
39 | \r | |
40 | **/\r | |
41 | VOID *\r | |
42 | EFIAPI\r | |
43 | InternalMemCopyMem (\r | |
44 | OUT VOID *DestinationBuffer,\r | |
45 | IN CONST VOID *SourceBuffer,\r | |
46 | IN UINTN Length\r | |
47 | );\r | |
48 | \r | |
49 | /**\r | |
50 | Set Buffer to Value for Size bytes.\r | |
51 | \r | |
2fc59a00 | 52 | @param Buffer The memory to set.\r |
53 | @param Length The number of bytes to set.\r | |
54 | @param Value The value of the set operation.\r | |
e1f414b6 | 55 | \r |
56 | @return Buffer\r | |
57 | \r | |
58 | **/\r | |
59 | VOID *\r | |
60 | EFIAPI\r | |
61 | InternalMemSetMem (\r | |
62 | OUT VOID *Buffer,\r | |
63 | IN UINTN Length,\r | |
64 | IN UINT8 Value\r | |
65 | );\r | |
66 | \r | |
67 | /**\r | |
68 | Fills a target buffer with a 16-bit value, and returns the target buffer.\r | |
69 | \r | |
2fc59a00 | 70 | @param Buffer The pointer to the target buffer to fill.\r |
71 | @param Length The count of 16-bit value to fill.\r | |
72 | @param Value The value with which to fill Length bytes of Buffer.\r | |
e1f414b6 | 73 | \r |
74 | @return Buffer\r | |
75 | \r | |
76 | **/\r | |
77 | VOID *\r | |
78 | EFIAPI\r | |
79 | InternalMemSetMem16 (\r | |
80 | OUT VOID *Buffer,\r | |
81 | IN UINTN Length,\r | |
82 | IN UINT16 Value\r | |
83 | );\r | |
84 | \r | |
85 | /**\r | |
86 | Fills a target buffer with a 32-bit value, and returns the target buffer.\r | |
87 | \r | |
2fc59a00 | 88 | @param Buffer The pointer to the target buffer to fill.\r |
89 | @param Length The count of 32-bit value to fill.\r | |
90 | @param Value The value with which to fill Length bytes of Buffer.\r | |
e1f414b6 | 91 | \r |
92 | @return Buffer\r | |
93 | \r | |
94 | **/\r | |
95 | VOID *\r | |
96 | EFIAPI\r | |
97 | InternalMemSetMem32 (\r | |
98 | OUT VOID *Buffer,\r | |
99 | IN UINTN Length,\r | |
100 | IN UINT32 Value\r | |
101 | );\r | |
102 | \r | |
103 | /**\r | |
104 | Fills a target buffer with a 64-bit value, and returns the target buffer.\r | |
105 | \r | |
2fc59a00 | 106 | @param Buffer The pointer to the target buffer to fill.\r |
107 | @param Length The count of 64-bit value to fill.\r | |
108 | @param Value The value with which to fill Length bytes of Buffer.\r | |
e1f414b6 | 109 | \r |
110 | @return Buffer\r | |
111 | \r | |
112 | **/\r | |
113 | VOID *\r | |
114 | EFIAPI\r | |
115 | InternalMemSetMem64 (\r | |
116 | OUT VOID *Buffer,\r | |
117 | IN UINTN Length,\r | |
118 | IN UINT64 Value\r | |
119 | );\r | |
120 | \r | |
121 | /**\r | |
122 | Set Buffer to 0 for Size bytes.\r | |
123 | \r | |
124 | @param Buffer Memory to set.\r | |
2fc59a00 | 125 | @param Length The number of bytes to set\r |
e1f414b6 | 126 | \r |
127 | @return Buffer\r | |
128 | \r | |
129 | **/\r | |
130 | VOID *\r | |
131 | EFIAPI\r | |
132 | InternalMemZeroMem (\r | |
133 | OUT VOID *Buffer,\r | |
134 | IN UINTN Length\r | |
135 | );\r | |
136 | \r | |
137 | /**\r | |
138 | Compares two memory buffers of a given length.\r | |
139 | \r | |
2fc59a00 | 140 | @param DestinationBuffer The first memory buffer.\r |
141 | @param SourceBuffer The second memory buffer.\r | |
142 | @param Length The length of DestinationBuffer and SourceBuffer memory\r | |
e1f414b6 | 143 | regions to compare. Must be non-zero.\r |
144 | \r | |
d531bfee | 145 | @return 0 All Length bytes of the two buffers are identical.\r |
146 | @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first\r | |
147 | mismatched byte in DestinationBuffer.\r | |
e1f414b6 | 148 | \r |
149 | **/\r | |
150 | INTN\r | |
151 | EFIAPI\r | |
152 | InternalMemCompareMem (\r | |
153 | IN CONST VOID *DestinationBuffer,\r | |
154 | IN CONST VOID *SourceBuffer,\r | |
155 | IN UINTN Length\r | |
156 | );\r | |
157 | \r | |
158 | /**\r | |
159 | Scans a target buffer for an 8-bit value, and returns a pointer to the\r | |
160 | matching 8-bit value in the target buffer.\r | |
161 | \r | |
2fc59a00 | 162 | @param Buffer The pointer to the target buffer to scan.\r |
163 | @param Length The count of 8-bit value to scan. Must be non-zero.\r | |
164 | @param Value The value to search for in the target buffer.\r | |
e1f414b6 | 165 | \r |
2fc59a00 | 166 | @return The pointer to the first occurrence or NULL if not found.\r |
e1f414b6 | 167 | \r |
168 | **/\r | |
169 | CONST VOID *\r | |
170 | EFIAPI\r | |
171 | InternalMemScanMem8 (\r | |
172 | IN CONST VOID *Buffer,\r | |
173 | IN UINTN Length,\r | |
174 | IN UINT8 Value\r | |
175 | );\r | |
176 | \r | |
177 | /**\r | |
178 | Scans a target buffer for a 16-bit value, and returns a pointer to the\r | |
179 | matching 16-bit value in the target buffer.\r | |
180 | \r | |
2fc59a00 | 181 | @param Buffer The pointer to the target buffer to scan.\r |
182 | @param Length The count of 16-bit value to scan. Must be non-zero.\r | |
183 | @param Value The value to search for in the target buffer.\r | |
e1f414b6 | 184 | \r |
2fc59a00 | 185 | @return The pointer to the first occurrence or NULL if not found.\r |
e1f414b6 | 186 | \r |
187 | **/\r | |
188 | CONST VOID *\r | |
189 | EFIAPI\r | |
190 | InternalMemScanMem16 (\r | |
191 | IN CONST VOID *Buffer,\r | |
192 | IN UINTN Length,\r | |
193 | IN UINT16 Value\r | |
194 | );\r | |
195 | \r | |
196 | /**\r | |
197 | Scans a target buffer for a 32-bit value, and returns a pointer to the\r | |
198 | matching 32-bit value in the target buffer.\r | |
199 | \r | |
2fc59a00 | 200 | @param Buffer The pointer to the target buffer to scan.\r |
201 | @param Length The count of 32-bit value to scan. Must be non-zero.\r | |
202 | @param Value The value to search for in the target buffer.\r | |
e1f414b6 | 203 | \r |
2fc59a00 | 204 | @return The pointer to the first occurrence or NULL if not found.\r |
e1f414b6 | 205 | \r |
206 | **/\r | |
207 | CONST VOID *\r | |
208 | EFIAPI\r | |
209 | InternalMemScanMem32 (\r | |
210 | IN CONST VOID *Buffer,\r | |
211 | IN UINTN Length,\r | |
212 | IN UINT32 Value\r | |
213 | );\r | |
214 | \r | |
215 | /**\r | |
216 | Scans a target buffer for a 64-bit value, and returns a pointer to the\r | |
217 | matching 64-bit value in the target buffer.\r | |
218 | \r | |
2fc59a00 | 219 | @param Buffer The pointer to the target buffer to scan.\r |
220 | @param Length The count of 64-bit value to scan. Must be non-zero.\r | |
221 | @param Value The value to search for in the target buffer.\r | |
e1f414b6 | 222 | \r |
2fc59a00 | 223 | @return A pointer to the first occurrence or NULL if not found.\r |
e1f414b6 | 224 | \r |
225 | **/\r | |
226 | CONST VOID *\r | |
227 | EFIAPI\r | |
228 | InternalMemScanMem64 (\r | |
229 | IN CONST VOID *Buffer,\r | |
230 | IN UINTN Length,\r | |
231 | IN UINT64 Value\r | |
232 | );\r | |
233 | \r | |
234 | #endif\r |