summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSandrine Bailleux <sandrine.bailleux@arm.com>2016-09-15 09:24:54 +0100
committerSandrine Bailleux <sandrine.bailleux@arm.com>2016-09-15 10:18:50 +0100
commite03f0b0861f757a0ec2017bd29aeb009d0305845 (patch)
tree82d5c2bb6bf02e0637ecd22901559f0381dcc773 /include
parent77b05323921c23e4261ddd8fee5c326a79b0af97 (diff)
Restore some defines in xlat_tables.h
Commit e8719552a24 removed some definitions related to translation tables from the xlat_tables.h header file, based on the assumption that they weren't used by any platform. These are actually used by some partners so this patch restores them. Fixes ARM-software/tf-issues#425 Change-Id: Idafa5f00bb0bd9c2847b5ae6541cf8db93c7b89a
Diffstat (limited to 'include')
-rw-r--r--include/lib/xlat_tables.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/lib/xlat_tables.h b/include/lib/xlat_tables.h
index d2ac6db6..0e9800ab 100644
--- a/include/lib/xlat_tables.h
+++ b/include/lib/xlat_tables.h
@@ -32,13 +32,27 @@
#define __XLAT_TABLES_H__
/* Miscellaneous MMU related constants */
+#define NUM_2MB_IN_GB (1 << 9)
+#define NUM_4K_IN_2MB (1 << 9)
+#define NUM_GB_IN_4GB (1 << 2)
+
+#define TWO_MB_SHIFT 21
+#define ONE_GB_SHIFT 30
#define FOUR_KB_SHIFT 12
+#define ONE_GB_INDEX(x) ((x) >> ONE_GB_SHIFT)
+#define TWO_MB_INDEX(x) ((x) >> TWO_MB_SHIFT)
+#define FOUR_KB_INDEX(x) ((x) >> FOUR_KB_SHIFT)
+
#define INVALID_DESC 0x0
#define BLOCK_DESC 0x1 /* Table levels 0-2 */
#define TABLE_DESC 0x3 /* Table levels 0-2 */
#define PAGE_DESC 0x3 /* Table level 3 */
+#define FIRST_LEVEL_DESC_N ONE_GB_SHIFT
+#define SECOND_LEVEL_DESC_N TWO_MB_SHIFT
+#define THIRD_LEVEL_DESC_N FOUR_KB_SHIFT
+
#define XN (1ull << 2)
#define PXN (1ull << 1)
#define CONT_HINT (1ull << 0)