diff options
author | Sandrine Bailleux <sandrine.bailleux@arm.com> | 2017-04-19 14:02:23 +0100 |
---|---|---|
committer | Sandrine Bailleux <sandrine.bailleux@arm.com> | 2017-04-20 13:01:24 +0100 |
commit | 28fa2e9ee8f40ec25491d7bdba8e3aaf2985091a (patch) | |
tree | 48c2c30c07738246d3f42ffdeb42973bfce7e8ca /lib/xlat_tables_v2 | |
parent | 3d21c9452d4d5e17f545848bc4641274cdd6aa26 (diff) |
xlat lib: Use mmap_attr_t type consistently
This patch modifies both versions of the translation table library
to use the mmap_attr_t type consistently wherever it is manipulating
MT_* attributes variables. It used to use mmap_attr_t or plain integer
types interchangeably, which compiles fine because an enumeration type
can be silently converted to an integer, but which is semantically
incorrect.
This patch removes this assumption by using the abstract type
'mmap_attr_t' all the time.
Change-Id: Id1f099025d2cb962b275bb7e39ad2c4dbb4e366c
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Diffstat (limited to 'lib/xlat_tables_v2')
-rw-r--r-- | lib/xlat_tables_v2/xlat_tables_common.c | 4 | ||||
-rw-r--r-- | lib/xlat_tables_v2/xlat_tables_internal.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/xlat_tables_v2/xlat_tables_common.c b/lib/xlat_tables_v2/xlat_tables_common.c index b4691a2b..7ca81b9c 100644 --- a/lib/xlat_tables_v2/xlat_tables_common.c +++ b/lib/xlat_tables_v2/xlat_tables_common.c @@ -92,7 +92,7 @@ xlat_ctx_t tf_xlat_ctx = { }; void mmap_add_region(unsigned long long base_pa, uintptr_t base_va, - size_t size, unsigned int attr) + size_t size, mmap_attr_t attr) { mmap_region_t mm = { .base_va = base_va, @@ -114,7 +114,7 @@ void mmap_add(const mmap_region_t *mm) #if PLAT_XLAT_TABLES_DYNAMIC int mmap_add_dynamic_region(unsigned long long base_pa, - uintptr_t base_va, size_t size, unsigned int attr) + uintptr_t base_va, size_t size, mmap_attr_t attr) { mmap_region_t mm = { .base_va = base_va, diff --git a/lib/xlat_tables_v2/xlat_tables_internal.c b/lib/xlat_tables_v2/xlat_tables_internal.c index 2f03306e..581f7703 100644 --- a/lib/xlat_tables_v2/xlat_tables_internal.c +++ b/lib/xlat_tables_v2/xlat_tables_internal.c @@ -115,7 +115,7 @@ static uint64_t *xlat_table_get_empty(xlat_ctx_t *ctx) #endif /* PLAT_XLAT_TABLES_DYNAMIC */ /* Returns a block/page table descriptor for the given level and attributes. */ -static uint64_t xlat_desc(unsigned int attr, unsigned long long addr_pa, +static uint64_t xlat_desc(mmap_attr_t attr, unsigned long long addr_pa, int level) { uint64_t desc; @@ -609,7 +609,7 @@ void print_mmap(mmap_region_t *const mmap) */ static int mmap_add_region_check(xlat_ctx_t *ctx, unsigned long long base_pa, uintptr_t base_va, size_t size, - unsigned int attr) + mmap_attr_t attr) { mmap_region_t *mm = ctx->mmap; unsigned long long end_pa = base_pa + size - 1; |