diff options
author | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2018-08-05 15:34:10 +0100 |
---|---|---|
committer | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2018-08-06 09:45:50 +0100 |
commit | e5d5951973aaa153b7eff0d48384a4efe6014b7f (patch) | |
tree | 2c50fc97d69c54dfee283c41f5af977bdc27978e /lib/xlat_tables_v2 | |
parent | f68bc8a1c210bbdb36201a74528a96e93707eb45 (diff) |
xlat v2: Cleanup get/change mem attr helpers
Changed the names for consistency with the rest of the library. Introduced
new helpers that manipulate the active translation tables context.
Change-Id: Icaca56b67fcf6a96e88aa3c7e47411162e8e6856
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Diffstat (limited to 'lib/xlat_tables_v2')
-rw-r--r-- | lib/xlat_tables_v2/xlat_tables_context.c | 10 | ||||
-rw-r--r-- | lib/xlat_tables_v2/xlat_tables_utils.c | 20 |
2 files changed, 19 insertions, 11 deletions
diff --git a/lib/xlat_tables_v2/xlat_tables_context.c b/lib/xlat_tables_v2/xlat_tables_context.c index d7b2ebf8..143f08ab 100644 --- a/lib/xlat_tables_v2/xlat_tables_context.c +++ b/lib/xlat_tables_v2/xlat_tables_context.c @@ -90,6 +90,16 @@ void init_xlat_tables(void) init_xlat_tables_ctx(&tf_xlat_ctx); } +int xlat_get_mem_attributes(uintptr_t base_va, uint32_t *attr) +{ + return xlat_get_mem_attributes_ctx(&tf_xlat_ctx, base_va, attr); +} + +int xlat_change_mem_attributes(uintptr_t base_va, size_t size, uint32_t attr) +{ + return xlat_change_mem_attributes_ctx(&tf_xlat_ctx, base_va, size, attr); +} + /* * If dynamic allocation of new regions is disabled then by the time we call the * function enabling the MMU, we'll have registered all the memory regions to diff --git a/lib/xlat_tables_v2/xlat_tables_utils.c b/lib/xlat_tables_v2/xlat_tables_utils.c index 0cbd45e4..978a506c 100644 --- a/lib/xlat_tables_v2/xlat_tables_utils.c +++ b/lib/xlat_tables_v2/xlat_tables_utils.c @@ -314,8 +314,8 @@ static uint64_t *find_xlat_table_entry(uintptr_t virtual_addr, } -static int get_mem_attributes_internal(const xlat_ctx_t *ctx, uintptr_t base_va, - uint32_t *attributes, uint64_t **table_entry, +static int xlat_get_mem_attributes_internal(const xlat_ctx_t *ctx, + uintptr_t base_va, uint32_t *attributes, uint64_t **table_entry, unsigned long long *addr_pa, unsigned int *table_level) { uint64_t *entry; @@ -407,18 +407,16 @@ static int get_mem_attributes_internal(const xlat_ctx_t *ctx, uintptr_t base_va, } -int get_mem_attributes(const xlat_ctx_t *ctx, uintptr_t base_va, - uint32_t *attributes) +int xlat_get_mem_attributes_ctx(const xlat_ctx_t *ctx, uintptr_t base_va, + uint32_t *attr) { - return get_mem_attributes_internal(ctx, base_va, attributes, - NULL, NULL, NULL); + return xlat_get_mem_attributes_internal(ctx, base_va, attr, + NULL, NULL, NULL); } -int change_mem_attributes(const xlat_ctx_t *ctx, - uintptr_t base_va, - size_t size, - uint32_t attr) +int xlat_change_mem_attributes_ctx(const xlat_ctx_t *ctx, uintptr_t base_va, + size_t size, uint32_t attr) { /* Note: This implementation isn't optimized. */ @@ -517,7 +515,7 @@ int change_mem_attributes(const xlat_ctx_t *ctx, unsigned int level = 0U; unsigned long long addr_pa = 0ULL; - (void) get_mem_attributes_internal(ctx, base_va, &old_attr, + (void) xlat_get_mem_attributes_internal(ctx, base_va, &old_attr, &entry, &addr_pa, &level); /* |