]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Library/BaseMemoryLibSse2/MemLibInternals.h
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibSse2 / MemLibInternals.h
... / ...
CommitLineData
1/** @file\r
2 Declaration of internal functions for Base Memory Library.\r
3\r
4 The following BaseMemoryLib instances contain the same copy of this file:\r
5 BaseMemoryLib\r
6 BaseMemoryLibMmx\r
7 BaseMemoryLibSse2\r
8 BaseMemoryLibRepStr\r
9 BaseMemoryLibOptDxe\r
10 BaseMemoryLibOptPei\r
11\r
12 Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
13 SPDX-License-Identifier: BSD-2-Clause-Patent\r
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
25/**\r
26 Copy Length bytes from Source to Destination.\r
27\r
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
31\r
32 @return Destination\r
33\r
34**/\r
35VOID *\r
36EFIAPI\r
37InternalMemCopyMem (\r
38 OUT VOID *DestinationBuffer,\r
39 IN CONST VOID *SourceBuffer,\r
40 IN UINTN Length\r
41 );\r
42\r
43/**\r
44 Set Buffer to Value for Size bytes.\r
45\r
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
49\r
50 @return Buffer\r
51\r
52**/\r
53VOID *\r
54EFIAPI\r
55InternalMemSetMem (\r
56 OUT VOID *Buffer,\r
57 IN UINTN Length,\r
58 IN UINT8 Value\r
59 );\r
60\r
61/**\r
62 Fills a target buffer with a 16-bit value, and returns the target buffer.\r
63\r
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
67\r
68 @return Buffer\r
69\r
70**/\r
71VOID *\r
72EFIAPI\r
73InternalMemSetMem16 (\r
74 OUT VOID *Buffer,\r
75 IN UINTN Length,\r
76 IN UINT16 Value\r
77 );\r
78\r
79/**\r
80 Fills a target buffer with a 32-bit value, and returns the target buffer.\r
81\r
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
85\r
86 @return Buffer\r
87\r
88**/\r
89VOID *\r
90EFIAPI\r
91InternalMemSetMem32 (\r
92 OUT VOID *Buffer,\r
93 IN UINTN Length,\r
94 IN UINT32 Value\r
95 );\r
96\r
97/**\r
98 Fills a target buffer with a 64-bit value, and returns the target buffer.\r
99\r
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
103\r
104 @return Buffer\r
105\r
106**/\r
107VOID *\r
108EFIAPI\r
109InternalMemSetMem64 (\r
110 OUT VOID *Buffer,\r
111 IN UINTN Length,\r
112 IN UINT64 Value\r
113 );\r
114\r
115/**\r
116 Set Buffer to 0 for Size bytes.\r
117\r
118 @param Buffer Memory to set.\r
119 @param Length The number of bytes to set\r
120\r
121 @return Buffer\r
122\r
123**/\r
124VOID *\r
125EFIAPI\r
126InternalMemZeroMem (\r
127 OUT VOID *Buffer,\r
128 IN UINTN Length\r
129 );\r
130\r
131/**\r
132 Compares two memory buffers of a given length.\r
133\r
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
137 regions to compare. Must be non-zero.\r
138\r
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
142\r
143**/\r
144INTN\r
145EFIAPI\r
146InternalMemCompareMem (\r
147 IN CONST VOID *DestinationBuffer,\r
148 IN CONST VOID *SourceBuffer,\r
149 IN UINTN Length\r
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
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
159\r
160 @return The pointer to the first occurrence or NULL if not found.\r
161\r
162**/\r
163CONST VOID *\r
164EFIAPI\r
165InternalMemScanMem8 (\r
166 IN CONST VOID *Buffer,\r
167 IN UINTN Length,\r
168 IN UINT8 Value\r
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
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
178\r
179 @return The pointer to the first occurrence or NULL if not found.\r
180\r
181**/\r
182CONST VOID *\r
183EFIAPI\r
184InternalMemScanMem16 (\r
185 IN CONST VOID *Buffer,\r
186 IN UINTN Length,\r
187 IN UINT16 Value\r
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
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
197\r
198 @return The pointer to the first occurrence or NULL if not found.\r
199\r
200**/\r
201CONST VOID *\r
202EFIAPI\r
203InternalMemScanMem32 (\r
204 IN CONST VOID *Buffer,\r
205 IN UINTN Length,\r
206 IN UINT32 Value\r
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
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
216\r
217 @return A pointer to the first occurrence or NULL if not found.\r
218\r
219**/\r
220CONST VOID *\r
221EFIAPI\r
222InternalMemScanMem64 (\r
223 IN CONST VOID *Buffer,\r
224 IN UINTN Length,\r
225 IN UINT64 Value\r
226 );\r
227\r
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
245#endif\r