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