diff options
author | Olivier Martin <olivier.martin@arm.com> | 2013-08-19 17:36:16 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-08-19 17:36:16 +0000 |
commit | d9680b9485bcdc3810c3bafe78b939e30c328a56 (patch) | |
tree | 0fa5363bc404017647690ccb329e75557700f033 /ArmPkg/Include | |
parent | 48999d26c538a36c22333eb85ae2bf0275d09d07 (diff) | |
download | edk2-platforms-d9680b9485bcdc3810c3bafe78b939e30c328a56.tar.xz |
ArmPkg/ArmLib: Introduced TT_LAST_BLOCK_ADDRESS()
This macro return the address of the last entry of a translation table.
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@14565 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPkg/Include')
-rw-r--r-- | ArmPkg/Include/Chipset/AArch64Mmu.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ArmPkg/Include/Chipset/AArch64Mmu.h b/ArmPkg/Include/Chipset/AArch64Mmu.h index 0799734a19..17c28fa205 100644 --- a/ArmPkg/Include/Chipset/AArch64Mmu.h +++ b/ArmPkg/Include/Chipset/AArch64Mmu.h @@ -43,6 +43,9 @@ // 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_LAST_BLOCK_ADDRESS(TranslationTable, EntryCount) \
+ ((UINT64*)((EFI_PHYSICAL_ADDRESS)(TranslationTable) + (((EntryCount) - 1) * sizeof(UINT64))))
+
// There are 512 entries per table when 4K Granularity
#define TT_ENTRY_COUNT 512
#define TT_ALIGNMENT_BLOCK_ENTRY BIT12
|