StandaloneMmPkg: StandaloneMmMemLib: Extends support for X64 architecture
This change extends StandaloneMmMemLib library to support X64 architecture. The implementation is ported from MdePkg/Library/SmmMemLib. Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com> Signed-off-by: Kun Qin <kun.q@outlook.com> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
This commit is contained in:
@@ -37,6 +37,27 @@ MmMemLibInternalCalculateMaximumSupportAddress (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Initialize cached Mmram Ranges from HOB.
|
||||
|
||||
@retval EFI_UNSUPPORTED The routine is unable to extract MMRAM information.
|
||||
@retval EFI_SUCCESS MmRanges are populated successfully.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
MmMemLibInternalPopulateMmramRanges (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Deinitialize cached Mmram Ranges.
|
||||
|
||||
**/
|
||||
VOID
|
||||
MmMemLibInternalFreeMmramRanges (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
This function check if the buffer is valid per processor architecture and not overlap with MMRAM.
|
||||
|
||||
@@ -253,11 +274,42 @@ MemLibConstructor (
|
||||
IN EFI_MM_SYSTEM_TABLE *MmSystemTable
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
//
|
||||
// Calculate and save maximum support address
|
||||
//
|
||||
MmMemLibInternalCalculateMaximumSupportAddress ();
|
||||
|
||||
//
|
||||
// Initialize cached Mmram Ranges from HOB.
|
||||
//
|
||||
Status = MmMemLibInternalPopulateMmramRanges ();
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Destructor for Mm Mem library.
|
||||
|
||||
@param ImageHandle The image handle of the process.
|
||||
@param MmSystemTable The EFI System Table pointer.
|
||||
|
||||
@retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
MemLibDestructor (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_MM_SYSTEM_TABLE *MmSystemTable
|
||||
)
|
||||
{
|
||||
|
||||
//
|
||||
// Deinitialize cached Mmram Ranges.
|
||||
//
|
||||
MmMemLibInternalFreeMmramRanges ();
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
Reference in New Issue
Block a user