]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseMemoryLibOptDxe/MemLibInternals.h
2 Declaration of internal functions for Base Memory Library.
4 The following BaseMemoryLib instances contain the same copy of this file:
12 Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
13 SPDX-License-Identifier: BSD-2-Clause-Patent
17 #ifndef __MEM_LIB_INTERNALS__
18 #define __MEM_LIB_INTERNALS__
21 #include <Library/BaseMemoryLib.h>
22 #include <Library/BaseLib.h>
23 #include <Library/DebugLib.h>
26 Copy Length bytes from Source to Destination.
28 @param DestinationBuffer The target of the copy request.
29 @param SourceBuffer The place to copy from.
30 @param Length The number of bytes to copy.
38 OUT VOID
*DestinationBuffer
,
39 IN CONST VOID
*SourceBuffer
,
44 Set Buffer to Value for Size bytes.
46 @param Buffer The memory to set.
47 @param Length The number of bytes to set.
48 @param Value The value of the set operation.
62 Fills a target buffer with a 16-bit value, and returns the target buffer.
64 @param Buffer The pointer to the target buffer to fill.
65 @param Length The count of 16-bit value to fill.
66 @param Value The value with which to fill Length bytes of Buffer.
80 Fills a target buffer with a 32-bit value, and returns the target buffer.
82 @param Buffer The pointer to the target buffer to fill.
83 @param Length The count of 32-bit value to fill.
84 @param Value The value with which to fill Length bytes of Buffer.
98 Fills a target buffer with a 64-bit value, and returns the target buffer.
100 @param Buffer The pointer to the target buffer to fill.
101 @param Length The count of 64-bit value to fill.
102 @param Value The value with which to fill Length bytes of Buffer.
109 InternalMemSetMem64 (
116 Set Buffer to 0 for Size bytes.
118 @param Buffer The memory to set.
119 @param Length The number of bytes to set
132 Compares two memory buffers of a given length.
134 @param DestinationBuffer The first memory buffer.
135 @param SourceBuffer The second memory buffer.
136 @param Length The length of DestinationBuffer and SourceBuffer memory
137 regions to compare. Must be non-zero.
139 @return 0 All Length bytes of the two buffers are identical.
140 @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first
141 mismatched byte in DestinationBuffer.
146 InternalMemCompareMem (
147 IN CONST VOID
*DestinationBuffer
,
148 IN CONST VOID
*SourceBuffer
,
153 Scans a target buffer for an 8-bit value, and returns a pointer to the
154 matching 8-bit value in the target buffer.
156 @param Buffer The pointer to the target buffer to scan.
157 @param Length The count of 8-bit value to scan. Must be non-zero.
158 @param Value The value to search for in the target buffer.
160 @return The pointer to the first occurrence or NULL if not found.
165 InternalMemScanMem8 (
166 IN CONST VOID
*Buffer
,
172 Scans a target buffer for a 16-bit value, and returns a pointer to the
173 matching 16-bit value in the target buffer.
175 @param Buffer The pointer to the target buffer to scan.
176 @param Length The count of 16-bit value to scan. Must be non-zero.
177 @param Value The value to search for in the target buffer.
179 @return The pointer to the first occurrence or NULL if not found.
184 InternalMemScanMem16 (
185 IN CONST VOID
*Buffer
,
191 Scans a target buffer for a 32-bit value, and returns a pointer to the
192 matching 32-bit value in the target buffer.
194 @param Buffer The pointer to the target buffer to scan.
195 @param Length The count of 32-bit value to scan. Must be non-zero.
196 @param Value The value to search for in the target buffer.
198 @return The pointer to the first occurrence or NULL if not found.
203 InternalMemScanMem32 (
204 IN CONST VOID
*Buffer
,
210 Scans a target buffer for a 64-bit value, and returns a pointer to the
211 matching 64-bit value in the target buffer.
213 @param Buffer The pointer to the target buffer to scan.
214 @param Length The count of 64-bit value to scan. Must be non-zero.
215 @param Value The value to search for in the target buffer.
217 @return The pointer to the first occurrence or NULL if not found.
222 InternalMemScanMem64 (
223 IN CONST VOID
*Buffer
,
229 Checks whether the contents of a buffer are all zeros.
231 @param Buffer The pointer to the buffer to be checked.
232 @param Length The size of the buffer (in bytes) to be checked.
234 @retval TRUE Contents of the buffer are all zeros.
235 @retval FALSE Contents of the buffer are not all zeros.
240 InternalMemIsZeroBuffer (
241 IN CONST VOID
*Buffer
,