]>
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 - 2009, 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
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.
15 #ifndef __MEM_LIB_INTERNALS__
16 #define __MEM_LIB_INTERNALS__
20 #include <Library/BaseMemoryLib.h>
21 #include <Library/BaseLib.h>
22 #include <Library/DebugLib.h>
23 #include <Library/UefiBootServicesTableLib.h>
26 Copies a source buffer to a destination buffer, and returns the destination buffer.
28 This function wraps the gBS->CopyMem().
30 @param DestinationBuffer Pointer to the destination buffer of the memory copy.
31 @param SourceBuffer Pointer to the source buffer of the memory copy.
32 @param Length Number of bytes to copy from SourceBuffer to DestinationBuffer.
34 @return DestinationBuffer.
40 OUT VOID
*Destination
,
41 IN CONST VOID
*Source
,
46 Fills a target buffer with a byte value, and returns the target buffer.
48 This function wraps the gBS->SetMem().
50 @param Buffer Memory to set.
51 @param Size Number of bytes to set.
52 @param Value Value of the set operation.
66 Fills a target buffer with a 16-bit value, and returns the target buffer.
68 @param Buffer Pointer to the target buffer to fill.
69 @param Length Count of 16-bit value to fill.
70 @param Value Value with which to fill Length bytes of Buffer.
84 Fills a target buffer with a 32-bit value, and returns the target buffer.
86 @param Buffer Pointer to the target buffer to fill.
87 @param Length Count of 32-bit value to fill.
88 @param Value Value with which to fill Length bytes of Buffer.
102 Fills a target buffer with a 64-bit value, and returns the target buffer.
104 @param Buffer Pointer to the target buffer to fill.
105 @param Length Count of 64-bit value to fill.
106 @param Value Value with which to fill Length bytes of Buffer.
113 InternalMemSetMem64 (
120 Set Buffer to 0 for Size bytes.
122 @param Buffer Memory to set.
123 @param Length Number of bytes to set
136 Compares two memory buffers of a given length.
138 @param DestinationBuffer First memory buffer
139 @param SourceBuffer Second memory buffer
140 @param Length Length of DestinationBuffer and SourceBuffer memory
141 regions to compare. Must be non-zero.
143 @return 0 All Length bytes of the two buffers are identical.
144 @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first
145 mismatched byte in DestinationBuffer.
150 InternalMemCompareMem (
151 IN CONST VOID
*DestinationBuffer
,
152 IN CONST VOID
*SourceBuffer
,
157 Scans a target buffer for an 8-bit value, and returns a pointer to the
158 matching 8-bit value in the target buffer.
160 @param Buffer Pointer to the target buffer to scan.
161 @param Length Count of 8-bit value to scan. Must be non-zero.
162 @param Value Value to search for in the target buffer.
164 @return Pointer to the first occurrence or NULL if not found.
169 InternalMemScanMem8 (
170 IN CONST VOID
*Buffer
,
176 Scans a target buffer for a 16-bit value, and returns a pointer to the
177 matching 16-bit value in the target buffer.
179 @param Buffer Pointer to the target buffer to scan.
180 @param Length Count of 16-bit value to scan. Must be non-zero.
181 @param Value Value to search for in the target buffer.
183 @return Pointer to the first occurrence or NULL if not found.
188 InternalMemScanMem16 (
189 IN CONST VOID
*Buffer
,
195 Scans a target buffer for a 32-bit value, and returns a pointer to the
196 matching 32-bit value in the target buffer.
198 @param Buffer Pointer to the target buffer to scan.
199 @param Length Count of 32-bit value to scan. Must be non-zero.
200 @param Value Value to search for in the target buffer.
202 @return Pointer to the first occurrence or NULL if not found.
207 InternalMemScanMem32 (
208 IN CONST VOID
*Buffer
,
214 Scans a target buffer for a 64-bit value, and returns a pointer to the
215 matching 64-bit value in the target buffer.
217 @param Buffer Pointer to the target buffer to scan.
218 @param Length Count of 64-bit value to scan. Must be non-zero.
219 @param Value Value to search for in the target buffer.
221 @return Pointer to the first occurrence or NULL if not found.
226 InternalMemScanMem64 (
227 IN CONST VOID
*Buffer
,