Revision: 14777
http://sourceforge.net/p/edk2/code/14777
Author: oliviermartin
Date: 2013-10-15 09:25:38 +0000 (Tue, 15 Oct 2013)
Log Message:
-----------
ArmPkg/Include/Chipset: Fix translation table address calculations for AARCH64
TT_ADDRESS_* macros were not casting immediate values to UINTN.
This causes shift operations to be off by 32-bits when calculating
addresses above 4GB. Any address above 4GB was being improperly calculated.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Garrett Kirkendall <[email protected]>
Signed-off-by: Olivier Martin <[email protected]>
Modified Paths:
--------------
trunk/edk2/ArmPkg/Include/Chipset/AArch64Mmu.h
Modified: trunk/edk2/ArmPkg/Include/Chipset/AArch64Mmu.h
===================================================================
--- trunk/edk2/ArmPkg/Include/Chipset/AArch64Mmu.h 2013-10-15 06:13:14 UTC
(rev 14776)
+++ trunk/edk2/ArmPkg/Include/Chipset/AArch64Mmu.h 2013-10-15 09:25:38 UTC
(rev 14777)
@@ -33,15 +33,15 @@
// The first offset starts at 12bit. There are 4 levels of 9-bit address range
from level 3 to level 0
#define TT_ADDRESS_OFFSET_AT_LEVEL(TableLevel) (12 + ((3 - (TableLevel)) * 9))
-#define TT_BLOCK_ENTRY_SIZE_AT_LEVEL(Level) (1 <<
TT_ADDRESS_OFFSET_AT_LEVEL(Level))
+#define TT_BLOCK_ENTRY_SIZE_AT_LEVEL(Level) (1ULL <<
TT_ADDRESS_OFFSET_AT_LEVEL(Level))
// Get the associated entry in the given Translation Table
#define TT_GET_ENTRY_FOR_ADDRESS(TranslationTable, Level, Address) \
- ((UINTN)(TranslationTable) + ((((Address) >>
TT_ADDRESS_OFFSET_AT_LEVEL(Level)) & (BIT9-1)) * sizeof(UINT64)))
+ ((UINTN)(TranslationTable) + ((((UINTN)(Address) >>
TT_ADDRESS_OFFSET_AT_LEVEL(Level)) & (BIT9-1)) * sizeof(UINT64)))
// Return the smallest address granularity from the table level.
// The first offset starts at 12bit. There are 4 levels of 9-bit address range
from level 3 to level 0
-#define TT_ADDRESS_AT_LEVEL(TableLevel) (1 <<
TT_ADDRESS_OFFSET_AT_LEVEL(TableLevel))
+#define TT_ADDRESS_AT_LEVEL(TableLevel) (1ULL <<
TT_ADDRESS_OFFSET_AT_LEVEL(TableLevel))
#define TT_LAST_BLOCK_ADDRESS(TranslationTable, EntryCount) \
((UINT64*)((EFI_PHYSICAL_ADDRESS)(TranslationTable) + (((EntryCount) - 1)
* sizeof(UINT64))))
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits