Revision: 14617
          http://sourceforge.net/p/edk2/code/14617
Author:   oliviermartin
Date:     2013-09-02 13:12:17 +0000 (Mon, 02 Sep 2013)
Log Message:
-----------
ArmPkg/CpuDxe: Fixed calculation of the Page Table Index (Level 2 Descriptor)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <[email protected]>

Modified Paths:
--------------
    trunk/edk2/ArmPkg/Drivers/CpuDxe/ArmV6/Mmu.c

Modified: trunk/edk2/ArmPkg/Drivers/CpuDxe/ArmV6/Mmu.c
===================================================================
--- trunk/edk2/ArmPkg/Drivers/CpuDxe/ArmV6/Mmu.c        2013-09-02 09:10:17 UTC 
(rev 14616)
+++ trunk/edk2/ArmPkg/Drivers/CpuDxe/ArmV6/Mmu.c        2013-09-02 13:12:17 UTC 
(rev 14617)
@@ -768,7 +768,7 @@
   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 @@
     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;

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to