]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseMemoryLibOptDxe/MemLibInternals.h
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibOptDxe / MemLibInternals.h
CommitLineData
631f060b 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
631f060b 5 BaseMemoryLib\r
6 BaseMemoryLibMmx\r
7 BaseMemoryLibSse2\r
8 BaseMemoryLibRepStr\r
2bfb6009
LG
9 BaseMemoryLibOptDxe\r
10 BaseMemoryLibOptPei\r
631f060b 11\r
02b5cf7f 12 Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
9344f092 13 SPDX-License-Identifier: BSD-2-Clause-Patent\r
631f060b 14\r
15**/\r
16\r
17#ifndef __MEM_LIB_INTERNALS__\r
18#define __MEM_LIB_INTERNALS__\r
19\r
20#include <Base.h>\r
21#include <Library/BaseMemoryLib.h>\r
22#include <Library/BaseLib.h>\r
23#include <Library/DebugLib.h>\r
24\r
631f060b 25/**\r
26 Copy Length bytes from Source to Destination.\r
27\r
2fc59a00 28 @param DestinationBuffer The target of the copy request.\r
29 @param SourceBuffer The place to copy from.\r
30 @param Length The number of bytes to copy.\r
631f060b 31\r
2fc59a00 32 @return Destination.\r
631f060b 33\r
34**/\r
35VOID *\r
36EFIAPI\r
37InternalMemCopyMem (\r
2f88bd3a
MK
38 OUT VOID *DestinationBuffer,\r
39 IN CONST VOID *SourceBuffer,\r
40 IN UINTN Length\r
631f060b 41 );\r
42\r
43/**\r
44 Set Buffer to Value for Size bytes.\r
45\r
2fc59a00 46 @param Buffer The memory to set.\r
47 @param Length The number of bytes to set.\r
48 @param Value The value of the set operation.\r
631f060b 49\r
50 @return Buffer\r
51\r
52**/\r
53VOID *\r
54EFIAPI\r
55InternalMemSetMem (\r
2f88bd3a
MK
56 OUT VOID *Buffer,\r
57 IN UINTN Length,\r
58 IN UINT8 Value\r
631f060b 59 );\r
60\r
61/**\r
62 Fills a target buffer with a 16-bit value, and returns the target buffer.\r
63\r
2fc59a00 64 @param Buffer The pointer to the target buffer to fill.\r
65 @param Length The count of 16-bit value to fill.\r
66 @param Value The value with which to fill Length bytes of Buffer.\r
631f060b 67\r
2fc59a00 68 @return Buffer.\r
631f060b 69\r
70**/\r
71VOID *\r
72EFIAPI\r
73InternalMemSetMem16 (\r
2f88bd3a
MK
74 OUT VOID *Buffer,\r
75 IN UINTN Length,\r
76 IN UINT16 Value\r
631f060b 77 );\r
78\r
79/**\r
80 Fills a target buffer with a 32-bit value, and returns the target buffer.\r
81\r
2fc59a00 82 @param Buffer The pointer to the target buffer to fill.\r
83 @param Length The count of 32-bit value to fill.\r
84 @param Value The value with which to fill Length bytes of Buffer.\r
631f060b 85\r
2fc59a00 86 @return Buffer.\r
631f060b 87\r
88**/\r
89VOID *\r
90EFIAPI\r
91InternalMemSetMem32 (\r
2f88bd3a
MK
92 OUT VOID *Buffer,\r
93 IN UINTN Length,\r
94 IN UINT32 Value\r
631f060b 95 );\r
96\r
97/**\r
98 Fills a target buffer with a 64-bit value, and returns the target buffer.\r
99\r
2fc59a00 100 @param Buffer The pointer to the target buffer to fill.\r
101 @param Length The count of 64-bit value to fill.\r
102 @param Value The value with which to fill Length bytes of Buffer.\r
631f060b 103\r
2fc59a00 104 @return Buffer.\r
631f060b 105\r
106**/\r
107VOID *\r
108EFIAPI\r
109InternalMemSetMem64 (\r
2f88bd3a
MK
110 OUT VOID *Buffer,\r
111 IN UINTN Length,\r
112 IN UINT64 Value\r
631f060b 113 );\r
114\r
115/**\r
116 Set Buffer to 0 for Size bytes.\r
117\r
2fc59a00 118 @param Buffer The memory to set.\r
119 @param Length The number of bytes to set\r
631f060b 120\r
2fc59a00 121 @return Buffer.\r
631f060b 122\r
123**/\r
124VOID *\r
125EFIAPI\r
126InternalMemZeroMem (\r
2f88bd3a
MK
127 OUT VOID *Buffer,\r
128 IN UINTN Length\r
631f060b 129 );\r
130\r
131/**\r
132 Compares two memory buffers of a given length.\r
133\r
2fc59a00 134 @param DestinationBuffer The first memory buffer.\r
135 @param SourceBuffer The second memory buffer.\r
136 @param Length The length of DestinationBuffer and SourceBuffer memory\r
631f060b 137 regions to compare. Must be non-zero.\r
138\r
d531bfee 139 @return 0 All Length bytes of the two buffers are identical.\r
140 @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first\r
141 mismatched byte in DestinationBuffer.\r
631f060b 142\r
143**/\r
144INTN\r
145EFIAPI\r
146InternalMemCompareMem (\r
2f88bd3a
MK
147 IN CONST VOID *DestinationBuffer,\r
148 IN CONST VOID *SourceBuffer,\r
149 IN UINTN Length\r
631f060b 150 );\r
151\r
152/**\r
153 Scans a target buffer for an 8-bit value, and returns a pointer to the\r
154 matching 8-bit value in the target buffer.\r
155\r
2fc59a00 156 @param Buffer The pointer to the target buffer to scan.\r
157 @param Length The count of 8-bit value to scan. Must be non-zero.\r
158 @param Value The value to search for in the target buffer.\r
631f060b 159\r
2fc59a00 160 @return The pointer to the first occurrence or NULL if not found.\r
631f060b 161\r
162**/\r
163CONST VOID *\r
164EFIAPI\r
165InternalMemScanMem8 (\r
2f88bd3a
MK
166 IN CONST VOID *Buffer,\r
167 IN UINTN Length,\r
168 IN UINT8 Value\r
631f060b 169 );\r
170\r
171/**\r
172 Scans a target buffer for a 16-bit value, and returns a pointer to the\r
173 matching 16-bit value in the target buffer.\r
174\r
2fc59a00 175 @param Buffer The pointer to the target buffer to scan.\r
176 @param Length The count of 16-bit value to scan. Must be non-zero.\r
177 @param Value The value to search for in the target buffer.\r
631f060b 178\r
2fc59a00 179 @return The pointer to the first occurrence or NULL if not found.\r
631f060b 180\r
181**/\r
182CONST VOID *\r
183EFIAPI\r
184InternalMemScanMem16 (\r
2f88bd3a
MK
185 IN CONST VOID *Buffer,\r
186 IN UINTN Length,\r
187 IN UINT16 Value\r
631f060b 188 );\r
189\r
190/**\r
191 Scans a target buffer for a 32-bit value, and returns a pointer to the\r
192 matching 32-bit value in the target buffer.\r
193\r
2fc59a00 194 @param Buffer The pointer to the target buffer to scan.\r
195 @param Length The count of 32-bit value to scan. Must be non-zero.\r
196 @param Value The value to search for in the target buffer.\r
631f060b 197\r
2fc59a00 198 @return The pointer to the first occurrence or NULL if not found.\r
631f060b 199\r
200**/\r
201CONST VOID *\r
202EFIAPI\r
203InternalMemScanMem32 (\r
2f88bd3a
MK
204 IN CONST VOID *Buffer,\r
205 IN UINTN Length,\r
206 IN UINT32 Value\r
631f060b 207 );\r
208\r
209/**\r
210 Scans a target buffer for a 64-bit value, and returns a pointer to the\r
211 matching 64-bit value in the target buffer.\r
212\r
2fc59a00 213 @param Buffer The pointer to the target buffer to scan.\r
214 @param Length The count of 64-bit value to scan. Must be non-zero.\r
215 @param Value The value to search for in the target buffer.\r
631f060b 216\r
2fc59a00 217 @return The pointer to the first occurrence or NULL if not found.\r
631f060b 218\r
219**/\r
220CONST VOID *\r
221EFIAPI\r
222InternalMemScanMem64 (\r
2f88bd3a
MK
223 IN CONST VOID *Buffer,\r
224 IN UINTN Length,\r
225 IN UINT64 Value\r
631f060b 226 );\r
227\r
02b5cf7f
HW
228/**\r
229 Checks whether the contents of a buffer are all zeros.\r
230\r
231 @param Buffer The pointer to the buffer to be checked.\r
232 @param Length The size of the buffer (in bytes) to be checked.\r
233\r
234 @retval TRUE Contents of the buffer are all zeros.\r
235 @retval FALSE Contents of the buffer are not all zeros.\r
236\r
237**/\r
238BOOLEAN\r
239EFIAPI\r
240InternalMemIsZeroBuffer (\r
241 IN CONST VOID *Buffer,\r
242 IN UINTN Length\r
243 );\r
244\r
631f060b 245#endif\r