]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseMemoryLibMmx/MemLibInternals.h
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibMmx / MemLibInternals.h
CommitLineData
c5ecf6c1 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
c5ecf6c1 5 BaseMemoryLib\r
6 BaseMemoryLibMmx\r
7 BaseMemoryLibSse2\r
8 BaseMemoryLibRepStr\r
2bfb6009
LG
9 BaseMemoryLibOptDxe\r
10 BaseMemoryLibOptPei\r
c5ecf6c1 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
d531bfee 14\r
c5ecf6c1 15**/\r
16\r
17#ifndef __MEM_LIB_INTERNALS__\r
18#define __MEM_LIB_INTERNALS__\r
19\r
38bbd3d9 20#include <Base.h>\r
c5ecf6c1 21#include <Library/BaseMemoryLib.h>\r
22#include <Library/BaseLib.h>\r
23#include <Library/DebugLib.h>\r
24\r
25/**\r
26 Copy Length bytes from Source to Destination.\r
27\r
15c952e7 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
c5ecf6c1 31\r
32 @return Destination\r
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
c5ecf6c1 41 );\r
42\r
43/**\r
44 Set Buffer to Value for Size bytes.\r
45\r
15c952e7 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
c5ecf6c1 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
c5ecf6c1 59 );\r
60\r
61/**\r
62 Fills a target buffer with a 16-bit value, and returns the target buffer.\r
63\r
15c952e7 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
c5ecf6c1 67\r
68 @return Buffer\r
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
c5ecf6c1 77 );\r
78\r
79/**\r
80 Fills a target buffer with a 32-bit value, and returns the target buffer.\r
81\r
15c952e7 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
c5ecf6c1 85\r
86 @return Buffer\r
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
c5ecf6c1 95 );\r
96\r
97/**\r
98 Fills a target buffer with a 64-bit value, and returns the target buffer.\r
99\r
00b7cc0f 100 @param Buffer The pointer to the target buffer to fill.\r
15c952e7 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
c5ecf6c1 103\r
104 @return Buffer\r
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
c5ecf6c1 113 );\r
114\r
115/**\r
116 Set Buffer to 0 for Size bytes.\r
117\r
15c952e7 118 @param Buffer The memory to set.\r
119 @param Length The number of bytes to set.\r
c5ecf6c1 120\r
121 @return Buffer\r
122\r
123**/\r
124VOID *\r
125EFIAPI\r
126InternalMemZeroMem (\r
2f88bd3a
MK
127 OUT VOID *Buffer,\r
128 IN UINTN Length\r
c5ecf6c1 129 );\r
130\r
131/**\r
132 Compares two memory buffers of a given length.\r
133\r
15c952e7 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
c5ecf6c1 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
c5ecf6c1 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
c5ecf6c1 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
15c952e7 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
c5ecf6c1 159\r
15c952e7 160 @return The pointer to the first occurrence or NULL if not found.\r
c5ecf6c1 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
c5ecf6c1 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
15c952e7 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
c5ecf6c1 178\r
15c952e7 179 @return The pointer to the first occurrence or NULL if not found.\r
c5ecf6c1 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
c5ecf6c1 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
15c952e7 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
c5ecf6c1 197\r
15c952e7 198 @return The pointer to the first occurrence or NULL if not found.\r
c5ecf6c1 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
c5ecf6c1 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
15c952e7 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
c5ecf6c1 216\r
15c952e7 217 @return The pointer to the first occurrence or NULL if not found.\r
c5ecf6c1 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
c5ecf6c1 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
c5ecf6c1 245#endif\r