]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/PeiMemoryLib/MemLibInternals.h
2 Declaration of internal functions for Base Memory Library.
4 Copyright (c) 2006 - 2008, 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.
13 The following BaseMemoryLib instances contain the same copy of this file:
26 #ifndef __MEM_LIB_INTERNALS__
27 #define __MEM_LIB_INTERNALS__
32 #include <Library/BaseMemoryLib.h>
33 #include <Library/PeiServicesTablePointerLib.h>
34 #include <Library/DebugLib.h>
35 #include <Library/BaseLib.h>
38 Copies a source buffer to a destination buffer, and returns the destination buffer.
40 This function wraps the gPS->CopyMem ().
42 @param DestinationBuffer Pointer to the destination buffer of the memory copy.
43 @param SourceBuffer Pointer to the source buffer of the memory copy.
44 @param Length Number of bytes to copy from SourceBuffer to DestinationBuffer.
46 @return DestinationBuffer.
52 OUT VOID
*Destination
,
53 IN CONST VOID
*Source
,
58 Fills a target buffer with a byte value, and returns the target buffer.
60 This function wraps the gPS->SetMem ().
62 @param Buffer Memory to set.
63 @param Size Number of bytes to set.
64 @param Value Value of the set operation.
78 Fills a target buffer with a 16-bit value, and returns the target buffer.
80 @param Buffer Pointer to the target buffer to fill.
81 @param Length Number of bytes in Buffer to fill.
82 @param Value Value with which to fill Length bytes of Buffer.
96 Fills a target buffer with a 32-bit value, and returns the target buffer.
98 @param Buffer Pointer to the target buffer to fill.
99 @param Length Number of bytes in Buffer to fill.
100 @param Value Value with which to fill Length bytes of Buffer.
107 InternalMemSetMem32 (
114 Fills a target buffer with a 64-bit value, and returns the target buffer.
116 @param Buffer Pointer to the target buffer to fill.
117 @param Length Number of bytes in Buffer to fill.
118 @param Value Value with which to fill Length bytes of Buffer.
125 InternalMemSetMem64 (
132 Set Buffer to 0 for Size bytes.
134 @param Buffer Memory to set.
135 @param Length Number of bytes to set
148 Compares two memory buffers of a given length.
150 @param DestinationBuffer First memory buffer
151 @param SourceBuffer Second memory buffer
152 @param Length Length of DestinationBuffer and SourceBuffer memory
153 regions to compare. Must be non-zero.
155 @return 0 All Length bytes of the two buffers are identical.
156 @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first
157 mismatched byte in DestinationBuffer.
162 InternalMemCompareMem (
163 IN CONST VOID
*DestinationBuffer
,
164 IN CONST VOID
*SourceBuffer
,
169 Scans a target buffer for an 8-bit value, and returns a pointer to the
170 matching 8-bit value in the target buffer.
172 @param Buffer Pointer to the target buffer to scan.
173 @param Length Number of bytes in Buffer to scan. Must be non-zero.
174 @param Value Value to search for in the target buffer.
176 @return Pointer to the first occurrence or NULL if not found.
181 InternalMemScanMem8 (
182 IN CONST VOID
*Buffer
,
188 Scans a target buffer for a 16-bit value, and returns a pointer to the
189 matching 16-bit value in the target buffer.
191 @param Buffer Pointer to the target buffer to scan.
192 @param Length Number of bytes in Buffer to scan. Must be non-zero.
193 @param Value Value to search for in the target buffer.
195 @return Pointer to the first occurrence or NULL if not found.
200 InternalMemScanMem16 (
201 IN CONST VOID
*Buffer
,
207 Scans a target buffer for a 32-bit value, and returns a pointer to the
208 matching 32-bit value in the target buffer.
210 @param Buffer Pointer to the target buffer to scan.
211 @param Length Number of bytes in Buffer to scan. Must be non-zero.
212 @param Value Value to search for in the target buffer.
214 @return Pointer to the first occurrence or NULL if not found.
219 InternalMemScanMem32 (
220 IN CONST VOID
*Buffer
,
226 Scans a target buffer for a 64-bit value, and returns a pointer to the
227 matching 64-bit value in the target buffer.
229 @param Buffer Pointer to the target buffer to scan.
230 @param Length Number of bytes in Buffer to scan. Must be non-zero.
231 @param Value Value to search for in the target buffer.
233 @return Pointer to the first occurrence or NULL if not found.
238 InternalMemScanMem64 (
239 IN CONST VOID
*Buffer
,