Create X64 mode page tables in memory even when PEI is already X64
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6550 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
**/
|
||||
|
||||
#include "DxeIpl.h"
|
||||
#include "X64/VirtualMemory.h"
|
||||
|
||||
|
||||
|
||||
@@ -36,6 +37,7 @@ HandOffToDxeCore (
|
||||
VOID *BaseOfStack;
|
||||
VOID *TopOfStack;
|
||||
EFI_STATUS Status;
|
||||
UINTN PageTables;
|
||||
|
||||
//
|
||||
// Allocate 128KB for the Stack
|
||||
@@ -50,12 +52,19 @@ HandOffToDxeCore (
|
||||
TopOfStack = (VOID *) ((UINTN) BaseOfStack + EFI_SIZE_TO_PAGES (STACK_SIZE) * EFI_PAGE_SIZE - CPU_STACK_ALIGNMENT);
|
||||
TopOfStack = ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT);
|
||||
|
||||
//
|
||||
// Create page table and save PageMapLevel4 to CR3
|
||||
//
|
||||
PageTables = CreateIdentityMappingPageTables ();
|
||||
|
||||
//
|
||||
// End of PEI phase singal
|
||||
//
|
||||
Status = PeiServicesInstallPpi (&gEndOfPeiSignalPpi);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
AsmWriteCr3 (PageTables);
|
||||
|
||||
//
|
||||
// Update the contents of BSP stack HOB to reflect the real stack info passed to DxeCore.
|
||||
//
|
||||
|
Reference in New Issue
Block a user