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