libc: Use printf and snprintf across codebase
tf_printf and tf_snprintf are now called printf and snprintf, so the
code needs to be updated.
Change-Id: Iffeee97afcd6328c4c2d30830d4923b964682d71
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
diff --git a/lib/libc/assert.c b/lib/libc/assert.c
index 2d2396c..fa12cb6 100644
--- a/lib/libc/assert.c
+++ b/lib/libc/assert.c
@@ -9,6 +9,7 @@
#include <console.h>
#include <debug.h>
#include <platform.h>
+#include <stdio.h>
/*
* Only print the output if PLAT_LOG_LEVEL_ASSERT is higher or equal to
@@ -18,14 +19,14 @@
#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);
+ printf("ASSERT: %s:%d:%s\n", file, line, assertion);
console_flush();
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);
+ printf("ASSERT: %s:%d\n", file, line);
console_flush();
plat_panic_handler();
}
diff --git a/lib/libc/printf.c b/lib/libc/printf.c
index a1a8024..4f4a722 100644
--- a/lib/libc/printf.c
+++ b/lib/libc/printf.c
@@ -9,7 +9,7 @@
#include <stdint.h>
/***********************************************************
- * The tf_printf implementation for all BL stages
+ * The printf implementation for all BL stages
***********************************************************/
#define get_num_va_args(_args, _lcount) \
diff --git a/lib/pmf/pmf_main.c b/lib/pmf/pmf_main.c
index 0208948..a020860 100644
--- a/lib/pmf/pmf_main.c
+++ b/lib/pmf/pmf_main.c
@@ -178,7 +178,7 @@
*/
void __pmf_dump_timestamp(unsigned int tid, unsigned long long ts)
{
- tf_printf("PMF:cpu %u tid %u ts %llu\n",
+ printf("PMF:cpu %u tid %u ts %llu\n",
plat_my_core_pos(), tid, ts);
}
diff --git a/lib/xlat_tables/xlat_tables_common.c b/lib/xlat_tables/xlat_tables_common.c
index 9632601..ca67f2a 100644
--- a/lib/xlat_tables/xlat_tables_common.c
+++ b/lib/xlat_tables/xlat_tables_common.c
@@ -27,7 +27,7 @@
(((level) == U(0)) ? LVL0_SPACER : \
(((level) == U(1)) ? LVL1_SPACER : \
(((level) == U(2)) ? LVL2_SPACER : LVL3_SPACER)))
-#define debug_print(...) tf_printf(__VA_ARGS__)
+#define debug_print(...) printf(__VA_ARGS__)
#else
#define debug_print(...) ((void)0)
#endif
diff --git a/lib/xlat_tables_v2/xlat_tables_utils.c b/lib/xlat_tables_v2/xlat_tables_utils.c
index aef3c9a..41c01ae 100644
--- a/lib/xlat_tables_v2/xlat_tables_utils.c
+++ b/lib/xlat_tables_v2/xlat_tables_utils.c
@@ -11,6 +11,7 @@
#include <platform_def.h>
#include <stdbool.h>
#include <stdint.h>
+#include <stdio.h>
#include <utils_def.h>
#include <xlat_tables_defs.h>
#include <xlat_tables_v2.h>
@@ -33,16 +34,16 @@
void xlat_mmap_print(const mmap_region_t *mmap)
{
- tf_printf("mmap:\n");
+ printf("mmap:\n");
const mmap_region_t *mm = mmap;
while (mm->size != 0U) {
- tf_printf(" VA:0x%lx PA:0x%llx size:0x%zx attr:0x%x "
- "granularity:0x%zx\n", mm->base_va, mm->base_pa,
- mm->size, mm->attr, mm->granularity);
+ printf(" VA:0x%lx PA:0x%llx size:0x%zx attr:0x%x granularity:0x%zx\n",
+ mm->base_va, mm->base_pa, mm->size, mm->attr,
+ mm->granularity);
++mm;
};
- tf_printf("\n");
+ printf("\n");
}
/* Print the attributes of the specified block descriptor. */
@@ -52,18 +53,18 @@
int xlat_regime = ctx->xlat_regime;
if (mem_type_index == ATTR_IWBWA_OWBWA_NTR_INDEX) {
- tf_printf("MEM");
+ printf("MEM");
} else if (mem_type_index == ATTR_NON_CACHEABLE_INDEX) {
- tf_printf("NC");
+ printf("NC");
} else {
assert(mem_type_index == ATTR_DEVICE_INDEX);
- tf_printf("DEV");
+ printf("DEV");
}
if ((xlat_regime == EL3_REGIME) || (xlat_regime == EL2_REGIME)) {
/* For EL3 and EL2 only check the AP[2] and XN bits. */
- tf_printf(((desc & LOWER_ATTRS(AP_RO)) != 0ULL) ? "-RO" : "-RW");
- tf_printf(((desc & UPPER_ATTRS(XN)) != 0ULL) ? "-XN" : "-EXEC");
+ printf(((desc & LOWER_ATTRS(AP_RO)) != 0ULL) ? "-RO" : "-RW");
+ printf(((desc & UPPER_ATTRS(XN)) != 0ULL) ? "-XN" : "-EXEC");
} else {
assert(xlat_regime == EL1_EL0_REGIME);
/*
@@ -81,18 +82,18 @@
assert((xn_perm == xn_mask) || (xn_perm == 0ULL));
#endif
- tf_printf(((desc & LOWER_ATTRS(AP_RO)) != 0ULL) ? "-RO" : "-RW");
+ printf(((desc & LOWER_ATTRS(AP_RO)) != 0ULL) ? "-RO" : "-RW");
/* Only check one of PXN and UXN, the other one is the same. */
- tf_printf(((desc & UPPER_ATTRS(PXN)) != 0ULL) ? "-XN" : "-EXEC");
+ printf(((desc & UPPER_ATTRS(PXN)) != 0ULL) ? "-XN" : "-EXEC");
/*
* Privileged regions can only be accessed from EL1, user
* regions can be accessed from EL1 and EL0.
*/
- tf_printf(((desc & LOWER_ATTRS(AP_ACCESS_UNPRIVILEGED)) != 0ULL)
+ printf(((desc & LOWER_ATTRS(AP_ACCESS_UNPRIVILEGED)) != 0ULL)
? "-USER" : "-PRIV");
}
- tf_printf(((LOWER_ATTRS(NS) & desc) != 0ULL) ? "-NS" : "-S");
+ printf(((LOWER_ATTRS(NS) & desc) != 0ULL) ? "-NS" : "-S");
}
static const char * const level_spacers[] = {
@@ -135,18 +136,18 @@
if ((desc & DESC_MASK) == INVALID_DESC) {
if (invalid_row_count == 0) {
- tf_printf("%sVA:0x%lx size:0x%zx\n",
- level_spacers[level],
- table_idx_va, level_size);
+ printf("%sVA:0x%lx size:0x%zx\n",
+ level_spacers[level],
+ table_idx_va, level_size);
}
invalid_row_count++;
} else {
if (invalid_row_count > 1) {
- tf_printf(invalid_descriptors_ommited,
- level_spacers[level],
- invalid_row_count - 1);
+ printf(invalid_descriptors_ommited,
+ level_spacers[level],
+ invalid_row_count - 1);
}
invalid_row_count = 0;
@@ -163,9 +164,9 @@
* but instead points to the next translation
* table in the translation table walk.
*/
- tf_printf("%sVA:0x%lx size:0x%zx\n",
- level_spacers[level],
- table_idx_va, level_size);
+ printf("%sVA:0x%lx size:0x%zx\n",
+ level_spacers[level],
+ table_idx_va, level_size);
uintptr_t addr_inner = desc & TABLE_ADDR_MASK;
@@ -173,13 +174,12 @@
(uint64_t *)addr_inner,
XLAT_TABLE_ENTRIES, level + 1U);
} else {
- tf_printf("%sVA:0x%lx PA:0x%llx size:0x%zx ",
- level_spacers[level],
- table_idx_va,
- (uint64_t)(desc & TABLE_ADDR_MASK),
- level_size);
+ printf("%sVA:0x%lx PA:0x%llx size:0x%zx ",
+ level_spacers[level], table_idx_va,
+ (uint64_t)(desc & TABLE_ADDR_MASK),
+ level_size);
xlat_desc_print(ctx, desc);
- tf_printf("\n");
+ printf("\n");
}
}
@@ -188,8 +188,8 @@
}
if (invalid_row_count > 1) {
- tf_printf(invalid_descriptors_ommited,
- level_spacers[level], invalid_row_count - 1);
+ printf(invalid_descriptors_ommited,
+ level_spacers[level], invalid_row_count - 1);
}
}
@@ -364,7 +364,7 @@
#if LOG_LEVEL >= LOG_LEVEL_VERBOSE
VERBOSE("Attributes: ");
xlat_desc_print(ctx, desc);
- tf_printf("\n");
+ printf("\n");
#endif /* LOG_LEVEL >= LOG_LEVEL_VERBOSE */
assert(attributes != NULL);