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
- *Base = ((mInternalCr3 == 0) ?\r
- (AsmReadCr3 () & PAGING_4K_ADDRESS_MASK_64) :\r
- mInternalCr3);\r
- if (FiveLevels != NULL) {\r
- *FiveLevels = FALSE;\r
- }\r
-}\r
-\r
/**\r
Create PageTable for SMM use.\r
\r
DEBUG ((DEBUG_INFO, "Start...\n"));\r
PageTableSplitted = FALSE;\r
\r
- GetPageTable (&PageTableBase, NULL);\r
- L3PageTable = (UINT64 *)PageTableBase;\r
+ PageTableBase = AsmReadCr3 () & PAGING_4K_ADDRESS_MASK_64;\r
+ L3PageTable = (UINT64 *)PageTableBase;\r
\r
- SmmSetMemoryAttributesEx ((EFI_PHYSICAL_ADDRESS)PageTableBase, SIZE_4KB, EFI_MEMORY_RO, &IsSplitted);\r
+ SmmSetMemoryAttributesEx (PageTableBase, FALSE, (EFI_PHYSICAL_ADDRESS)PageTableBase, SIZE_4KB, EFI_MEMORY_RO, &IsSplitted);\r
PageTableSplitted = (PageTableSplitted || IsSplitted);\r
\r
for (Index3 = 0; Index3 < 4; Index3++) {\r
continue;\r
}\r
\r
- SmmSetMemoryAttributesEx ((EFI_PHYSICAL_ADDRESS)(UINTN)L2PageTable, SIZE_4KB, EFI_MEMORY_RO, &IsSplitted);\r
+ SmmSetMemoryAttributesEx (PageTableBase, FALSE, (EFI_PHYSICAL_ADDRESS)(UINTN)L2PageTable, SIZE_4KB, EFI_MEMORY_RO, &IsSplitted);\r
PageTableSplitted = (PageTableSplitted || IsSplitted);\r
\r
for (Index2 = 0; Index2 < SIZE_4KB/sizeof (UINT64); Index2++) {\r
continue;\r
}\r
\r
- SmmSetMemoryAttributesEx ((EFI_PHYSICAL_ADDRESS)(UINTN)L1PageTable, SIZE_4KB, EFI_MEMORY_RO, &IsSplitted);\r
+ SmmSetMemoryAttributesEx (PageTableBase, FALSE, (EFI_PHYSICAL_ADDRESS)(UINTN)L1PageTable, SIZE_4KB, EFI_MEMORY_RO, &IsSplitted);\r
PageTableSplitted = (PageTableSplitted || IsSplitted);\r
}\r
}\r