Code scrub:
MdePkg/Library/BaseCacheMaintenanceLib MdePkg/Library/BaseDebugLibNull MdePkg/Library/BaseIoLibIntrinsic MdePkg/Library/BaseLib MdePkg/Library/BasePeCoffLib MdePkg/Library/CpuLib MdePkg/Library/DxeMemoryLib MdePkg/Library/DxePiLib MdePkg/Library/PeiIoLib MdePkg/Library/PeiMemoryLib MdePkg/Library/UefiBootServicesTableLib MdePkg/Library/UefiLib MdePkg/Library/UefiRuntimeLib git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5464 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -54,8 +54,7 @@
|
|||||||
@retval EFI_DEVICE_ERROR A hardware error occurs during reading from the Firmware Volume.
|
@retval EFI_DEVICE_ERROR A hardware error occurs during reading from the Firmware Volume.
|
||||||
@retval EFI_ACCESS_DENIED The firmware volume containing the searched Firmware File is configured to disallow reads.
|
@retval EFI_ACCESS_DENIED The firmware volume containing the searched Firmware File is configured to disallow reads.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
PiLibGetSectionFromAnyFv (
|
PiLibGetSectionFromAnyFv (
|
||||||
@ -105,8 +104,7 @@ PiLibGetSectionFromAnyFv (
|
|||||||
@retval EFI_DEVICE_ERROR A hardware error occurs during reading from the Firmware Volume.
|
@retval EFI_DEVICE_ERROR A hardware error occurs during reading from the Firmware Volume.
|
||||||
@retval EFI_ACCESS_DENIED The firmware volume containing the searched Firmware File is configured to disallow reads.
|
@retval EFI_ACCESS_DENIED The firmware volume containing the searched Firmware File is configured to disallow reads.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
PiLibGetSectionFromCurrentFv (
|
PiLibGetSectionFromCurrentFv (
|
||||||
@ -157,8 +155,7 @@ PiLibGetSectionFromCurrentFv (
|
|||||||
@retval EFI_DEVICE_ERROR A hardware error occurs during reading from the Firmware Volume.
|
@retval EFI_DEVICE_ERROR A hardware error occurs during reading from the Firmware Volume.
|
||||||
@retval EFI_ACCESS_DENIED The firmware volume containing the searched Firmware File is configured to disallow reads.
|
@retval EFI_ACCESS_DENIED The firmware volume containing the searched Firmware File is configured to disallow reads.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
PiLibGetSectionFromCurrentFfs (
|
PiLibGetSectionFromCurrentFfs (
|
||||||
|
@ -75,7 +75,7 @@ PeCoffLoaderImageFormatSupported (
|
|||||||
@param FixupData Pointer to a buffer to log the fixups.
|
@param FixupData Pointer to a buffer to log the fixups.
|
||||||
@param Adjust The offset to adjust the fixup.
|
@param Adjust The offset to adjust the fixup.
|
||||||
|
|
||||||
@return Status code.
|
@return Always return UNSUPPORTED.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
RETURN_STATUS
|
RETURN_STATUS
|
||||||
|
@ -75,7 +75,7 @@ PeCoffLoaderImageFormatSupported (
|
|||||||
@param FixupData Pointer to a buffer to log the fixups.
|
@param FixupData Pointer to a buffer to log the fixups.
|
||||||
@param Adjust The offset to adjust the fixup.
|
@param Adjust The offset to adjust the fixup.
|
||||||
|
|
||||||
@return Status code.
|
@return Always return UNSUPPORTED.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
RETURN_STATUS
|
RETURN_STATUS
|
||||||
|
@ -71,7 +71,8 @@
|
|||||||
@param FixupData Pointer to a buffer to log the fixups.
|
@param FixupData Pointer to a buffer to log the fixups.
|
||||||
@param Adjust The offset to adjust the fixup.
|
@param Adjust The offset to adjust the fixup.
|
||||||
|
|
||||||
@return Status code.
|
@retval RETURN_SUCCESS Succeed to fix the relocation entry.
|
||||||
|
@retval RETURN_UNSUPPOTED Unrecoganized relocation entry.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
RETURN_STATUS
|
RETURN_STATUS
|
||||||
@ -227,6 +228,7 @@ PeCoffLoaderRelocateImageEx (
|
|||||||
@param Machine Machine type from the PE Header.
|
@param Machine Machine type from the PE Header.
|
||||||
|
|
||||||
@return TRUE if this PE/COFF loader can load the image
|
@return TRUE if this PE/COFF loader can load the image
|
||||||
|
@return FALSE unrecoganized machine type of image.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
@ -254,6 +256,8 @@ PeCoffLoaderImageFormatSupported (
|
|||||||
|
|
||||||
@retval RETURN_SUCCESS Data is read from FileOffset from the Handle into
|
@retval RETURN_SUCCESS Data is read from FileOffset from the Handle into
|
||||||
the buffer.
|
the buffer.
|
||||||
|
@retval RETURN_UNSUPPORTED Un-recoganized relocation entry
|
||||||
|
type.
|
||||||
**/
|
**/
|
||||||
RETURN_STATUS
|
RETURN_STATUS
|
||||||
PeHotRelocateImageEx (
|
PeHotRelocateImageEx (
|
||||||
|
@ -75,7 +75,7 @@ PeCoffLoaderImageFormatSupported (
|
|||||||
@param FixupData Pointer to a buffer to log the fixups.
|
@param FixupData Pointer to a buffer to log the fixups.
|
||||||
@param Adjust The offset to adjust the fixup.
|
@param Adjust The offset to adjust the fixup.
|
||||||
|
|
||||||
@return Status code.
|
@return EFI_UNSUPPORTED.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
RETURN_STATUS
|
RETURN_STATUS
|
||||||
|
@ -12,11 +12,17 @@
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
//
|
|
||||||
// Include common header file for this module.
|
|
||||||
//
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Places the CPU in a pause state until an interrupt is
|
||||||
|
received.
|
||||||
|
|
||||||
|
Places the CPU in a pause state until an interrupt is
|
||||||
|
received. If interrupts are disabled prior to calling this
|
||||||
|
function, then the CPU will be placed in a pause state
|
||||||
|
indefinitely.
|
||||||
|
|
||||||
|
**/
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
CpuPause (
|
CpuPause (
|
||||||
|
@ -12,11 +12,15 @@
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
//
|
|
||||||
// Include common header file for this module.
|
|
||||||
//
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Places the CPU in a sleep state until an interrupt is received.
|
||||||
|
|
||||||
|
Places the CPU in a sleep state until an interrupt is received. If interrupts
|
||||||
|
are disabled prior to calling this function, then the CPU will be placed in a
|
||||||
|
sleep state indefinitely.
|
||||||
|
|
||||||
|
**/
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
CpuSleep (
|
CpuSleep (
|
||||||
|
@ -14,6 +14,18 @@
|
|||||||
|
|
||||||
#include "MemLibInternals.h"
|
#include "MemLibInternals.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
Copies a source buffer to a destination buffer, and returns the destination buffer.
|
||||||
|
|
||||||
|
This function wraps the gBS->CopyMem().
|
||||||
|
|
||||||
|
@param DestinationBuffer Pointer to the destination buffer of the memory copy.
|
||||||
|
@param SourceBuffer Pointer to the source buffer of the memory copy.
|
||||||
|
@param Length Number of bytes to copy from SourceBuffer to DestinationBuffer.
|
||||||
|
|
||||||
|
@return DestinationBuffer.
|
||||||
|
|
||||||
|
**/
|
||||||
VOID *
|
VOID *
|
||||||
EFIAPI
|
EFIAPI
|
||||||
InternalMemCopyMem (
|
InternalMemCopyMem (
|
||||||
@ -26,6 +38,18 @@ InternalMemCopyMem (
|
|||||||
return Destination;
|
return Destination;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Fills a target buffer with a byte value, and returns the target buffer.
|
||||||
|
|
||||||
|
This function wraps the gBS->SetMem().
|
||||||
|
|
||||||
|
@param Buffer Memory to set.
|
||||||
|
@param Length Number of bytes to set.
|
||||||
|
@param Value Value of the set operation.
|
||||||
|
|
||||||
|
@return Buffer.
|
||||||
|
|
||||||
|
**/
|
||||||
VOID *
|
VOID *
|
||||||
EFIAPI
|
EFIAPI
|
||||||
InternalMemSetMem (
|
InternalMemSetMem (
|
||||||
|
@ -98,9 +98,7 @@ InternalImageHandleToFvHandle (
|
|||||||
@retval EFI_DEVICE_ERROR A hardware error occurs during reading from the Firmware Volume.
|
@retval EFI_DEVICE_ERROR A hardware error occurs during reading from the Firmware Volume.
|
||||||
@retval EFI_ACCESS_DENIED The firmware volume containing the searched Firmware File is configured to disallow reads.
|
@retval EFI_ACCESS_DENIED The firmware volume containing the searched Firmware File is configured to disallow reads.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
GetSectionFromFv (
|
GetSectionFromFv (
|
||||||
IN EFI_HANDLE FvHandle,
|
IN EFI_HANDLE FvHandle,
|
||||||
@ -163,6 +161,43 @@ GetSectionFromFv (
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Allocate and fill a buffer from the Firmware Section identified by a Firmware File GUID name and a Firmware
|
||||||
|
Section type and instance number from any Firmware Volumes in the system.
|
||||||
|
|
||||||
|
The function will read the first Firmware Section sepcifed by NameGuid, SectionType and Instance by searching
|
||||||
|
for all Firmware Volumes in the system.
|
||||||
|
|
||||||
|
The search order for Firmware Volumes in the system is determistic but abitrary if no new Firmware Volume is installed
|
||||||
|
into the system. The search order for the section specified by SectionType within a Firmware File is defined by
|
||||||
|
EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection (). Please check Section 2.4 of Volume 3: Platform Initialization
|
||||||
|
Shared Architectural Elements for detailes.
|
||||||
|
|
||||||
|
If SectionType is EFI_SECTION_TE, EFI_SECTION_TE will be used as Firmware Section type to read Firmware Section
|
||||||
|
data from the Firmware File. If no such section exists, EFI_SECTION_PE32 will be used as Firmware Section type to
|
||||||
|
read Firmware Section data from the Firmware File. If no such section specified is found to match ,
|
||||||
|
EFI_NOT_FOUND is returned.
|
||||||
|
|
||||||
|
The data and size is returned by Buffer and Size. The caller is responsible to free the Buffer allocated
|
||||||
|
by this function. This function can only be called at TPL_NOTIFY and below.
|
||||||
|
|
||||||
|
If NameGuid is NULL, then ASSERT();
|
||||||
|
If Buffer is NULL, then ASSERT();
|
||||||
|
If Size is NULL, then ASSERT().
|
||||||
|
|
||||||
|
@param NameGuid The GUID name of a Firmware File.
|
||||||
|
@param SectionType The Firmware Section type.
|
||||||
|
@param Instance The instance number of Firmware Section to read from starting from 0.
|
||||||
|
@param Buffer On output, Buffer contains the the data read from the section in the Firmware File found.
|
||||||
|
@param Size On output, the size of Buffer.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The image is found and data and size is returned.
|
||||||
|
@retval EFI_NOT_FOUND The image specified by NameGuid and SectionType can't be found.
|
||||||
|
@retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the output data buffer or complete the operations.
|
||||||
|
@retval EFI_DEVICE_ERROR A hardware error occurs during reading from the Firmware Volume.
|
||||||
|
@retval EFI_ACCESS_DENIED The firmware volume containing the searched Firmware File is configured to disallow reads.
|
||||||
|
|
||||||
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
PiLibGetSectionFromAnyFv (
|
PiLibGetSectionFromAnyFv (
|
||||||
@ -250,6 +285,45 @@ Done:
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Allocate and fill a buffer from a Firmware Section identified by a Firmware File GUID name, a Firmware
|
||||||
|
Section type and instance number from the same Firmware Volume with the caller's FFS.
|
||||||
|
|
||||||
|
This functions first locates the EFI_FIRMWARE_VOLUME2_PROTOCOL protocol instance for same Firmrware Volume
|
||||||
|
which also contains the FFS of the caller in order to carry out the Firmware Volume read operation.
|
||||||
|
The function then reads the Firmware Section found sepcifed by NameGuid, SectionType and Instance.
|
||||||
|
|
||||||
|
The search order for the section specified by SectionType within a Firmware File is defined by
|
||||||
|
EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection (). Please check Section 2.4 of Volume 3: Platform Initialization
|
||||||
|
Shared Architectural Elements for detailes.
|
||||||
|
|
||||||
|
If SectionType is EFI_SECTION_TE, EFI_SECTION_TE will be used as Firmware Section type to read Firmware Section
|
||||||
|
data from the Firmware File. If no such section exists, EFI_SECTION_PE32 will be used as Firmware Section type to
|
||||||
|
read Firmware Section data from the Firmware File. If no such section specified is found to match ,
|
||||||
|
EFI_NOT_FOUND is returned.
|
||||||
|
|
||||||
|
The data and size is returned by Buffer and Size. The caller is responsible to free the Buffer allocated
|
||||||
|
by this function. This function can be only called at TPL_NOTIFY and below.
|
||||||
|
|
||||||
|
If FvHandle is NULL, then ASSERT ();
|
||||||
|
If NameGuid is NULL, then ASSERT();
|
||||||
|
If Buffer is NULL, then ASSERT();
|
||||||
|
If Size is NULL, then ASSERT().
|
||||||
|
|
||||||
|
@param NameGuid The GUID name of a Firmware File.
|
||||||
|
@param SectionType The Firmware Section type.
|
||||||
|
@param Instance The instance number of Firmware Section to read from starting from 0.
|
||||||
|
@param Buffer On output, Buffer contains the the data read from the section in the Firmware File found.
|
||||||
|
@param Size On output, the size of Buffer.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The image is found and data and size is returned.
|
||||||
|
@retval EFI_UNSUPPORTED FvHandle does not support EFI_FIRMWARE_VOLUME2_PROTOCOL.
|
||||||
|
@retval EFI_NOT_FOUND The image specified by NameGuid and SectionType can't be found.
|
||||||
|
@retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the output data buffer or complete the operations.
|
||||||
|
@retval EFI_DEVICE_ERROR A hardware error occurs during reading from the Firmware Volume.
|
||||||
|
@retval EFI_ACCESS_DENIED The firmware volume containing the searched Firmware File is configured to disallow reads.
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -272,6 +346,45 @@ PiLibGetSectionFromCurrentFv (
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Allocate and fill a buffer from the first Firmware Section in the same Firmware File as the caller of this function.
|
||||||
|
|
||||||
|
The function will read the first Firmware Section found sepcifed by NameGuid and SectionType from the
|
||||||
|
Firmware Volume specified by FvHandle. On this FvHandle, an EFI_FIRMWARE_VOLUME2_PROTOCOL protocol instance
|
||||||
|
should be located succesfully in order to carry out the Firmware Volume operations.
|
||||||
|
|
||||||
|
The search order for the section type specified by SectionType in the Firmware File is using a depth-first
|
||||||
|
and left-to-right algorithm through all sections. The first section found to match SectionType will be returned.
|
||||||
|
|
||||||
|
If SectionType is EFI_SECTION_PE32, EFI_SECTION_PE32 will be used as Firmware Section type
|
||||||
|
to read Firmware Section data from the Firmware File. If no such section exists, the function will try
|
||||||
|
to read a Firmware File named with NameGuid. If no such file exists, EFI_NOT_FOUND is returned.
|
||||||
|
|
||||||
|
If SectionType is EFI_SECTION_TE, EFI_SECTION_TE will be used as Firmware Section type to read Firmware Section
|
||||||
|
data from the Firmware File. If no such section exists, EFI_SECTION_PE32 will be used as Firmware Section type to
|
||||||
|
read Firmware Section data from the Firmware File. If no such section exists, the function will try to read a Firmware
|
||||||
|
File named with NameGuid. If no such file exists, EFI_NOT_FOUND is returned.
|
||||||
|
|
||||||
|
The data and size is returned by Buffer and Size. The caller is responsible to free the Buffer allocated
|
||||||
|
by this function. This function can only be called at TPL_NOTIFY and below.
|
||||||
|
|
||||||
|
If FvHandle is NULL and WithinImage is TRUE, then ASSERT ();
|
||||||
|
If NameGuid is NULL, then ASSERT();
|
||||||
|
If Buffer is NULL, then ASSERT();
|
||||||
|
If Size is NULL, then ASSERT().
|
||||||
|
|
||||||
|
@param NameGuid The GUID name of a Firmware File.
|
||||||
|
@param SectionType The Firmware Section type.
|
||||||
|
@param Buffer On output, Buffer contains the the data read from the section in the Firmware File found.
|
||||||
|
@param Size On output, the size of Buffer.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The image is found and data and size is returned.
|
||||||
|
@retval EFI_NOT_FOUND The image specified by NameGuid and SectionType can't be found.
|
||||||
|
@retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the output data buffer or complete the operations.
|
||||||
|
@retval EFI_DEVICE_ERROR A hardware error occurs during reading from the Firmware Volume.
|
||||||
|
@retval EFI_ACCESS_DENIED The firmware volume containing the searched Firmware File is configured to disallow reads.
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
|
@ -133,7 +133,7 @@ IoAndThenOr8 (
|
|||||||
@param EndBit The ordinal of the most significant bit in the bit field.
|
@param EndBit The ordinal of the most significant bit in the bit field.
|
||||||
Range 0..7.
|
Range 0..7.
|
||||||
|
|
||||||
@return The value read.
|
@return The value read from Port.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINT8
|
UINT8
|
||||||
@ -413,7 +413,7 @@ IoAndThenOr16 (
|
|||||||
@param EndBit The ordinal of the most significant bit in the bit field.
|
@param EndBit The ordinal of the most significant bit in the bit field.
|
||||||
Range 0..15.
|
Range 0..15.
|
||||||
|
|
||||||
@return The value read.
|
@return The value read from Port.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINT16
|
UINT16
|
||||||
@ -693,7 +693,7 @@ IoAndThenOr32 (
|
|||||||
@param EndBit The ordinal of the most significant bit in the bit field.
|
@param EndBit The ordinal of the most significant bit in the bit field.
|
||||||
Range 0..31.
|
Range 0..31.
|
||||||
|
|
||||||
@return The value read.
|
@return The value read from Port.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINT32
|
UINT32
|
||||||
@ -1536,7 +1536,7 @@ MmioAndThenOr16 (
|
|||||||
@param EndBit The ordinal of the most significant bit in the bit field.
|
@param EndBit The ordinal of the most significant bit in the bit field.
|
||||||
Range 0..15.
|
Range 0..15.
|
||||||
|
|
||||||
@return The value read.
|
@return The value read from Address.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINT16
|
UINT16
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
@param Port The I/O port to read.
|
@param Port The I/O port to read.
|
||||||
|
|
||||||
@return The value read.
|
@return The value read from Port.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINT8
|
UINT8
|
||||||
@ -94,7 +94,7 @@ IoWrite8 (
|
|||||||
|
|
||||||
@param Port The I/O port to read.
|
@param Port The I/O port to read.
|
||||||
|
|
||||||
@return The value read.
|
@return The value read from Port.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINT16
|
UINT16
|
||||||
@ -163,7 +163,7 @@ IoWrite16 (
|
|||||||
|
|
||||||
@param Port The I/O port to read.
|
@param Port The I/O port to read.
|
||||||
|
|
||||||
@return The value read.
|
@return The value read from Port.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINT32
|
UINT32
|
||||||
@ -232,7 +232,7 @@ IoWrite32 (
|
|||||||
|
|
||||||
@param Port The I/O port to read.
|
@param Port The I/O port to read.
|
||||||
|
|
||||||
@return The value read.
|
@return The value read from Port.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINT64
|
UINT64
|
||||||
@ -301,7 +301,7 @@ IoWrite64 (
|
|||||||
|
|
||||||
@param Address The MMIO register to read.
|
@param Address The MMIO register to read.
|
||||||
|
|
||||||
@return The value read.
|
@return The value read from Port.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINT8
|
UINT8
|
||||||
@ -331,7 +331,8 @@ MmioRead8 (
|
|||||||
|
|
||||||
@param Address The MMIO register to write.
|
@param Address The MMIO register to write.
|
||||||
@param Value The value to write to the MMIO register.
|
@param Value The value to write to the MMIO register.
|
||||||
|
|
||||||
|
@return The Value written back to Mmio register.
|
||||||
**/
|
**/
|
||||||
UINT8
|
UINT8
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -362,7 +363,7 @@ MmioWrite8 (
|
|||||||
|
|
||||||
@param Address The MMIO register to read.
|
@param Address The MMIO register to read.
|
||||||
|
|
||||||
@return The value read.
|
@return The value read from Address.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINT16
|
UINT16
|
||||||
@ -396,6 +397,8 @@ MmioRead16 (
|
|||||||
|
|
||||||
@param Address The MMIO register to write.
|
@param Address The MMIO register to write.
|
||||||
@param Value The value to write to the MMIO register.
|
@param Value The value to write to the MMIO register.
|
||||||
|
|
||||||
|
@return The Value written back to Mmio register
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINT16
|
UINT16
|
||||||
@ -430,7 +433,7 @@ MmioWrite16 (
|
|||||||
|
|
||||||
@param Address The MMIO register to read.
|
@param Address The MMIO register to read.
|
||||||
|
|
||||||
@return The value read.
|
@return The value read from Address.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINT32
|
UINT32
|
||||||
@ -464,6 +467,8 @@ MmioRead32 (
|
|||||||
|
|
||||||
@param Address The MMIO register to write.
|
@param Address The MMIO register to write.
|
||||||
@param Value The value to write to the MMIO register.
|
@param Value The value to write to the MMIO register.
|
||||||
|
|
||||||
|
@return The Value written back to Mmio register
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINT32
|
UINT32
|
||||||
@ -498,7 +503,7 @@ MmioWrite32 (
|
|||||||
|
|
||||||
@param Address The MMIO register to read.
|
@param Address The MMIO register to read.
|
||||||
|
|
||||||
@return The value read.
|
@return The value read from Address.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINT64
|
UINT64
|
||||||
@ -533,6 +538,7 @@ MmioRead64 (
|
|||||||
@param Address The MMIO register to write.
|
@param Address The MMIO register to write.
|
||||||
@param Value The value to write to the MMIO register.
|
@param Value The value to write to the MMIO register.
|
||||||
|
|
||||||
|
@return The Value written back to Mmio register
|
||||||
**/
|
**/
|
||||||
UINT64
|
UINT64
|
||||||
EFIAPI
|
EFIAPI
|
||||||
|
@ -1077,6 +1077,14 @@ FreeAlignedPool (
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Frees buffer that were previously allocated with one of the
|
||||||
|
memory allocation functions in the Memory Allocation Library.
|
||||||
|
|
||||||
|
@param Buffer Pointer to the buffer of pages
|
||||||
|
to free.
|
||||||
|
|
||||||
|
**/
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
SafeFreePool (
|
SafeFreePool (
|
||||||
|
@ -14,6 +14,18 @@
|
|||||||
|
|
||||||
#include "MemLibInternals.h"
|
#include "MemLibInternals.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
Copies a source buffer to a destination buffer, and returns the destination buffer.
|
||||||
|
|
||||||
|
This function wraps the gPS->CopyMem ().
|
||||||
|
|
||||||
|
@param DestinationBuffer Pointer to the destination buffer of the memory copy.
|
||||||
|
@param SourceBuffer Pointer to the source buffer of the memory copy.
|
||||||
|
@param Length Number of bytes to copy from SourceBuffer to DestinationBuffer.
|
||||||
|
|
||||||
|
@return DestinationBuffer.
|
||||||
|
|
||||||
|
**/
|
||||||
VOID *
|
VOID *
|
||||||
EFIAPI
|
EFIAPI
|
||||||
InternalMemCopyMem (
|
InternalMemCopyMem (
|
||||||
@ -30,6 +42,18 @@ InternalMemCopyMem (
|
|||||||
return Destination;
|
return Destination;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Fills a target buffer with a byte value, and returns the target buffer.
|
||||||
|
|
||||||
|
This function wraps the gPS->SetMem ().
|
||||||
|
|
||||||
|
@param Buffer Memory to set.
|
||||||
|
@param Length Number of bytes to set.
|
||||||
|
@param Value Value of the set operation.
|
||||||
|
|
||||||
|
@return Buffer.
|
||||||
|
|
||||||
|
**/
|
||||||
VOID *
|
VOID *
|
||||||
EFIAPI
|
EFIAPI
|
||||||
InternalMemSetMem (
|
InternalMemSetMem (
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
#include <PiDxe.h>
|
#include <PiDxe.h>
|
||||||
|
|
||||||
|
|
||||||
#include <Library/UefiBootServicesTableLib.h>
|
#include <Library/UefiBootServicesTableLib.h>
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
#include "UefiBootServicesTableLibInternal.h"
|
#include "UefiBootServicesTableLibInternal.h"
|
||||||
|
@ -24,7 +24,7 @@ typedef struct {
|
|||||||
UINT32 Width;
|
UINT32 Width;
|
||||||
} UNICODE_WIDTH_ENTRY;
|
} UNICODE_WIDTH_ENTRY;
|
||||||
|
|
||||||
UNICODE_WIDTH_ENTRY mUnicodeWidthTable[] = {
|
GLOBAL_REMOVE_IF_UNREFERENCED CONST UNICODE_WIDTH_ENTRY mUnicodeWidthTable[] = {
|
||||||
//
|
//
|
||||||
// General script area
|
// General script area
|
||||||
//
|
//
|
||||||
|
@ -26,14 +26,15 @@
|
|||||||
specified by Console and returns the number of Unicode characters that printed
|
specified by Console and returns the number of Unicode characters that printed
|
||||||
to it. If the length of the formatted Unicode string is greater than PcdUefiLibMaxPrintBufferSize,
|
to it. If the length of the formatted Unicode string is greater than PcdUefiLibMaxPrintBufferSize,
|
||||||
then only the first PcdUefiLibMaxPrintBufferSize characters are sent to Console.
|
then only the first PcdUefiLibMaxPrintBufferSize characters are sent to Console.
|
||||||
|
If Format is NULL, then ASSERT().
|
||||||
|
If Format is not aligned on a 16-bit boundary, then ASSERT().
|
||||||
|
|
||||||
@param Format Null-terminated Unicode format string.
|
@param Format Null-terminated Unicode format string.
|
||||||
@param Console The output console.
|
@param Console The output console.
|
||||||
@param Marker VA_LIST marker for the variable argument list.
|
@param Marker VA_LIST marker for the variable argument list.
|
||||||
|
|
||||||
If Format is NULL, then ASSERT().
|
@return The number of Unicode characters in the produced
|
||||||
If Format is not aligned on a 16-bit boundary, then ASSERT().
|
output buffer not including the Null-terminator.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
STATIC
|
STATIC
|
||||||
@ -79,11 +80,14 @@ InternalPrint (
|
|||||||
characters that printed to ConOut. If the length of the formatted Unicode
|
characters that printed to ConOut. If the length of the formatted Unicode
|
||||||
string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
|
string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
|
||||||
PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
|
PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
|
||||||
|
If Format is NULL, then ASSERT().
|
||||||
|
If Format is not aligned on a 16-bit boundary, then ASSERT().
|
||||||
|
|
||||||
@param Format Null-terminated Unicode format string.
|
@param Format Null-terminated Unicode format string.
|
||||||
@param ... VARARG list consumed to process Format.
|
@param ... VARARG list consumed to process Format.
|
||||||
If Format is NULL, then ASSERT().
|
|
||||||
If Format is not aligned on a 16-bit boundary, then ASSERT().
|
@return The number of Unicode characters in the produced
|
||||||
|
output buffer not including the Null-terminator.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINTN
|
UINTN
|
||||||
@ -114,12 +118,14 @@ Print (
|
|||||||
characters that printed to StdErr. If the length of the formatted Unicode
|
characters that printed to StdErr. If the length of the formatted Unicode
|
||||||
string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
|
string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
|
||||||
PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
|
PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
|
||||||
|
|
||||||
@param Format Null-terminated Unicode format string.
|
|
||||||
@param ... VARARG list consumed to process Format.
|
|
||||||
If Format is NULL, then ASSERT().
|
If Format is NULL, then ASSERT().
|
||||||
If Format is not aligned on a 16-bit boundary, then ASSERT().
|
If Format is not aligned on a 16-bit boundary, then ASSERT().
|
||||||
|
|
||||||
|
@param Format Null-terminated Unicode format string.
|
||||||
|
@param ... VARARG list consumed to process Format.
|
||||||
|
|
||||||
|
@return The number of Unicode characters in the produced
|
||||||
|
output buffer not including the Null-terminator.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
UINTN
|
UINTN
|
||||||
@ -150,15 +156,20 @@ ErrorPrint (
|
|||||||
specified by Console and returns the number of ASCII characters that printed
|
specified by Console and returns the number of ASCII characters that printed
|
||||||
to it. If the length of the formatted ASCII string is greater than PcdUefiLibMaxPrintBufferSize,
|
to it. If the length of the formatted ASCII string is greater than PcdUefiLibMaxPrintBufferSize,
|
||||||
then only the first PcdUefiLibMaxPrintBufferSize characters are sent to Console.
|
then only the first PcdUefiLibMaxPrintBufferSize characters are sent to Console.
|
||||||
|
If Format is NULL, then ASSERT().
|
||||||
|
|
||||||
|
If Format is NULL, then ASSERT().
|
||||||
|
If Format is not aligned on a 16-bit boundary, then ASSERT().
|
||||||
|
|
||||||
|
|
||||||
@param Format Null-terminated ASCII format string.
|
@param Format Null-terminated ASCII format string.
|
||||||
@param Console The output console.
|
@param Console The output console.
|
||||||
@param Marker VA_LIST marker for the variable argument list.
|
@param Marker VA_LIST marker for the variable argument list.
|
||||||
|
|
||||||
If Format is NULL, then ASSERT().
|
@return The number of Unicode characters in the produced
|
||||||
|
output buffer not including the Null-terminator.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
STATIC
|
STATIC
|
||||||
UINTN
|
UINTN
|
||||||
AsciiInternalPrint (
|
AsciiInternalPrint (
|
||||||
@ -201,11 +212,14 @@ AsciiInternalPrint (
|
|||||||
characters that printed to ConOut. If the length of the formatted ASCII
|
characters that printed to ConOut. If the length of the formatted ASCII
|
||||||
string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
|
string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
|
||||||
PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
|
PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
|
||||||
|
If Format is NULL, then ASSERT().
|
||||||
|
If Format is not aligned on a 16-bit boundary, then ASSERT().
|
||||||
|
|
||||||
@param Format Null-terminated ASCII format string.
|
@param Format Null-terminated ASCII format string.
|
||||||
@param ... VARARG list consumed to process Format.
|
@param ... VARARG list consumed to process Format.
|
||||||
If Format is NULL, then ASSERT().
|
|
||||||
If Format is not aligned on a 16-bit boundary, then ASSERT().
|
@return The number of Ascii characters in the produced
|
||||||
|
output buffer not including the Null-terminator.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINTN
|
UINTN
|
||||||
@ -236,11 +250,14 @@ AsciiPrint (
|
|||||||
characters that printed to StdErr. If the length of the formatted ASCII
|
characters that printed to StdErr. If the length of the formatted ASCII
|
||||||
string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
|
string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
|
||||||
PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
|
PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
|
||||||
|
If Format is NULL, then ASSERT().
|
||||||
|
If Format is not aligned on a 16-bit boundary, then ASSERT().
|
||||||
|
|
||||||
@param Format Null-terminated ASCII format string.
|
@param Format Null-terminated ASCII format string.
|
||||||
@param ... VARARG list consumed to process Format.
|
@param ... VARARG list consumed to process Format.
|
||||||
If Format is NULL, then ASSERT().
|
|
||||||
If Format is not aligned on a 16-bit boundary, then ASSERT().
|
@return The number of Ascii characters in the produced output
|
||||||
|
buffer not including the Null-terminator.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINTN
|
UINTN
|
||||||
|
@ -30,7 +30,6 @@ EFI_RUNTIME_SERVICES *mRT;
|
|||||||
@param[in] Event The Event that is being processed
|
@param[in] Event The Event that is being processed
|
||||||
@param[in] Context Event Context
|
@param[in] Context Event Context
|
||||||
**/
|
**/
|
||||||
STATIC
|
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
RuntimeLibExitBootServicesEvent (
|
RuntimeLibExitBootServicesEvent (
|
||||||
@ -54,7 +53,6 @@ RuntimeLibExitBootServicesEvent (
|
|||||||
@param[in] Event The Event that is being processed
|
@param[in] Event The Event that is being processed
|
||||||
@param[in] Context Event Context
|
@param[in] Context Event Context
|
||||||
**/
|
**/
|
||||||
STATIC
|
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
RuntimeLibVirtualNotifyEvent (
|
RuntimeLibVirtualNotifyEvent (
|
||||||
|
@ -335,7 +335,7 @@ EfiSetVirtualAddressMap (
|
|||||||
IN CONST EFI_MEMORY_DESCRIPTOR *VirtualMap
|
IN CONST EFI_MEMORY_DESCRIPTOR *VirtualMap
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return gRT->SetVirtualAddressMap (
|
return mRT->SetVirtualAddressMap (
|
||||||
MemoryMapSize,
|
MemoryMapSize,
|
||||||
DescriptorSize,
|
DescriptorSize,
|
||||||
DescriptorVersion,
|
DescriptorVersion,
|
||||||
|
Reference in New Issue
Block a user