diff options
author | Olivier Martin <olivier.martin@arm.com> | 2013-09-02 13:12:17 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-09-02 13:12:17 +0000 |
commit | b75d7605b4c09d5d431c2d57f70341c2f43de3c3 (patch) | |
tree | 7fde6f54eb2a1674e47b9cb7d49aedf71c86a8f2 | |
parent | c6ba1c12851d4e628410094684a697006a465628 (diff) | |
download | edk2-b75d7605b4c09d5d431c2d57f70341c2f43de3c3.tar.gz edk2-b75d7605b4c09d5d431c2d57f70341c2f43de3c3.tar.bz2 edk2-b75d7605b4c09d5d431c2d57f70341c2f43de3c3.zip |
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
-rw-r--r-- | ArmPkg/Drivers/CpuDxe/ArmV6/Mmu.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ArmPkg/Drivers/CpuDxe/ArmV6/Mmu.c b/ArmPkg/Drivers/CpuDxe/ArmV6/Mmu.c index 474f105d22..2896f708a4 100644 --- a/ArmPkg/Drivers/CpuDxe/ArmV6/Mmu.c +++ b/ArmPkg/Drivers/CpuDxe/ArmV6/Mmu.c @@ -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;
|