mirror of https://github.com/acidanthera/audk.git
ArmPkg/CpuDxe: Fixed calculation of the Page Table Index (Level 2 Descriptor)
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14617 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
c6ba1c1285
commit
b75d7605b4
|
@ -768,7 +768,7 @@ GetMemoryRegionPage (
|
|||
PageAttributes = ConvertSectionAttributesToPageAttributes (*RegionAttributes, 0);
|
||||
|
||||
// Calculate index into first level translation table for start of modification
|
||||
TableIndex = TT_DESCRIPTOR_PAGE_BASE_ADDRESS(*BaseAddress) >> TT_DESCRIPTOR_PAGE_BASE_SHIFT;
|
||||
TableIndex = ((*BaseAddress) & TT_DESCRIPTOR_PAGE_INDEX_MASK) >> TT_DESCRIPTOR_PAGE_BASE_SHIFT;
|
||||
ASSERT (TableIndex < TRANSLATION_TABLE_PAGE_COUNT);
|
||||
|
||||
// Go through the page table to find the end of the section
|
||||
|
@ -838,7 +838,7 @@ GetMemoryRegion (
|
|||
PageTable = (UINT32*)(SectionDescriptor & TT_DESCRIPTOR_SECTION_PAGETABLE_ADDRESS_MASK);
|
||||
|
||||
// Calculate index into first level translation table for start of modification
|
||||
PageTableIndex = TT_DESCRIPTOR_PAGE_BASE_ADDRESS (*BaseAddress) >> TT_DESCRIPTOR_PAGE_BASE_SHIFT;
|
||||
PageTableIndex = ((*BaseAddress) & TT_DESCRIPTOR_PAGE_INDEX_MASK) >> TT_DESCRIPTOR_PAGE_BASE_SHIFT;
|
||||
ASSERT (PageTableIndex < TRANSLATION_TABLE_PAGE_COUNT);
|
||||
|
||||
PageAttributes = PageTable[PageTableIndex] & TT_DESCRIPTOR_PAGE_ATTRIBUTE_MASK;
|
||||
|
|
Loading…
Reference in New Issue