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