Refactor SetMemWrapper to reduce binary size
Moved SetMemN API to a separate file to eliminate unnecessary inclusion of InternalMemSetMem64 and InternalMemSetMem32 APIs in driver binary. When the compiler linking the Object files it may not remove all the unused from NASM OBJs. This change is to reorganize the C files to minimize the impact of the NASM behavior resulting is code size reduction. Signed-off-by: Ashraf Ali <ashraf.ali.s@intel.com>
This commit is contained in:
parent
03c8ec6ce2
commit
e41e728c16
|
@ -32,6 +32,7 @@
|
|||
ScanMem8Wrapper.c
|
||||
ZeroMemWrapper.c
|
||||
CompareMemWrapper.c
|
||||
SetMemNWrapper.c
|
||||
SetMem64Wrapper.c
|
||||
SetMem32Wrapper.c
|
||||
SetMem16Wrapper.c
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
/** @file
|
||||
SetMemN() implementation.
|
||||
|
||||
The following BaseMemoryLib instances contain the same copy of this file:
|
||||
|
||||
BaseMemoryLib
|
||||
BaseMemoryLibMmx
|
||||
BaseMemoryLibSse2
|
||||
BaseMemoryLibRepStr
|
||||
BaseMemoryLibOptDxe
|
||||
BaseMemoryLibOptPei
|
||||
PeiMemoryLib
|
||||
UefiMemoryLib
|
||||
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#include "MemLibInternals.h"
|
||||
|
||||
/**
|
||||
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 The pointer to the target buffer to fill.
|
||||
@param Length The number of bytes in Buffer to fill.
|
||||
@param Value The 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);
|
||||
} else {
|
||||
return SetMem32 (Buffer, Length, (UINT32)Value);
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/** @file
|
||||
SetMem() and SetMemN() implementation.
|
||||
SetMem() implementation.
|
||||
|
||||
The following BaseMemoryLib instances contain the same copy of this file:
|
||||
|
||||
|
@ -49,37 +49,3 @@ SetMem (
|
|||
|
||||
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 The pointer to the target buffer to fill.
|
||||
@param Length The number of bytes in Buffer to fill.
|
||||
@param Value The 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);
|
||||
} else {
|
||||
return SetMem32 (Buffer, Length, (UINT32)Value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
ScanMem8Wrapper.c
|
||||
ZeroMemWrapper.c
|
||||
CompareMemWrapper.c
|
||||
SetMemNWrapper.c
|
||||
SetMem64Wrapper.c
|
||||
SetMem32Wrapper.c
|
||||
SetMem16Wrapper.c
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
/** @file
|
||||
SetMemN() implementation.
|
||||
|
||||
The following BaseMemoryLib instances contain the same copy of this file:
|
||||
|
||||
BaseMemoryLib
|
||||
BaseMemoryLibMmx
|
||||
BaseMemoryLibSse2
|
||||
BaseMemoryLibRepStr
|
||||
BaseMemoryLibOptDxe
|
||||
BaseMemoryLibOptPei
|
||||
PeiMemoryLib
|
||||
UefiMemoryLib
|
||||
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#include "MemLibInternals.h"
|
||||
|
||||
/**
|
||||
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 The pointer to the target buffer to fill.
|
||||
@param Length The number of bytes in Buffer to fill.
|
||||
@param Value The 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);
|
||||
} else {
|
||||
return SetMem32 (Buffer, Length, (UINT32)Value);
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/** @file
|
||||
SetMem() and SetMemN() implementation.
|
||||
SetMem() implementation.
|
||||
|
||||
The following BaseMemoryLib instances contain the same copy of this file:
|
||||
|
||||
|
@ -49,37 +49,3 @@ SetMem (
|
|||
|
||||
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 The pointer to the target buffer to fill.
|
||||
@param Length The number of bytes in Buffer to fill.
|
||||
@param Value The 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);
|
||||
} else {
|
||||
return SetMem32 (Buffer, Length, (UINT32)Value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,6 +92,7 @@
|
|||
ScanMem8Wrapper.c
|
||||
ZeroMemWrapper.c
|
||||
CompareMemWrapper.c
|
||||
SetMemNWrapper.c
|
||||
SetMem64Wrapper.c
|
||||
SetMem32Wrapper.c
|
||||
SetMem16Wrapper.c
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
/** @file
|
||||
SetMemN() implementation.
|
||||
|
||||
The following BaseMemoryLib instances contain the same copy of this file:
|
||||
|
||||
BaseMemoryLib
|
||||
BaseMemoryLibMmx
|
||||
BaseMemoryLibSse2
|
||||
BaseMemoryLibRepStr
|
||||
BaseMemoryLibOptDxe
|
||||
BaseMemoryLibOptPei
|
||||
PeiMemoryLib
|
||||
UefiMemoryLib
|
||||
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#include "MemLibInternals.h"
|
||||
|
||||
/**
|
||||
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 The pointer to the target buffer to fill.
|
||||
@param Length The number of bytes in Buffer to fill.
|
||||
@param Value The 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);
|
||||
} else {
|
||||
return SetMem32 (Buffer, Length, (UINT32)Value);
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/** @file
|
||||
SetMem() and SetMemN() implementation.
|
||||
SetMem() implementation.
|
||||
|
||||
The following BaseMemoryLib instances contain the same copy of this file:
|
||||
|
||||
|
@ -49,37 +49,3 @@ SetMem (
|
|||
|
||||
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 The pointer to the target buffer to fill.
|
||||
@param Length The number of bytes in Buffer to fill.
|
||||
@param Value The 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);
|
||||
} else {
|
||||
return SetMem32 (Buffer, Length, (UINT32)Value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
ScanMem8Wrapper.c
|
||||
ZeroMemWrapper.c
|
||||
CompareMemWrapper.c
|
||||
SetMemNWrapper.c
|
||||
SetMem64Wrapper.c
|
||||
SetMem32Wrapper.c
|
||||
SetMem16Wrapper.c
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
/** @file
|
||||
SetMemN() implementation.
|
||||
|
||||
The following BaseMemoryLib instances contain the same copy of this file:
|
||||
|
||||
BaseMemoryLib
|
||||
BaseMemoryLibMmx
|
||||
BaseMemoryLibSse2
|
||||
BaseMemoryLibRepStr
|
||||
BaseMemoryLibOptDxe
|
||||
BaseMemoryLibOptPei
|
||||
PeiMemoryLib
|
||||
UefiMemoryLib
|
||||
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#include "MemLibInternals.h"
|
||||
|
||||
/**
|
||||
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 The pointer to the target buffer to fill.
|
||||
@param Length The number of bytes in Buffer to fill.
|
||||
@param Value The 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);
|
||||
} else {
|
||||
return SetMem32 (Buffer, Length, (UINT32)Value);
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/** @file
|
||||
SetMem() and SetMemN() implementation.
|
||||
SetMem() implementation.
|
||||
|
||||
The following BaseMemoryLib instances contain the same copy of this file:
|
||||
|
||||
|
@ -49,37 +49,3 @@ SetMem (
|
|||
|
||||
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 The pointer to the target buffer to fill.
|
||||
@param Length The number of bytes in Buffer to fill.
|
||||
@param Value The 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);
|
||||
} else {
|
||||
return SetMem32 (Buffer, Length, (UINT32)Value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
ScanMem8Wrapper.c
|
||||
ZeroMemWrapper.c
|
||||
CompareMemWrapper.c
|
||||
SetMemNWrapper.c
|
||||
SetMem64Wrapper.c
|
||||
SetMem32Wrapper.c
|
||||
SetMem16Wrapper.c
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
/** @file
|
||||
SetMemN() implementation.
|
||||
|
||||
The following BaseMemoryLib instances contain the same copy of this file:
|
||||
|
||||
BaseMemoryLib
|
||||
BaseMemoryLibMmx
|
||||
BaseMemoryLibSse2
|
||||
BaseMemoryLibRepStr
|
||||
BaseMemoryLibOptDxe
|
||||
BaseMemoryLibOptPei
|
||||
PeiMemoryLib
|
||||
UefiMemoryLib
|
||||
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#include "MemLibInternals.h"
|
||||
|
||||
/**
|
||||
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 The pointer to the target buffer to fill.
|
||||
@param Length The number of bytes in Buffer to fill.
|
||||
@param Value The 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);
|
||||
} else {
|
||||
return SetMem32 (Buffer, Length, (UINT32)Value);
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/** @file
|
||||
SetMem() and SetMemN() implementation.
|
||||
SetMem() implementation.
|
||||
|
||||
The following BaseMemoryLib instances contain the same copy of this file:
|
||||
|
||||
|
@ -49,37 +49,3 @@ SetMem (
|
|||
|
||||
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 The pointer to the target buffer to fill.
|
||||
@param Length The number of bytes in Buffer to fill.
|
||||
@param Value The 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);
|
||||
} else {
|
||||
return SetMem32 (Buffer, Length, (UINT32)Value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
ScanMem8Wrapper.c
|
||||
ZeroMemWrapper.c
|
||||
CompareMemWrapper.c
|
||||
SetMemNWrapper.c
|
||||
SetMem64Wrapper.c
|
||||
SetMem32Wrapper.c
|
||||
SetMem16Wrapper.c
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
/** @file
|
||||
SetMemN() implementation.
|
||||
|
||||
The following BaseMemoryLib instances contain the same copy of this file:
|
||||
|
||||
BaseMemoryLib
|
||||
BaseMemoryLibMmx
|
||||
BaseMemoryLibSse2
|
||||
BaseMemoryLibRepStr
|
||||
BaseMemoryLibOptDxe
|
||||
BaseMemoryLibOptPei
|
||||
PeiMemoryLib
|
||||
UefiMemoryLib
|
||||
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#include "MemLibInternals.h"
|
||||
|
||||
/**
|
||||
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 The pointer to the target buffer to fill.
|
||||
@param Length The number of bytes in Buffer to fill.
|
||||
@param Value The 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);
|
||||
} else {
|
||||
return SetMem32 (Buffer, Length, (UINT32)Value);
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/** @file
|
||||
SetMem() and SetMemN() implementation.
|
||||
SetMem() implementation.
|
||||
|
||||
The following BaseMemoryLib instances contain the same copy of this file:
|
||||
|
||||
|
@ -49,37 +49,3 @@ SetMem (
|
|||
|
||||
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 The pointer to the target buffer to fill.
|
||||
@param Length The number of bytes in Buffer to fill.
|
||||
@param Value The 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);
|
||||
} else {
|
||||
return SetMem32 (Buffer, Length, (UINT32)Value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
/** @file
|
||||
SetMemN() implementation.
|
||||
|
||||
The following BaseMemoryLib instances contain the same copy of this file:
|
||||
|
||||
BaseMemoryLib
|
||||
BaseMemoryLibMmx
|
||||
BaseMemoryLibSse2
|
||||
BaseMemoryLibRepStr
|
||||
BaseMemoryLibOptDxe
|
||||
BaseMemoryLibOptPei
|
||||
PeiMemoryLib
|
||||
UefiMemoryLib
|
||||
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#include "MemLibInternals.h"
|
||||
|
||||
/**
|
||||
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 The pointer to the target buffer to fill.
|
||||
@param Length The number of bytes in Buffer to fill.
|
||||
@param Value The 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);
|
||||
} else {
|
||||
return SetMem32 (Buffer, Length, (UINT32)Value);
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/** @file
|
||||
SetMem() and SetMemN() implementation.
|
||||
SetMem() implementation.
|
||||
|
||||
The following BaseMemoryLib instances contain the same copy of this file:
|
||||
|
||||
|
@ -49,37 +49,3 @@ SetMem (
|
|||
|
||||
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 The pointer to the target buffer to fill.
|
||||
@param Length The number of bytes in Buffer to fill.
|
||||
@param Value The 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);
|
||||
} else {
|
||||
return SetMem32 (Buffer, Length, (UINT32)Value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
ScanMem8Wrapper.c
|
||||
ZeroMemWrapper.c
|
||||
CompareMemWrapper.c
|
||||
SetMemNWrapper.c
|
||||
SetMem64Wrapper.c
|
||||
SetMem32Wrapper.c
|
||||
SetMem16Wrapper.c
|
||||
|
@ -47,7 +48,6 @@
|
|||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
|
||||
|
||||
[LibraryClasses]
|
||||
BaseLib
|
||||
UefiBootServicesTableLib
|
||||
|
|
Loading…
Reference in New Issue