mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-28 16:14:04 +02:00
Add SetMemN() and ScanMemN() to the BaseMemoryLib class and all BaseMemoryLib implementations
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9517 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
432cf05bcf
commit
f7753a96ba
@ -147,6 +147,33 @@ SetMem64 (
|
|||||||
IN UINT64 Value
|
IN UINT64 Value
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Fills a target buffer with a value that is size UINTN, and returns the target buffer.
|
||||||
|
|
||||||
|
This function fills Length bytes of Buffer with the UINTN sized value specified by
|
||||||
|
Value, and returns Buffer. Value is repeated every sizeof(UINTN) bytes for Length
|
||||||
|
bytes of Buffer.
|
||||||
|
|
||||||
|
If Length > 0 and Buffer is NULL, then ASSERT().
|
||||||
|
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
|
||||||
|
If Buffer is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
If Length is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
|
||||||
|
@param Buffer Pointer to the target buffer to fill.
|
||||||
|
@param Length Number of bytes in Buffer to fill.
|
||||||
|
@param Value Value with which to fill Length bytes of Buffer.
|
||||||
|
|
||||||
|
@return Buffer.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID *
|
||||||
|
EFIAPI
|
||||||
|
SetMemN (
|
||||||
|
OUT VOID *Buffer,
|
||||||
|
IN UINTN Length,
|
||||||
|
IN UINTN Value
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Fills a target buffer with zeros, and returns the target buffer.
|
Fills a target buffer with zeros, and returns the target buffer.
|
||||||
|
|
||||||
@ -312,6 +339,35 @@ ScanMem64 (
|
|||||||
IN UINT64 Value
|
IN UINT64 Value
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Scans a target buffer for a UINTN sized value, and returns a pointer to the matching
|
||||||
|
UINTN sized value in the target buffer.
|
||||||
|
|
||||||
|
This function searches target the buffer specified by Buffer and Length from the lowest
|
||||||
|
address to the highest address for a UINTN sized value that matches Value. If a match is found,
|
||||||
|
then a pointer to the matching byte in the target buffer is returned. If no match is found,
|
||||||
|
then NULL is returned. If Length is 0, then NULL is returned.
|
||||||
|
|
||||||
|
If Length > 0 and Buffer is NULL, then ASSERT().
|
||||||
|
If Buffer is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
If Length is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
|
||||||
|
|
||||||
|
@param Buffer Pointer to the target buffer to scan.
|
||||||
|
@param Length Number of bytes in Buffer to scan.
|
||||||
|
@param Value Value to search for in the target buffer.
|
||||||
|
|
||||||
|
@return A pointer to the matching byte in the target buffer or NULL otherwise.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID *
|
||||||
|
EFIAPI
|
||||||
|
ScanMemN (
|
||||||
|
IN CONST VOID *Buffer,
|
||||||
|
IN UINTN Length,
|
||||||
|
IN UINTN Value
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Copies a source GUID to a destination GUID.
|
Copies a source GUID to a destination GUID.
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/** @file
|
/** @file
|
||||||
ScanMem8() implementation.
|
ScanMem8() and ScanMemN() implementation.
|
||||||
|
|
||||||
The following BaseMemoryLib instances contain the same copy of this file:
|
The following BaseMemoryLib instances contain the same copy of this file:
|
||||||
|
|
||||||
@ -60,3 +60,39 @@ ScanMem8 (
|
|||||||
|
|
||||||
return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);
|
return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Scans a target buffer for a UINTN sized value, and returns a pointer to the matching
|
||||||
|
UINTN sized value in the target buffer.
|
||||||
|
|
||||||
|
This function searches target the buffer specified by Buffer and Length from the lowest
|
||||||
|
address to the highest address for a UINTN sized value that matches Value. If a match is found,
|
||||||
|
then a pointer to the matching byte in the target buffer is returned. If no match is found,
|
||||||
|
then NULL is returned. If Length is 0, then NULL is returned.
|
||||||
|
|
||||||
|
If Length > 0 and Buffer is NULL, then ASSERT().
|
||||||
|
If Buffer is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
If Length is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
|
||||||
|
|
||||||
|
@param Buffer Pointer to the target buffer to scan.
|
||||||
|
@param Length Number of bytes in Buffer to scan.
|
||||||
|
@param Value Value to search for in the target buffer.
|
||||||
|
|
||||||
|
@return A pointer to the matching byte in the target buffer or NULL otherwise.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID *
|
||||||
|
EFIAPI
|
||||||
|
ScanMemN (
|
||||||
|
IN CONST VOID *Buffer,
|
||||||
|
IN UINTN Length,
|
||||||
|
IN UINTN Value
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (sizeof (UINTN) == sizeof (UINT64)) {
|
||||||
|
return ScanMem64 (Buffer, Length, (UINT64)Value);
|
||||||
|
}
|
||||||
|
return ScanMem32 (Buffer, Length, (UINT32)Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/** @file
|
/** @file
|
||||||
SetMem() implementation.
|
SetMem() and SetMemN() implementation.
|
||||||
|
|
||||||
The following BaseMemoryLib instances contain the same copy of this file:
|
The following BaseMemoryLib instances contain the same copy of this file:
|
||||||
|
|
||||||
@ -55,3 +55,36 @@ SetMem (
|
|||||||
|
|
||||||
return InternalMemSetMem (Buffer, Length, Value);
|
return InternalMemSetMem (Buffer, Length, Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Fills a target buffer with a value that is size UINTN, and returns the target buffer.
|
||||||
|
|
||||||
|
This function fills Length bytes of Buffer with the UINTN sized value specified by
|
||||||
|
Value, and returns Buffer. Value is repeated every sizeof(UINTN) bytes for Length
|
||||||
|
bytes of Buffer.
|
||||||
|
|
||||||
|
If Length > 0 and Buffer is NULL, then ASSERT().
|
||||||
|
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
|
||||||
|
If Buffer is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
If Length is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
|
||||||
|
@param Buffer Pointer to the target buffer to fill.
|
||||||
|
@param Length Number of bytes in Buffer to fill.
|
||||||
|
@param Value Value with which to fill Length bytes of Buffer.
|
||||||
|
|
||||||
|
@return Buffer.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID *
|
||||||
|
EFIAPI
|
||||||
|
SetMemN (
|
||||||
|
OUT VOID *Buffer,
|
||||||
|
IN UINTN Length,
|
||||||
|
IN UINTN Value
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (sizeof (UINTN) == sizeof (UINT64)) {
|
||||||
|
return SetMem64 (Buffer, Length, (UINT64)Value);
|
||||||
|
}
|
||||||
|
return SetMem32 (Buffer, Length, (UINT32)Value);
|
||||||
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/** @file
|
/** @file
|
||||||
ScanMem8() implementation.
|
ScanMem8() and ScanMemN() implementation.
|
||||||
|
|
||||||
The following BaseMemoryLib instances contain the same copy of this file:
|
The following BaseMemoryLib instances contain the same copy of this file:
|
||||||
|
|
||||||
@ -60,3 +60,39 @@ ScanMem8 (
|
|||||||
|
|
||||||
return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);
|
return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Scans a target buffer for a UINTN sized value, and returns a pointer to the matching
|
||||||
|
UINTN sized value in the target buffer.
|
||||||
|
|
||||||
|
This function searches target the buffer specified by Buffer and Length from the lowest
|
||||||
|
address to the highest address for a UINTN sized value that matches Value. If a match is found,
|
||||||
|
then a pointer to the matching byte in the target buffer is returned. If no match is found,
|
||||||
|
then NULL is returned. If Length is 0, then NULL is returned.
|
||||||
|
|
||||||
|
If Length > 0 and Buffer is NULL, then ASSERT().
|
||||||
|
If Buffer is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
If Length is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
|
||||||
|
|
||||||
|
@param Buffer Pointer to the target buffer to scan.
|
||||||
|
@param Length Number of bytes in Buffer to scan.
|
||||||
|
@param Value Value to search for in the target buffer.
|
||||||
|
|
||||||
|
@return A pointer to the matching byte in the target buffer or NULL otherwise.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID *
|
||||||
|
EFIAPI
|
||||||
|
ScanMemN (
|
||||||
|
IN CONST VOID *Buffer,
|
||||||
|
IN UINTN Length,
|
||||||
|
IN UINTN Value
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (sizeof (UINTN) == sizeof (UINT64)) {
|
||||||
|
return ScanMem64 (Buffer, Length, (UINT64)Value);
|
||||||
|
}
|
||||||
|
return ScanMem32 (Buffer, Length, (UINT32)Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/** @file
|
/** @file
|
||||||
SetMem() implementation.
|
SetMem() and SetMemN() implementation.
|
||||||
|
|
||||||
The following BaseMemoryLib instances contain the same copy of this file:
|
The following BaseMemoryLib instances contain the same copy of this file:
|
||||||
|
|
||||||
@ -55,3 +55,36 @@ SetMem (
|
|||||||
|
|
||||||
return InternalMemSetMem (Buffer, Length, Value);
|
return InternalMemSetMem (Buffer, Length, Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Fills a target buffer with a value that is size UINTN, and returns the target buffer.
|
||||||
|
|
||||||
|
This function fills Length bytes of Buffer with the UINTN sized value specified by
|
||||||
|
Value, and returns Buffer. Value is repeated every sizeof(UINTN) bytes for Length
|
||||||
|
bytes of Buffer.
|
||||||
|
|
||||||
|
If Length > 0 and Buffer is NULL, then ASSERT().
|
||||||
|
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
|
||||||
|
If Buffer is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
If Length is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
|
||||||
|
@param Buffer Pointer to the target buffer to fill.
|
||||||
|
@param Length Number of bytes in Buffer to fill.
|
||||||
|
@param Value Value with which to fill Length bytes of Buffer.
|
||||||
|
|
||||||
|
@return Buffer.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID *
|
||||||
|
EFIAPI
|
||||||
|
SetMemN (
|
||||||
|
OUT VOID *Buffer,
|
||||||
|
IN UINTN Length,
|
||||||
|
IN UINTN Value
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (sizeof (UINTN) == sizeof (UINT64)) {
|
||||||
|
return SetMem64 (Buffer, Length, (UINT64)Value);
|
||||||
|
}
|
||||||
|
return SetMem32 (Buffer, Length, (UINT32)Value);
|
||||||
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/** @file
|
/** @file
|
||||||
ScanMem8() implementation.
|
ScanMem8() and ScanMemN() implementation.
|
||||||
|
|
||||||
The following BaseMemoryLib instances contain the same copy of this file:
|
The following BaseMemoryLib instances contain the same copy of this file:
|
||||||
|
|
||||||
@ -60,3 +60,39 @@ ScanMem8 (
|
|||||||
|
|
||||||
return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);
|
return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Scans a target buffer for a UINTN sized value, and returns a pointer to the matching
|
||||||
|
UINTN sized value in the target buffer.
|
||||||
|
|
||||||
|
This function searches target the buffer specified by Buffer and Length from the lowest
|
||||||
|
address to the highest address for a UINTN sized value that matches Value. If a match is found,
|
||||||
|
then a pointer to the matching byte in the target buffer is returned. If no match is found,
|
||||||
|
then NULL is returned. If Length is 0, then NULL is returned.
|
||||||
|
|
||||||
|
If Length > 0 and Buffer is NULL, then ASSERT().
|
||||||
|
If Buffer is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
If Length is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
|
||||||
|
|
||||||
|
@param Buffer Pointer to the target buffer to scan.
|
||||||
|
@param Length Number of bytes in Buffer to scan.
|
||||||
|
@param Value Value to search for in the target buffer.
|
||||||
|
|
||||||
|
@return A pointer to the matching byte in the target buffer or NULL otherwise.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID *
|
||||||
|
EFIAPI
|
||||||
|
ScanMemN (
|
||||||
|
IN CONST VOID *Buffer,
|
||||||
|
IN UINTN Length,
|
||||||
|
IN UINTN Value
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (sizeof (UINTN) == sizeof (UINT64)) {
|
||||||
|
return ScanMem64 (Buffer, Length, (UINT64)Value);
|
||||||
|
}
|
||||||
|
return ScanMem32 (Buffer, Length, (UINT32)Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/** @file
|
/** @file
|
||||||
SetMem() implementation.
|
SetMem() and SetMemN() implementation.
|
||||||
|
|
||||||
The following BaseMemoryLib instances contain the same copy of this file:
|
The following BaseMemoryLib instances contain the same copy of this file:
|
||||||
|
|
||||||
@ -55,3 +55,36 @@ SetMem (
|
|||||||
|
|
||||||
return InternalMemSetMem (Buffer, Length, Value);
|
return InternalMemSetMem (Buffer, Length, Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Fills a target buffer with a value that is size UINTN, and returns the target buffer.
|
||||||
|
|
||||||
|
This function fills Length bytes of Buffer with the UINTN sized value specified by
|
||||||
|
Value, and returns Buffer. Value is repeated every sizeof(UINTN) bytes for Length
|
||||||
|
bytes of Buffer.
|
||||||
|
|
||||||
|
If Length > 0 and Buffer is NULL, then ASSERT().
|
||||||
|
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
|
||||||
|
If Buffer is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
If Length is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
|
||||||
|
@param Buffer Pointer to the target buffer to fill.
|
||||||
|
@param Length Number of bytes in Buffer to fill.
|
||||||
|
@param Value Value with which to fill Length bytes of Buffer.
|
||||||
|
|
||||||
|
@return Buffer.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID *
|
||||||
|
EFIAPI
|
||||||
|
SetMemN (
|
||||||
|
OUT VOID *Buffer,
|
||||||
|
IN UINTN Length,
|
||||||
|
IN UINTN Value
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (sizeof (UINTN) == sizeof (UINT64)) {
|
||||||
|
return SetMem64 (Buffer, Length, (UINT64)Value);
|
||||||
|
}
|
||||||
|
return SetMem32 (Buffer, Length, (UINT32)Value);
|
||||||
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/** @file
|
/** @file
|
||||||
ScanMem8() implementation.
|
ScanMem8() and ScanMemN() implementation.
|
||||||
|
|
||||||
The following BaseMemoryLib instances contain the same copy of this file:
|
The following BaseMemoryLib instances contain the same copy of this file:
|
||||||
|
|
||||||
@ -60,3 +60,39 @@ ScanMem8 (
|
|||||||
|
|
||||||
return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);
|
return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Scans a target buffer for a UINTN sized value, and returns a pointer to the matching
|
||||||
|
UINTN sized value in the target buffer.
|
||||||
|
|
||||||
|
This function searches target the buffer specified by Buffer and Length from the lowest
|
||||||
|
address to the highest address for a UINTN sized value that matches Value. If a match is found,
|
||||||
|
then a pointer to the matching byte in the target buffer is returned. If no match is found,
|
||||||
|
then NULL is returned. If Length is 0, then NULL is returned.
|
||||||
|
|
||||||
|
If Length > 0 and Buffer is NULL, then ASSERT().
|
||||||
|
If Buffer is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
If Length is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
|
||||||
|
|
||||||
|
@param Buffer Pointer to the target buffer to scan.
|
||||||
|
@param Length Number of bytes in Buffer to scan.
|
||||||
|
@param Value Value to search for in the target buffer.
|
||||||
|
|
||||||
|
@return A pointer to the matching byte in the target buffer or NULL otherwise.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID *
|
||||||
|
EFIAPI
|
||||||
|
ScanMemN (
|
||||||
|
IN CONST VOID *Buffer,
|
||||||
|
IN UINTN Length,
|
||||||
|
IN UINTN Value
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (sizeof (UINTN) == sizeof (UINT64)) {
|
||||||
|
return ScanMem64 (Buffer, Length, (UINT64)Value);
|
||||||
|
}
|
||||||
|
return ScanMem32 (Buffer, Length, (UINT32)Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/** @file
|
/** @file
|
||||||
SetMem() implementation.
|
SetMem() and SetMemN() implementation.
|
||||||
|
|
||||||
The following BaseMemoryLib instances contain the same copy of this file:
|
The following BaseMemoryLib instances contain the same copy of this file:
|
||||||
|
|
||||||
@ -55,3 +55,36 @@ SetMem (
|
|||||||
|
|
||||||
return InternalMemSetMem (Buffer, Length, Value);
|
return InternalMemSetMem (Buffer, Length, Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Fills a target buffer with a value that is size UINTN, and returns the target buffer.
|
||||||
|
|
||||||
|
This function fills Length bytes of Buffer with the UINTN sized value specified by
|
||||||
|
Value, and returns Buffer. Value is repeated every sizeof(UINTN) bytes for Length
|
||||||
|
bytes of Buffer.
|
||||||
|
|
||||||
|
If Length > 0 and Buffer is NULL, then ASSERT().
|
||||||
|
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
|
||||||
|
If Buffer is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
If Length is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
|
||||||
|
@param Buffer Pointer to the target buffer to fill.
|
||||||
|
@param Length Number of bytes in Buffer to fill.
|
||||||
|
@param Value Value with which to fill Length bytes of Buffer.
|
||||||
|
|
||||||
|
@return Buffer.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID *
|
||||||
|
EFIAPI
|
||||||
|
SetMemN (
|
||||||
|
OUT VOID *Buffer,
|
||||||
|
IN UINTN Length,
|
||||||
|
IN UINTN Value
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (sizeof (UINTN) == sizeof (UINT64)) {
|
||||||
|
return SetMem64 (Buffer, Length, (UINT64)Value);
|
||||||
|
}
|
||||||
|
return SetMem32 (Buffer, Length, (UINT32)Value);
|
||||||
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/** @file
|
/** @file
|
||||||
ScanMem8() implementation.
|
ScanMem8() and ScanMemN() implementation.
|
||||||
|
|
||||||
The following BaseMemoryLib instances contain the same copy of this file:
|
The following BaseMemoryLib instances contain the same copy of this file:
|
||||||
|
|
||||||
@ -60,3 +60,39 @@ ScanMem8 (
|
|||||||
|
|
||||||
return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);
|
return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Scans a target buffer for a UINTN sized value, and returns a pointer to the matching
|
||||||
|
UINTN sized value in the target buffer.
|
||||||
|
|
||||||
|
This function searches target the buffer specified by Buffer and Length from the lowest
|
||||||
|
address to the highest address for a UINTN sized value that matches Value. If a match is found,
|
||||||
|
then a pointer to the matching byte in the target buffer is returned. If no match is found,
|
||||||
|
then NULL is returned. If Length is 0, then NULL is returned.
|
||||||
|
|
||||||
|
If Length > 0 and Buffer is NULL, then ASSERT().
|
||||||
|
If Buffer is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
If Length is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
|
||||||
|
|
||||||
|
@param Buffer Pointer to the target buffer to scan.
|
||||||
|
@param Length Number of bytes in Buffer to scan.
|
||||||
|
@param Value Value to search for in the target buffer.
|
||||||
|
|
||||||
|
@return A pointer to the matching byte in the target buffer or NULL otherwise.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID *
|
||||||
|
EFIAPI
|
||||||
|
ScanMemN (
|
||||||
|
IN CONST VOID *Buffer,
|
||||||
|
IN UINTN Length,
|
||||||
|
IN UINTN Value
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (sizeof (UINTN) == sizeof (UINT64)) {
|
||||||
|
return ScanMem64 (Buffer, Length, (UINT64)Value);
|
||||||
|
}
|
||||||
|
return ScanMem32 (Buffer, Length, (UINT32)Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/** @file
|
/** @file
|
||||||
SetMem() implementation.
|
SetMem() and SetMemN() implementation.
|
||||||
|
|
||||||
The following BaseMemoryLib instances contain the same copy of this file:
|
The following BaseMemoryLib instances contain the same copy of this file:
|
||||||
|
|
||||||
@ -55,3 +55,36 @@ SetMem (
|
|||||||
|
|
||||||
return InternalMemSetMem (Buffer, Length, Value);
|
return InternalMemSetMem (Buffer, Length, Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Fills a target buffer with a value that is size UINTN, and returns the target buffer.
|
||||||
|
|
||||||
|
This function fills Length bytes of Buffer with the UINTN sized value specified by
|
||||||
|
Value, and returns Buffer. Value is repeated every sizeof(UINTN) bytes for Length
|
||||||
|
bytes of Buffer.
|
||||||
|
|
||||||
|
If Length > 0 and Buffer is NULL, then ASSERT().
|
||||||
|
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
|
||||||
|
If Buffer is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
If Length is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
|
||||||
|
@param Buffer Pointer to the target buffer to fill.
|
||||||
|
@param Length Number of bytes in Buffer to fill.
|
||||||
|
@param Value Value with which to fill Length bytes of Buffer.
|
||||||
|
|
||||||
|
@return Buffer.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID *
|
||||||
|
EFIAPI
|
||||||
|
SetMemN (
|
||||||
|
OUT VOID *Buffer,
|
||||||
|
IN UINTN Length,
|
||||||
|
IN UINTN Value
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (sizeof (UINTN) == sizeof (UINT64)) {
|
||||||
|
return SetMem64 (Buffer, Length, (UINT64)Value);
|
||||||
|
}
|
||||||
|
return SetMem32 (Buffer, Length, (UINT32)Value);
|
||||||
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/** @file
|
/** @file
|
||||||
ScanMem8() implementation.
|
ScanMem8() and ScanMemN() implementation.
|
||||||
|
|
||||||
The following BaseMemoryLib instances contain the same copy of this file:
|
The following BaseMemoryLib instances contain the same copy of this file:
|
||||||
|
|
||||||
@ -60,3 +60,39 @@ ScanMem8 (
|
|||||||
|
|
||||||
return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);
|
return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Scans a target buffer for a UINTN sized value, and returns a pointer to the matching
|
||||||
|
UINTN sized value in the target buffer.
|
||||||
|
|
||||||
|
This function searches target the buffer specified by Buffer and Length from the lowest
|
||||||
|
address to the highest address for a UINTN sized value that matches Value. If a match is found,
|
||||||
|
then a pointer to the matching byte in the target buffer is returned. If no match is found,
|
||||||
|
then NULL is returned. If Length is 0, then NULL is returned.
|
||||||
|
|
||||||
|
If Length > 0 and Buffer is NULL, then ASSERT().
|
||||||
|
If Buffer is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
If Length is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
|
||||||
|
|
||||||
|
@param Buffer Pointer to the target buffer to scan.
|
||||||
|
@param Length Number of bytes in Buffer to scan.
|
||||||
|
@param Value Value to search for in the target buffer.
|
||||||
|
|
||||||
|
@return A pointer to the matching byte in the target buffer or NULL otherwise.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID *
|
||||||
|
EFIAPI
|
||||||
|
ScanMemN (
|
||||||
|
IN CONST VOID *Buffer,
|
||||||
|
IN UINTN Length,
|
||||||
|
IN UINTN Value
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (sizeof (UINTN) == sizeof (UINT64)) {
|
||||||
|
return ScanMem64 (Buffer, Length, (UINT64)Value);
|
||||||
|
}
|
||||||
|
return ScanMem32 (Buffer, Length, (UINT32)Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/** @file
|
/** @file
|
||||||
SetMem() implementation.
|
SetMem() and SetMemN() implementation.
|
||||||
|
|
||||||
The following BaseMemoryLib instances contain the same copy of this file:
|
The following BaseMemoryLib instances contain the same copy of this file:
|
||||||
|
|
||||||
@ -55,3 +55,36 @@ SetMem (
|
|||||||
|
|
||||||
return InternalMemSetMem (Buffer, Length, Value);
|
return InternalMemSetMem (Buffer, Length, Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Fills a target buffer with a value that is size UINTN, and returns the target buffer.
|
||||||
|
|
||||||
|
This function fills Length bytes of Buffer with the UINTN sized value specified by
|
||||||
|
Value, and returns Buffer. Value is repeated every sizeof(UINTN) bytes for Length
|
||||||
|
bytes of Buffer.
|
||||||
|
|
||||||
|
If Length > 0 and Buffer is NULL, then ASSERT().
|
||||||
|
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
|
||||||
|
If Buffer is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
If Length is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
|
||||||
|
@param Buffer Pointer to the target buffer to fill.
|
||||||
|
@param Length Number of bytes in Buffer to fill.
|
||||||
|
@param Value Value with which to fill Length bytes of Buffer.
|
||||||
|
|
||||||
|
@return Buffer.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID *
|
||||||
|
EFIAPI
|
||||||
|
SetMemN (
|
||||||
|
OUT VOID *Buffer,
|
||||||
|
IN UINTN Length,
|
||||||
|
IN UINTN Value
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (sizeof (UINTN) == sizeof (UINT64)) {
|
||||||
|
return SetMem64 (Buffer, Length, (UINT64)Value);
|
||||||
|
}
|
||||||
|
return SetMem32 (Buffer, Length, (UINT32)Value);
|
||||||
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/** @file
|
/** @file
|
||||||
ScanMem8() implementation.
|
ScanMem8() and ScanMemN() implementation.
|
||||||
|
|
||||||
The following BaseMemoryLib instances contain the same copy of this file:
|
The following BaseMemoryLib instances contain the same copy of this file:
|
||||||
|
|
||||||
@ -60,3 +60,39 @@ ScanMem8 (
|
|||||||
|
|
||||||
return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);
|
return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Scans a target buffer for a UINTN sized value, and returns a pointer to the matching
|
||||||
|
UINTN sized value in the target buffer.
|
||||||
|
|
||||||
|
This function searches target the buffer specified by Buffer and Length from the lowest
|
||||||
|
address to the highest address for a UINTN sized value that matches Value. If a match is found,
|
||||||
|
then a pointer to the matching byte in the target buffer is returned. If no match is found,
|
||||||
|
then NULL is returned. If Length is 0, then NULL is returned.
|
||||||
|
|
||||||
|
If Length > 0 and Buffer is NULL, then ASSERT().
|
||||||
|
If Buffer is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
If Length is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
|
||||||
|
|
||||||
|
@param Buffer Pointer to the target buffer to scan.
|
||||||
|
@param Length Number of bytes in Buffer to scan.
|
||||||
|
@param Value Value to search for in the target buffer.
|
||||||
|
|
||||||
|
@return A pointer to the matching byte in the target buffer or NULL otherwise.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID *
|
||||||
|
EFIAPI
|
||||||
|
ScanMemN (
|
||||||
|
IN CONST VOID *Buffer,
|
||||||
|
IN UINTN Length,
|
||||||
|
IN UINTN Value
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (sizeof (UINTN) == sizeof (UINT64)) {
|
||||||
|
return ScanMem64 (Buffer, Length, (UINT64)Value);
|
||||||
|
}
|
||||||
|
return ScanMem32 (Buffer, Length, (UINT32)Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/** @file
|
/** @file
|
||||||
SetMem() implementation.
|
SetMem() and SetMemN() implementation.
|
||||||
|
|
||||||
The following BaseMemoryLib instances contain the same copy of this file:
|
The following BaseMemoryLib instances contain the same copy of this file:
|
||||||
|
|
||||||
@ -55,3 +55,36 @@ SetMem (
|
|||||||
|
|
||||||
return InternalMemSetMem (Buffer, Length, Value);
|
return InternalMemSetMem (Buffer, Length, Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Fills a target buffer with a value that is size UINTN, and returns the target buffer.
|
||||||
|
|
||||||
|
This function fills Length bytes of Buffer with the UINTN sized value specified by
|
||||||
|
Value, and returns Buffer. Value is repeated every sizeof(UINTN) bytes for Length
|
||||||
|
bytes of Buffer.
|
||||||
|
|
||||||
|
If Length > 0 and Buffer is NULL, then ASSERT().
|
||||||
|
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
|
||||||
|
If Buffer is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
If Length is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
|
||||||
|
@param Buffer Pointer to the target buffer to fill.
|
||||||
|
@param Length Number of bytes in Buffer to fill.
|
||||||
|
@param Value Value with which to fill Length bytes of Buffer.
|
||||||
|
|
||||||
|
@return Buffer.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID *
|
||||||
|
EFIAPI
|
||||||
|
SetMemN (
|
||||||
|
OUT VOID *Buffer,
|
||||||
|
IN UINTN Length,
|
||||||
|
IN UINTN Value
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (sizeof (UINTN) == sizeof (UINT64)) {
|
||||||
|
return SetMem64 (Buffer, Length, (UINT64)Value);
|
||||||
|
}
|
||||||
|
return SetMem32 (Buffer, Length, (UINT32)Value);
|
||||||
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/** @file
|
/** @file
|
||||||
ScanMem8() implementation.
|
ScanMem8() and ScanMemN() implementation.
|
||||||
|
|
||||||
The following BaseMemoryLib instances contain the same copy of this file:
|
The following BaseMemoryLib instances contain the same copy of this file:
|
||||||
|
|
||||||
@ -60,3 +60,39 @@ ScanMem8 (
|
|||||||
|
|
||||||
return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);
|
return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Scans a target buffer for a UINTN sized value, and returns a pointer to the matching
|
||||||
|
UINTN sized value in the target buffer.
|
||||||
|
|
||||||
|
This function searches target the buffer specified by Buffer and Length from the lowest
|
||||||
|
address to the highest address for a UINTN sized value that matches Value. If a match is found,
|
||||||
|
then a pointer to the matching byte in the target buffer is returned. If no match is found,
|
||||||
|
then NULL is returned. If Length is 0, then NULL is returned.
|
||||||
|
|
||||||
|
If Length > 0 and Buffer is NULL, then ASSERT().
|
||||||
|
If Buffer is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
If Length is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
|
||||||
|
|
||||||
|
@param Buffer Pointer to the target buffer to scan.
|
||||||
|
@param Length Number of bytes in Buffer to scan.
|
||||||
|
@param Value Value to search for in the target buffer.
|
||||||
|
|
||||||
|
@return A pointer to the matching byte in the target buffer or NULL otherwise.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID *
|
||||||
|
EFIAPI
|
||||||
|
ScanMemN (
|
||||||
|
IN CONST VOID *Buffer,
|
||||||
|
IN UINTN Length,
|
||||||
|
IN UINTN Value
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (sizeof (UINTN) == sizeof (UINT64)) {
|
||||||
|
return ScanMem64 (Buffer, Length, (UINT64)Value);
|
||||||
|
}
|
||||||
|
return ScanMem32 (Buffer, Length, (UINT32)Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/** @file
|
/** @file
|
||||||
SetMem() implementation.
|
SetMem() and SetMemN() implementation.
|
||||||
|
|
||||||
The following BaseMemoryLib instances contain the same copy of this file:
|
The following BaseMemoryLib instances contain the same copy of this file:
|
||||||
|
|
||||||
@ -55,3 +55,36 @@ SetMem (
|
|||||||
|
|
||||||
return InternalMemSetMem (Buffer, Length, Value);
|
return InternalMemSetMem (Buffer, Length, Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Fills a target buffer with a value that is size UINTN, and returns the target buffer.
|
||||||
|
|
||||||
|
This function fills Length bytes of Buffer with the UINTN sized value specified by
|
||||||
|
Value, and returns Buffer. Value is repeated every sizeof(UINTN) bytes for Length
|
||||||
|
bytes of Buffer.
|
||||||
|
|
||||||
|
If Length > 0 and Buffer is NULL, then ASSERT().
|
||||||
|
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
|
||||||
|
If Buffer is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
If Length is not aligned on a UINTN boundary, then ASSERT().
|
||||||
|
|
||||||
|
@param Buffer Pointer to the target buffer to fill.
|
||||||
|
@param Length Number of bytes in Buffer to fill.
|
||||||
|
@param Value Value with which to fill Length bytes of Buffer.
|
||||||
|
|
||||||
|
@return Buffer.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID *
|
||||||
|
EFIAPI
|
||||||
|
SetMemN (
|
||||||
|
OUT VOID *Buffer,
|
||||||
|
IN UINTN Length,
|
||||||
|
IN UINTN Value
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (sizeof (UINTN) == sizeof (UINT64)) {
|
||||||
|
return SetMem64 (Buffer, Length, (UINT64)Value);
|
||||||
|
}
|
||||||
|
return SetMem32 (Buffer, Length, (UINT32)Value);
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user