diff options
author | davidcunado-arm <david.cunado@arm.com> | 2017-04-24 14:40:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-24 14:40:16 +0100 |
commit | 0c7c44110e3637de573131ac25f33540c0a103ac (patch) | |
tree | 4bf937283106a73141aeae9664398fba3d848fb1 /lib | |
parent | 3fb340a2b45740d7233490ac9801d530403529e7 (diff) | |
parent | 28fa2e9ee8f40ec25491d7bdba8e3aaf2985091a (diff) |
Merge pull request #909 from sandrine-bailleux-arm/sb/xlat-lib-misc-improvements
xlat lib: Use mmap_attr_t type consistently
Diffstat (limited to 'lib')
-rw-r--r-- | lib/xlat_tables/xlat_tables_common.c | 11 | ||||
-rw-r--r-- | lib/xlat_tables_v2/xlat_tables_common.c | 4 | ||||
-rw-r--r-- | lib/xlat_tables_v2/xlat_tables_internal.c | 4 |
3 files changed, 10 insertions, 9 deletions
diff --git a/lib/xlat_tables/xlat_tables_common.c b/lib/xlat_tables/xlat_tables_common.c index 4b25d0e8..4426ccef 100644 --- a/lib/xlat_tables/xlat_tables_common.c +++ b/lib/xlat_tables/xlat_tables_common.c @@ -87,7 +87,7 @@ void print_mmap(void) } 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 = mmap; mmap_region_t *mm_last = mm + ARRAY_SIZE(mmap) - 1; @@ -199,7 +199,7 @@ void mmap_add(const mmap_region_t *mm) } } -static uint64_t mmap_desc(unsigned attr, unsigned long long addr_pa, +static uint64_t mmap_desc(mmap_attr_t attr, unsigned long long addr_pa, int level) { uint64_t desc; @@ -277,11 +277,11 @@ static uint64_t mmap_desc(unsigned attr, unsigned long long addr_pa, * attributes of the innermost region that contains it. If there are partial * overlaps, it returns -1, as a smaller size is needed. */ -static int mmap_region_attr(mmap_region_t *mm, uintptr_t base_va, +static mmap_attr_t mmap_region_attr(mmap_region_t *mm, uintptr_t base_va, size_t size) { /* Don't assume that the area is contained in the first region */ - int attr = -1; + mmap_attr_t attr = -1; /* * Get attributes from last (innermost) region that contains the @@ -360,7 +360,8 @@ static mmap_region_t *init_xlation_table_inner(mmap_region_t *mm, * there are partially overlapping regions. On success, * it will return the innermost region's attributes. */ - int attr = mmap_region_attr(mm, base_va, level_size); + mmap_attr_t attr = mmap_region_attr(mm, base_va, + level_size); if (attr >= 0) { desc = mmap_desc(attr, base_va - mm->base_va + mm->base_pa, 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; |