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