diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/stdlib/assert.c | 33 | ||||
-rw-r--r-- | lib/xlat_tables_v2/aarch64/xlat_tables_arch.c | 2 | ||||
-rw-r--r-- | lib/xlat_tables_v2/xlat_tables_common.c | 2 | ||||
-rw-r--r-- | lib/xlat_tables_v2/xlat_tables_private.h | 10 |
4 files changed, 32 insertions, 15 deletions
diff --git a/lib/stdlib/assert.c b/lib/stdlib/assert.c index 5220ad8f..41f70703 100644 --- a/lib/stdlib/assert.c +++ b/lib/stdlib/assert.c @@ -4,22 +4,33 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#include <assert.h> #include <console.h> #include <debug.h> #include <platform.h> -void __assert(const char *function, const char *file, unsigned int line, - const char *assertion) -{ -#if LOG_LEVEL >= LOG_LEVEL_INFO - /* - * Only print the output if LOG_LEVEL is higher or equal to - * LOG_LEVEL_INFO, which is the default value for builds with DEBUG=1. - */ - tf_printf("ASSERT: %s <%d> : %s\n", function, line, assertion); +/* +* Only print the output if PLAT_LOG_LEVEL_ASSERT is higher or equal to +* LOG_LEVEL_INFO, which is the default value for builds with DEBUG=1. +*/ +#if PLAT_LOG_LEVEL_ASSERT >= LOG_LEVEL_VERBOSE +void __assert(const char *file, unsigned int line, const char *assertion) +{ + tf_printf("ASSERT: %s <%d> : %s\n", file, line, assertion); console_flush(); -#endif - plat_panic_handler(); } +#elif PLAT_LOG_LEVEL_ASSERT >= LOG_LEVEL_INFO +void __assert(const char *file, unsigned int line) +{ + tf_printf("ASSERT: %s <%d>\n", file, line); + console_flush(); + plat_panic_handler(); +} +#else +void __assert(void) +{ + plat_panic_handler(); +} +#endif diff --git a/lib/xlat_tables_v2/aarch64/xlat_tables_arch.c b/lib/xlat_tables_v2/aarch64/xlat_tables_arch.c index cc41fc3e..14f6cd6a 100644 --- a/lib/xlat_tables_v2/aarch64/xlat_tables_arch.c +++ b/lib/xlat_tables_v2/aarch64/xlat_tables_arch.c @@ -60,7 +60,7 @@ static const unsigned int pa_range_bits_arr[] = { PARANGE_0101 }; -unsigned long long xlat_arch_get_max_supported_pa(void) +static unsigned long long xlat_arch_get_max_supported_pa(void) { u_register_t pa_range = read_id_aa64mmfr0_el1() & ID_AA64MMFR0_EL1_PARANGE_MASK; diff --git a/lib/xlat_tables_v2/xlat_tables_common.c b/lib/xlat_tables_v2/xlat_tables_common.c index a6f3b7ce..f20bf93a 100644 --- a/lib/xlat_tables_v2/xlat_tables_common.c +++ b/lib/xlat_tables_v2/xlat_tables_common.c @@ -34,8 +34,6 @@ static uint64_t tf_xlat_tables[MAX_XLAT_TABLES][XLAT_TABLE_ENTRIES] static uint64_t tf_base_xlat_table[NUM_BASE_LEVEL_ENTRIES] __aligned(NUM_BASE_LEVEL_ENTRIES * sizeof(uint64_t)); -static mmap_region_t tf_mmap[MAX_MMAP_REGIONS + 1]; - #if PLAT_XLAT_TABLES_DYNAMIC static int xlat_tables_mapped_regions[MAX_XLAT_TABLES]; #endif /* PLAT_XLAT_TABLES_DYNAMIC */ diff --git a/lib/xlat_tables_v2/xlat_tables_private.h b/lib/xlat_tables_v2/xlat_tables_private.h index 07bf39f1..7b3e555e 100644 --- a/lib/xlat_tables_v2/xlat_tables_private.h +++ b/lib/xlat_tables_v2/xlat_tables_private.h @@ -47,8 +47,11 @@ typedef struct { * Array of all memory regions stored in order of ascending end address * and ascending size to simplify the code that allows overlapping * regions. The list is terminated by the first entry with size == 0. + * The max size of the list is stored in `mmap_num`. `mmap` points to an + * array of mmap_num + 1 elements, so that there is space for the final + * null entry. */ - mmap_region_t *mmap; /* mmap_num + 1 elements */ + mmap_region_t *mmap; int mmap_num; /* @@ -75,6 +78,11 @@ typedef struct { uint64_t *base_table; int base_table_entries; + /* + * Max Physical and Virtual addresses currently in use by the + * translation tables. These might get updated as we map/unmap memory + * regions but they will never go beyond pa/va_max_address. + */ unsigned long long max_pa; uintptr_t max_va; |