Refactor MMU for multi-paging support and add 5-Level paging #16

Open
harraiken wants to merge 35 commits from harraiken_mm into master
2 changed files with 52 additions and 2 deletions
Showing only changes of commit de2973ac42 - Show all commits

View File

@ -20,7 +20,31 @@ XTAPI
VOID
MmInitializePageMapSupport(VOID)
{
UNIMPLEMENTED;
/* Check if XPA is enabled */
if(MmpGetExtendedPhysicalAddressingStatus())
{
/* Set PML5 page map information */
MmpPageMapInfo.Xpa = TRUE;
/* Set PML5 base addresses */
MmpPageMapInfo.PteBase = MM_PTE_LA57_BASE;
MmpPageMapInfo.PdeBase = MM_PDE_LA57_BASE;
MmpPageMapInfo.PpeBase = MM_PPE_LA57_BASE;
MmpPageMapInfo.PxeBase = MM_PXE_LA57_BASE;
MmpPageMapInfo.P5eBase = MM_P5E_LA57_BASE;
}
else
{
/* Set PML4 page map information */
MmpPageMapInfo.Xpa = FALSE;
/* Set PML4 base addresses */
MmpPageMapInfo.PteBase = MM_PTE_BASE;
MmpPageMapInfo.PdeBase = MM_PDE_BASE;
MmpPageMapInfo.PpeBase = MM_PPE_BASE;
MmpPageMapInfo.PxeBase = MM_PXE_BASE;
MmpPageMapInfo.P5eBase = 0x0;
}
}
/**

View File

@ -20,7 +20,33 @@ XTAPI
VOID
MmInitializePageMapSupport(VOID)
{
UNIMPLEMENTED;
/* Check if XPA is enabled */
if(MmpGetExtendedPhysicalAddressingStatus())
{
/* Set PML3 page map information */
MmpPageMapInfo.Xpa = TRUE;
/* Set PML3 base addresses */
MmpPageMapInfo.PteBase = MM_PTE_BASE;
MmpPageMapInfo.PdeBase = MM_PDE_BASE;
/* Set PML3 shift values */
MmpPageMapInfo.PdiShift = MM_PDI_SHIFT;
MmpPageMapInfo.PteShift = MM_PTE_SHIFT;
}
else
{
/* Set PML2 page map information */
MmpPageMapInfo.Xpa = FALSE;
/* Set PML2 base addresses */
MmpPageMapInfo.PteBase = MM_PTE_BASE;
MmpPageMapInfo.PdeBase = MM_PDE_LEGACY_BASE;
/* Set PML2 shift values */
MmpPageMapInfo.PdiShift = MM_PDI_LEGACY_SHIFT;
MmpPageMapInfo.PteShift = MM_PTE_LEGACY_SHIFT;
}
}
/**