]>
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, 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 Copy Length bytes from Source to Destination.
40 @param DestinationBuffer Target of copy
41 @param SourceBuffer Place to copy from
42 @param Length Number of bytes to copy
50 OUT VOID
*DestinationBuffer
,
51 IN CONST VOID
*SourceBuffer
,
56 Set Buffer to Value for Size bytes.
58 @param Buffer Memory to set.
59 @param Length Number of bytes to set
60 @param Value Value of the set operation.
74 Fills a target buffer with a 16-bit value, and returns the target buffer.
76 @param Buffer Pointer to the target buffer to fill.
77 @param Length Number of bytes in Buffer to fill.
78 @param Value Value with which to fill Length bytes of Buffer.
92 Fills a target buffer with a 32-bit value, and returns the target buffer.
94 @param Buffer Pointer to the target buffer to fill.
95 @param Length Number of bytes in Buffer to fill.
96 @param Value Value with which to fill Length bytes of Buffer.
103 InternalMemSetMem32 (
110 Fills a target buffer with a 64-bit value, and returns the target buffer.
112 @param Buffer Pointer to the target buffer to fill.
113 @param Length Number of bytes in Buffer to fill.
114 @param Value Value with which to fill Length bytes of Buffer.
121 InternalMemSetMem64 (
128 Set Buffer to 0 for Size bytes.
130 @param Buffer Memory to set.
131 @param Length Number of bytes to set
144 Compares two memory buffers of a given length.
146 @param DestinationBuffer First memory buffer
147 @param SourceBuffer Second memory buffer
148 @param Length Length of DestinationBuffer and SourceBuffer memory
149 regions to compare. Must be non-zero.
151 @return 0 All Length bytes of the two buffers are identical.
152 @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first
153 mismatched byte in DestinationBuffer.
158 InternalMemCompareMem (
159 IN CONST VOID
*DestinationBuffer
,
160 IN CONST VOID
*SourceBuffer
,
165 Scans a target buffer for an 8-bit value, and returns a pointer to the
166 matching 8-bit value in the target buffer.
168 @param Buffer Pointer to the target buffer to scan.
169 @param Length Number of bytes in Buffer to scan. Must be non-zero.
170 @param Value Value to search for in the target buffer.
172 @return Pointer to the first occurrence or NULL if not found.
177 InternalMemScanMem8 (
178 IN CONST VOID
*Buffer
,
184 Scans a target buffer for a 16-bit value, and returns a pointer to the
185 matching 16-bit value in the target buffer.
187 @param Buffer Pointer to the target buffer to scan.
188 @param Length Number of bytes in Buffer to scan. Must be non-zero.
189 @param Value Value to search for in the target buffer.
191 @return Pointer to the first occurrence or NULL if not found.
196 InternalMemScanMem16 (
197 IN CONST VOID
*Buffer
,
203 Scans a target buffer for a 32-bit value, and returns a pointer to the
204 matching 32-bit value in the target buffer.
206 @param Buffer Pointer to the target buffer to scan.
207 @param Length Number of bytes in Buffer to scan. Must be non-zero.
208 @param Value Value to search for in the target buffer.
210 @return Pointer to the first occurrence or NULL if not found.
215 InternalMemScanMem32 (
216 IN CONST VOID
*Buffer
,
222 Scans a target buffer for a 64-bit value, and returns a pointer to the
223 matching 64-bit value in the target buffer.
225 @param Buffer Pointer to the target buffer to scan.
226 @param Length Number of bytes in Buffer to scan. Must be non-zero.
227 @param Value Value to search for in the target buffer.
229 @return Pointer to the first occurrence or NULL if not found.
234 InternalMemScanMem64 (
235 IN CONST VOID
*Buffer
,