extern UINTN mNumberOfCpus;\r
extern EFI_SMM_CPU_PROTOCOL mSmmCpu;\r
extern EFI_MM_MP_PROTOCOL mSmmMp;\r
-extern UINTN mInternalCr3;\r
+extern BOOLEAN m5LevelPagingNeeded;\r
\r
///\r
/// The mode of the CPU at the time an SMI occurs\r
\r
**/\r
EFI_STATUS\r
-EFIAPI\r
SmmSetMemoryAttributes (\r
IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
IN UINT64 Length,\r
\r
**/\r
EFI_STATUS\r
-EFIAPI\r
SmmClearMemoryAttributes (\r
IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
IN UINT64 Length,\r
VOID\r
);\r
\r
-/**\r
- Get page table base address and the depth of the page table.\r
-\r
- @param[out] Base Page table base address.\r
- @param[out] FiveLevels TRUE means 5 level paging. FALSE means 4 level paging.\r
-**/\r
-VOID\r
-GetPageTable (\r
- OUT UINTN *Base,\r
- OUT BOOLEAN *FiveLevels OPTIONAL\r
- );\r
-\r
/**\r
This function sets the attributes for the memory region specified by BaseAddress and\r
Length from their current attributes to the attributes specified by Attributes.\r
\r
+ @param[in] PageTableBase The page table base.\r
+ @param[in] EnablePML5Paging If PML5 paging is enabled.\r
@param[in] BaseAddress The physical address that is the start address of a memory region.\r
@param[in] Length The size in bytes of the memory region.\r
@param[in] Attributes The bit mask of attributes to set for the memory region.\r
\r
**/\r
EFI_STATUS\r
-EFIAPI\r
SmmSetMemoryAttributesEx (\r
+ IN UINTN PageTableBase,\r
+ IN BOOLEAN EnablePML5Paging,\r
IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
IN UINT64 Length,\r
IN UINT64 Attributes,\r
This function clears the attributes for the memory region specified by BaseAddress and\r
Length from their current attributes to the attributes specified by Attributes.\r
\r
+ @param[in] PageTableBase The page table base.\r
+ @param[in] EnablePML5Paging If PML5 paging is enabled.\r
@param[in] BaseAddress The physical address that is the start address of a memory region.\r
@param[in] Length The size in bytes of the memory region.\r
@param[in] Attributes The bit mask of attributes to clear for the memory region.\r
\r
**/\r
EFI_STATUS\r
-EFIAPI\r
SmmClearMemoryAttributesEx (\r
+ IN UINTN PageTableBase,\r
+ IN BOOLEAN EnablePML5Paging,\r
IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
IN UINT64 Length,\r
IN UINT64 Attributes,\r