]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Library/UefiMemoryLib/MemLibInternals.h
clean up all of eight BaseMemoryLib instances in MdePkg with the following updates:
[mirror_edk2.git] / MdePkg / Library / UefiMemoryLib / MemLibInternals.h
... / ...
CommitLineData
1/** @file\r
2 Declaration of internal functions for Base Memory Library.\r
3\r
4 Copyright (c) 2006 - 2009, 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
13**/\r
14\r
15#ifndef __MEM_LIB_INTERNALS__\r
16#define __MEM_LIB_INTERNALS__\r
17\r
18#include <Uefi.h>\r
19\r
20#include <Library/BaseMemoryLib.h>\r
21#include <Library/BaseLib.h>\r
22#include <Library/DebugLib.h>\r
23#include <Library/UefiBootServicesTableLib.h>\r
24\r
25/**\r
26 Copies a source buffer to a destination buffer, and returns the destination buffer.\r
27\r
28 This function wraps the gBS->CopyMem().\r
29\r
30 @param DestinationBuffer Pointer to the destination buffer of the memory copy.\r
31 @param SourceBuffer Pointer to the source buffer of the memory copy.\r
32 @param Length Number of bytes to copy from SourceBuffer to DestinationBuffer.\r
33\r
34 @return DestinationBuffer.\r
35\r
36**/\r
37VOID *\r
38EFIAPI\r
39InternalMemCopyMem (\r
40 OUT VOID *Destination,\r
41 IN CONST VOID *Source,\r
42 IN UINTN Length\r
43 );\r
44\r
45/**\r
46 Fills a target buffer with a byte value, and returns the target buffer.\r
47\r
48 This function wraps the gBS->SetMem().\r
49\r
50 @param Buffer Memory to set.\r
51 @param Size Number of bytes to set.\r
52 @param Value Value of the set operation.\r
53\r
54 @return Buffer.\r
55\r
56**/\r
57VOID *\r
58EFIAPI\r
59InternalMemSetMem (\r
60 OUT VOID *Buffer,\r
61 IN UINTN Size,\r
62 IN UINT8 Value\r
63 );\r
64\r
65/**\r
66 Fills a target buffer with a 16-bit value, and returns the target buffer.\r
67\r
68 @param Buffer Pointer to the target buffer to fill.\r
69 @param Length Count of 16-bit value to fill.\r
70 @param Value Value with which to fill Length bytes of Buffer.\r
71\r
72 @return Buffer\r
73\r
74**/\r
75VOID *\r
76EFIAPI\r
77InternalMemSetMem16 (\r
78 OUT VOID *Buffer,\r
79 IN UINTN Length,\r
80 IN UINT16 Value\r
81 );\r
82\r
83/**\r
84 Fills a target buffer with a 32-bit value, and returns the target buffer.\r
85\r
86 @param Buffer Pointer to the target buffer to fill.\r
87 @param Length Count of 32-bit value to fill.\r
88 @param Value Value with which to fill Length bytes of Buffer.\r
89\r
90 @return Buffer\r
91\r
92**/\r
93VOID *\r
94EFIAPI\r
95InternalMemSetMem32 (\r
96 OUT VOID *Buffer,\r
97 IN UINTN Length,\r
98 IN UINT32 Value\r
99 );\r
100\r
101/**\r
102 Fills a target buffer with a 64-bit value, and returns the target buffer.\r
103\r
104 @param Buffer Pointer to the target buffer to fill.\r
105 @param Length Count of 64-bit value to fill.\r
106 @param Value Value with which to fill Length bytes of Buffer.\r
107\r
108 @return Buffer\r
109\r
110**/\r
111VOID *\r
112EFIAPI\r
113InternalMemSetMem64 (\r
114 OUT VOID *Buffer,\r
115 IN UINTN Length,\r
116 IN UINT64 Value\r
117 );\r
118\r
119/**\r
120 Set Buffer to 0 for Size bytes.\r
121\r
122 @param Buffer Memory to set.\r
123 @param Length Number of bytes to set\r
124\r
125 @return Buffer\r
126\r
127**/\r
128VOID *\r
129EFIAPI\r
130InternalMemZeroMem (\r
131 OUT VOID *Buffer,\r
132 IN UINTN Length\r
133 );\r
134\r
135/**\r
136 Compares two memory buffers of a given length.\r
137\r
138 @param DestinationBuffer First memory buffer\r
139 @param SourceBuffer Second memory buffer\r
140 @param Length Length of DestinationBuffer and SourceBuffer memory\r
141 regions to compare. Must be non-zero.\r
142\r
143 @return 0 All Length bytes of the two buffers are identical.\r
144 @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first\r
145 mismatched byte in DestinationBuffer.\r
146\r
147**/\r
148INTN\r
149EFIAPI\r
150InternalMemCompareMem (\r
151 IN CONST VOID *DestinationBuffer,\r
152 IN CONST VOID *SourceBuffer,\r
153 IN UINTN Length\r
154 );\r
155\r
156/**\r
157 Scans a target buffer for an 8-bit value, and returns a pointer to the\r
158 matching 8-bit value in the target buffer.\r
159\r
160 @param Buffer Pointer to the target buffer to scan.\r
161 @param Length Count of 8-bit value to scan. Must be non-zero.\r
162 @param Value Value to search for in the target buffer.\r
163\r
164 @return Pointer to the first occurrence or NULL if not found.\r
165\r
166**/\r
167CONST VOID *\r
168EFIAPI\r
169InternalMemScanMem8 (\r
170 IN CONST VOID *Buffer,\r
171 IN UINTN Length,\r
172 IN UINT8 Value\r
173 );\r
174\r
175/**\r
176 Scans a target buffer for a 16-bit value, and returns a pointer to the\r
177 matching 16-bit value in the target buffer.\r
178\r
179 @param Buffer Pointer to the target buffer to scan.\r
180 @param Length Count of 16-bit value to scan. Must be non-zero.\r
181 @param Value Value to search for in the target buffer.\r
182\r
183 @return Pointer to the first occurrence or NULL if not found.\r
184\r
185**/\r
186CONST VOID *\r
187EFIAPI\r
188InternalMemScanMem16 (\r
189 IN CONST VOID *Buffer,\r
190 IN UINTN Length,\r
191 IN UINT16 Value\r
192 );\r
193\r
194/**\r
195 Scans a target buffer for a 32-bit value, and returns a pointer to the\r
196 matching 32-bit value in the target buffer.\r
197\r
198 @param Buffer Pointer to the target buffer to scan.\r
199 @param Length Count of 32-bit value to scan. Must be non-zero.\r
200 @param Value Value to search for in the target buffer.\r
201\r
202 @return Pointer to the first occurrence or NULL if not found.\r
203\r
204**/\r
205CONST VOID *\r
206EFIAPI\r
207InternalMemScanMem32 (\r
208 IN CONST VOID *Buffer,\r
209 IN UINTN Length,\r
210 IN UINT32 Value\r
211 );\r
212\r
213/**\r
214 Scans a target buffer for a 64-bit value, and returns a pointer to the\r
215 matching 64-bit value in the target buffer.\r
216\r
217 @param Buffer Pointer to the target buffer to scan.\r
218 @param Length Count of 64-bit value to scan. Must be non-zero.\r
219 @param Value Value to search for in the target buffer.\r
220\r
221 @return Pointer to the first occurrence or NULL if not found.\r
222\r
223**/\r
224CONST VOID *\r
225EFIAPI\r
226InternalMemScanMem64 (\r
227 IN CONST VOID *Buffer,\r
228 IN UINTN Length,\r
229 IN UINT64 Value\r
230 );\r
231\r
232#endif\r