Commit e2822458 authored by Masahiro Yamada's avatar Masahiro Yamada
Browse files

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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent 363830df
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <platform_def.h> #include <platform_def.h>
#include <lib/cassert.h> #include <lib/cassert.h>
#include <lib/utils_def.h>
#include <lib/xlat_tables/xlat_tables_arch.h> #include <lib/xlat_tables/xlat_tables_arch.h>
#include <lib/xlat_tables/xlat_tables_defs.h> #include <lib/xlat_tables/xlat_tables_defs.h>
...@@ -160,13 +161,13 @@ struct xlat_ctx { ...@@ -160,13 +161,13 @@ struct xlat_ctx {
.mmap = _ctx_name##_mmap, \ .mmap = _ctx_name##_mmap, \
.mmap_num = (_mmap_count), \ .mmap_num = (_mmap_count), \
.tables = _ctx_name##_xlat_tables, \ .tables = _ctx_name##_xlat_tables, \
.tables_num = _xlat_tables_count, \ .tables_num = ARRAY_SIZE(_ctx_name##_xlat_tables), \
XLAT_CTX_INIT_TABLE_ATTR() \ XLAT_CTX_INIT_TABLE_ATTR() \
XLAT_REGISTER_DYNMAP_STRUCT(_ctx_name) \ XLAT_REGISTER_DYNMAP_STRUCT(_ctx_name) \
.next_table = 0, \ .next_table = 0, \
.base_table = _ctx_name##_base_xlat_table, \ .base_table = _ctx_name##_base_xlat_table, \
.base_table_entries = \ .base_table_entries = \
GET_NUM_BASE_LEVEL_ENTRIES(_virt_addr_space_size),\ ARRAY_SIZE(_ctx_name##_base_xlat_table), \
.max_pa = 0U, \ .max_pa = 0U, \
.max_va = 0U, \ .max_va = 0U, \
.base_level = GET_XLAT_TABLE_LEVEL_BASE(_virt_addr_space_size),\ .base_level = GET_XLAT_TABLE_LEVEL_BASE(_virt_addr_space_size),\
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment