]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/UefiMemoryLib/MemLibInternals.h
2 Declaration of internal functions for Base Memory Library.
4 Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef __MEM_LIB_INTERNALS__
10 #define __MEM_LIB_INTERNALS__
14 #include <Library/BaseMemoryLib.h>
15 #include <Library/BaseLib.h>
16 #include <Library/DebugLib.h>
17 #include <Library/UefiBootServicesTableLib.h>
20 Copies a source buffer to a destination buffer, and returns the destination buffer.
22 This function wraps the gBS->CopyMem().
24 @param DestinationBuffer The pointer to the destination buffer of the memory copy.
25 @param SourceBuffer The pointer to the source buffer of the memory copy.
26 @param Length The number of bytes to copy from SourceBuffer to DestinationBuffer.
28 @return DestinationBuffer.
34 OUT VOID
*Destination
,
35 IN CONST VOID
*Source
,
40 Fills a target buffer with a byte value, and returns the target buffer.
42 This function wraps the gBS->SetMem().
44 @param Buffer Memory to set.
45 @param Size The number of bytes to set.
46 @param Value Value of the set operation.
60 Fills a target buffer with a 16-bit value, and returns the target buffer.
62 @param Buffer The pointer to the target buffer to fill.
63 @param Length The count of 16-bit value to fill.
64 @param Value The value with which to fill Length bytes of Buffer.
78 Fills a target buffer with a 32-bit value, and returns the target buffer.
80 @param Buffer The pointer to the target buffer to fill.
81 @param Length The count of 32-bit value to fill.
82 @param Value The value with which to fill Length bytes of Buffer.
96 Fills a target buffer with a 64-bit value, and returns the target buffer.
98 @param Buffer The pointer to the target buffer to fill.
99 @param Length The count of 64-bit value to fill.
100 @param Value The value with which to fill Length bytes of Buffer.
107 InternalMemSetMem64 (
114 Set Buffer to 0 for Size bytes.
116 @param Buffer The memory to set.
117 @param Length The number of bytes to set
130 Compares two memory buffers of a given length.
132 @param DestinationBuffer The first memory buffer
133 @param SourceBuffer The second memory buffer
134 @param Length The length of DestinationBuffer and SourceBuffer memory
135 regions to compare. Must be non-zero.
137 @return 0 All Length bytes of the two buffers are identical.
138 @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first
139 mismatched byte in DestinationBuffer.
144 InternalMemCompareMem (
145 IN CONST VOID
*DestinationBuffer
,
146 IN CONST VOID
*SourceBuffer
,
151 Scans a target buffer for an 8-bit value, and returns a pointer to the
152 matching 8-bit value in the target buffer.
154 @param Buffer The pointer to the target buffer to scan.
155 @param Length The count of 8-bit value to scan. Must be non-zero.
156 @param Value The value to search for in the target buffer.
158 @return The pointer to the first occurrence or NULL if not found.
163 InternalMemScanMem8 (
164 IN CONST VOID
*Buffer
,
170 Scans a target buffer for a 16-bit value, and returns a pointer to the
171 matching 16-bit value in the target buffer.
173 @param Buffer The pointer to the target buffer to scan.
174 @param Length The count of 16-bit value to scan. Must be non-zero.
175 @param Value The value to search for in the target buffer.
177 @return The pointer to the first occurrence or NULL if not found.
182 InternalMemScanMem16 (
183 IN CONST VOID
*Buffer
,
189 Scans a target buffer for a 32-bit value, and returns a pointer to the
190 matching 32-bit value in the target buffer.
192 @param Buffer The pointer to the target buffer to scan.
193 @param Length The count of 32-bit value to scan. Must be non-zero.
194 @param Value The value to search for in the target buffer.
196 @return The pointer to the first occurrence or NULL if not found.
201 InternalMemScanMem32 (
202 IN CONST VOID
*Buffer
,
208 Scans a target buffer for a 64-bit value, and returns a pointer to the
209 matching 64-bit value in the target buffer.
211 @param Buffer The pointer to the target buffer to scan.
212 @param Length The count of 64-bit value to scan. Must be non-zero.
213 @param Value The value to search for in the target buffer.
215 @return The pointer to the first occurrence or NULL if not found.
220 InternalMemScanMem64 (
221 IN CONST VOID
*Buffer
,
227 Checks whether the contents of a buffer are all zeros.
229 @param Buffer The pointer to the buffer to be checked.
230 @param Length The size of the buffer (in bytes) to be checked.
232 @retval TRUE Contents of the buffer are all zeros.
233 @retval FALSE Contents of the buffer are not all zeros.
238 InternalMemIsZeroBuffer (
239 IN CONST VOID
*Buffer
,