]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseMemoryLib/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 This program and the accompanying materials
14 are licensed and made available under the terms and conditions of the BSD License
15 which accompanies this distribution. The full text of the license may be found at
16 http://opensource.org/licenses/bsd-license.php.
18 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
19 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
23 #ifndef __MEM_LIB_INTERNALS__
24 #define __MEM_LIB_INTERNALS__
27 #include <Library/BaseMemoryLib.h>
28 #include <Library/BaseLib.h>
29 #include <Library/DebugLib.h>
32 Copy Length bytes from Source to Destination.
34 @param DestinationBuffer Target of copy
35 @param SourceBuffer Place to copy from
36 @param Length The number of bytes to copy
44 OUT VOID
*DestinationBuffer
,
45 IN CONST VOID
*SourceBuffer
,
50 Set Buffer to Value for Size bytes.
52 @param Buffer The memory to set.
53 @param Length The number of bytes to set
54 @param Value The value of the set operation.
68 Fills a target buffer with a 16-bit value, and returns the target buffer.
70 @param Buffer The pointer to the target buffer to fill.
71 @param Length The count of 16-bit value to fill.
72 @param Value The value with which to fill Length bytes of Buffer.
86 Fills a target buffer with a 32-bit value, and returns the target buffer.
88 @param Buffer The pointer to the target buffer to fill.
89 @param Length The count of 32-bit value to fill.
90 @param Value The value with which to fill Length bytes of Buffer.
104 Fills a target buffer with a 64-bit value, and returns the target buffer.
106 @param Buffer The pointer to the target buffer to fill.
107 @param Length The count of 64-bit value to fill.
108 @param Value The value with which to fill Length bytes of Buffer.
115 InternalMemSetMem64 (
122 Set Buffer to 0 for Size bytes.
124 @param Buffer The memory to set.
125 @param Length The number of bytes to set.
138 Compares two memory buffers of a given length.
140 @param DestinationBuffer The first memory buffer.
141 @param SourceBuffer The second memory buffer.
142 @param Length The length of DestinationBuffer and SourceBuffer memory
143 regions to compare. Must be non-zero.
145 @return 0 All Length bytes of the two buffers are identical.
146 @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first
147 mismatched byte in DestinationBuffer.
152 InternalMemCompareMem (
153 IN CONST VOID
*DestinationBuffer
,
154 IN CONST VOID
*SourceBuffer
,
159 Scans a target buffer for an 8-bit value, and returns a pointer to the
160 matching 8-bit value in the target buffer.
162 @param Buffer The pointer to the target buffer to scan.
163 @param Length The count of 8-bit value to scan. Must be non-zero.
164 @param Value The value to search for in the target buffer.
166 @return The pointer to the first occurrence, or NULL if not found.
171 InternalMemScanMem8 (
172 IN CONST VOID
*Buffer
,
178 Scans a target buffer for a 16-bit value, and returns a pointer to the
179 matching 16-bit value in the target buffer.
181 @param Buffer The pointer to the target buffer to scan.
182 @param Length The count of 16-bit value to scan. Must be non-zero.
183 @param Value The value to search for in the target buffer.
185 @return The pointer to the first occurrence, or NULL if not found.
190 InternalMemScanMem16 (
191 IN CONST VOID
*Buffer
,
197 Scans a target buffer for a 32-bit value, and returns a pointer to the
198 matching 32-bit value in the target buffer.
200 @param Buffer The pointer to the target buffer to scan.
201 @param Length The count of 32-bit value to scan. Must be non-zero.
202 @param Value The value to search for in the target buffer.
204 @return The pointer to the first occurrence, or NULL if not found.
209 InternalMemScanMem32 (
210 IN CONST VOID
*Buffer
,
216 Scans a target buffer for a 64-bit value, and returns a pointer to the
217 matching 64-bit value in the target buffer.
219 @param Buffer The pointer to the target buffer to scan.
220 @param Length The count of 64-bit value to scan. Must be non-zero.
221 @param Value The calue to search for in the target buffer.
223 @return The pointer to the first occurrence, or NULL if not found.
228 InternalMemScanMem64 (
229 IN CONST VOID
*Buffer
,
235 Checks whether the contents of a buffer are all zeros.
237 @param Buffer The pointer to the buffer to be checked.
238 @param Length The size of the buffer (in bytes) to be checked.
240 @retval TRUE Contents of the buffer are all zeros.
241 @retval FALSE Contents of the buffer are not all zeros.
246 InternalMemIsZeroBuffer (
247 IN CONST VOID
*Buffer
,