aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2020-03-09 17:39:27 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2020-03-11 11:31:46 +0900
commite28224583e86bebf39375b327995c9333f6b7966 (patch)
tree458e8720ed254752fe1785054a187b1d154497ee
parent363830df1c28e240ed1132c6ce41f4a4b3efb8d8 (diff)
downloadplatform_external_arm-trusted-firmware-e28224583e86bebf39375b327995c9333f6b7966.tar.gz
platform_external_arm-trusted-firmware-e28224583e86bebf39375b327995c9333f6b7966.tar.bz2
platform_external_arm-trusted-firmware-e28224583e86bebf39375b327995c9333f6b7966.zip
xlat_tables_v2: use ARRAY_SIZE in REGISTER_XLAT_CONTEXT_FULL_SPEC
With this, it is clearer that .base_table_entries and .tables_num are the array size of .base_table and .tables, respectively. Change-Id: I634e65aba835ab9908cc3919355df6bc6e18d42a Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-rw-r--r--include/lib/xlat_tables/xlat_tables_v2_helpers.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/lib/xlat_tables/xlat_tables_v2_helpers.h b/include/lib/xlat_tables/xlat_tables_v2_helpers.h
index 4a72391a1..62f853d18 100644
--- a/include/lib/xlat_tables/xlat_tables_v2_helpers.h
+++ b/include/lib/xlat_tables/xlat_tables_v2_helpers.h
@@ -24,6 +24,7 @@
#include <platform_def.h>
#include <lib/cassert.h>
+#include <lib/utils_def.h>
#include <lib/xlat_tables/xlat_tables_arch.h>
#include <lib/xlat_tables/xlat_tables_defs.h>
@@ -160,13 +161,13 @@ struct xlat_ctx {
.mmap = _ctx_name##_mmap, \
.mmap_num = (_mmap_count), \
.tables = _ctx_name##_xlat_tables, \
- .tables_num = _xlat_tables_count, \
+ .tables_num = ARRAY_SIZE(_ctx_name##_xlat_tables), \
XLAT_CTX_INIT_TABLE_ATTR() \
XLAT_REGISTER_DYNMAP_STRUCT(_ctx_name) \
.next_table = 0, \
.base_table = _ctx_name##_base_xlat_table, \
.base_table_entries = \
- GET_NUM_BASE_LEVEL_ENTRIES(_virt_addr_space_size),\
+ ARRAY_SIZE(_ctx_name##_base_xlat_table), \
.max_pa = 0U, \
.max_va = 0U, \
.base_level = GET_XLAT_TABLE_LEVEL_BASE(_virt_addr_space_size),\