summaryrefslogtreecommitdiff
path: root/lib/xlat_tables
diff options
context:
space:
mode:
authorSoby Mathew <soby.mathew@arm.com>2016-06-16 14:52:04 +0100
committerSoby Mathew <soby.mathew@arm.com>2016-07-18 17:52:15 +0100
commit4c0d03907652fdf9c66a02cec9ea7137ccccd2e9 (patch)
tree3ab28ec623c7e252dc38a222ea9f88d6856d25de /lib/xlat_tables
parentaadb1350eed3c18aec6cd999519cef55d93678b3 (diff)
Rework type usage in Trusted Firmware
This patch reworks type usage in generic code, drivers and ARM platform files to make it more portable. The major changes done with respect to type usage are as listed below: * Use uintptr_t for storing address instead of uint64_t or unsigned long. * Review usage of unsigned long as it can no longer be assumed to be 64 bit. * Use u_register_t for register values whose width varies depending on whether AArch64 or AArch32. * Use generic C types where-ever possible. In addition to the above changes, this patch also modifies format specifiers in print invocations so that they are AArch64/AArch32 agnostic. Only files related to upcoming feature development have been reworked. Change-Id: I9f8c78347c5a52ba7027ff389791f1dad63ee5f8
Diffstat (limited to 'lib/xlat_tables')
-rw-r--r--lib/xlat_tables/aarch64/xlat_tables.c1
-rw-r--r--lib/xlat_tables/xlat_tables_common.c11
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/xlat_tables/aarch64/xlat_tables.c b/lib/xlat_tables/aarch64/xlat_tables.c
index 19eb7d5d..f4322375 100644
--- a/lib/xlat_tables/aarch64/xlat_tables.c
+++ b/lib/xlat_tables/aarch64/xlat_tables.c
@@ -47,7 +47,6 @@
CASSERT(ADDR_SPACE_SIZE >= (1ull << 31) && ADDR_SPACE_SIZE <= (1ull << 39) &&
IS_POWER_OF_TWO(ADDR_SPACE_SIZE), assert_valid_addr_space_size);
-#define UNSET_DESC ~0ul
#define NUM_L1_ENTRIES (ADDR_SPACE_SIZE >> L1_XLAT_ADDRESS_SHIFT)
static uint64_t l1_xlation_table[NUM_L1_ENTRIES]
diff --git a/lib/xlat_tables/xlat_tables_common.c b/lib/xlat_tables/xlat_tables_common.c
index 71e3efca..33784c2d 100644
--- a/lib/xlat_tables/xlat_tables_common.c
+++ b/lib/xlat_tables/xlat_tables_common.c
@@ -35,6 +35,7 @@
#include <debug.h>
#include <platform_def.h>
#include <string.h>
+#include <types.h>
#include <utils.h>
#include <xlat_tables.h>
@@ -52,7 +53,7 @@
#define debug_print(...) ((void)0)
#endif
-#define UNSET_DESC ~0ul
+#define UNSET_DESC ~0ull
static uint64_t xlat_tables[MAX_XLAT_TABLES][XLAT_TABLE_ENTRIES]
__aligned(XLAT_TABLE_SIZE) __section("xlat_table");
@@ -313,9 +314,9 @@ static mmap_region_t *init_xlation_table_inner(mmap_region_t *mm,
unsigned level_size_shift = L1_XLAT_ADDRESS_SHIFT - (level - 1) *
XLAT_TABLE_ENTRIES_SHIFT;
unsigned level_size = 1 << level_size_shift;
- unsigned long long level_index_mask =
- ((unsigned long long) XLAT_TABLE_ENTRIES_MASK)
- << level_size_shift;
+ u_register_t level_index_mask =
+ (u_register_t)(((u_register_t) XLAT_TABLE_ENTRIES_MASK)
+ << level_size_shift);
assert(level > 0 && level <= 3);
@@ -357,7 +358,7 @@ static mmap_region_t *init_xlation_table_inner(mmap_region_t *mm,
/* Area not covered by a region so need finer table */
uint64_t *new_table = xlat_tables[next_xlat++];
assert(next_xlat <= MAX_XLAT_TABLES);
- desc = TABLE_DESC | (uint64_t)new_table;
+ desc = TABLE_DESC | (uintptr_t)new_table;
/* Recurse to fill in new table */
mm = init_xlation_table_inner(mm, base_va,