summaryrefslogtreecommitdiff
path: root/bl32
diff options
context:
space:
mode:
authorSoby Mathew <soby.mathew@arm.com>2014-06-12 17:23:58 +0100
committerSoby Mathew <soby.mathew@arm.com>2014-07-25 12:18:33 +0100
commitb79af9344503b2d7b435451cfb8b1ab80b8afdf4 (patch)
treed10f1c88279c9c5d481c82d6302d3989abc9bb3c /bl32
parenta1a441775f64da2cbbd42c4f2c6f818f93278fca (diff)
Implement a leaner printf for Trusted Firmware
This patch implements a "tf_printf" which supports only the commonly used format specifiers in Trusted Firmware, which uses a lot less stack space than the stdlib printf function. Fixes ARM-software/tf-issues#116 Change-Id: I7dfa1944f4c1e634b3e2d571f49afe02d109a351
Diffstat (limited to 'bl32')
-rw-r--r--bl32/tsp/tsp_interrupt.c6
-rw-r--r--bl32/tsp/tsp_main.c13
2 files changed, 9 insertions, 10 deletions
diff --git a/bl32/tsp/tsp_interrupt.c b/bl32/tsp/tsp_interrupt.c
index ff6bdc5c..c1c9aad2 100644
--- a/bl32/tsp/tsp_interrupt.c
+++ b/bl32/tsp/tsp_interrupt.c
@@ -56,7 +56,7 @@ void tsp_update_sync_fiq_stats(uint32_t type, uint64_t elr_el3)
tsp_stats[linear_id].sync_fiq_ret_count++;
spin_lock(&console_lock);
- printf("TSP: cpu 0x%x sync fiq request from 0x%llx \n\r",
+ tf_printf("TSP: cpu 0x%x sync fiq request from 0x%llx \n\r",
mpidr, elr_el3);
INFO("cpu 0x%x: %d sync fiq requests, %d sync fiq returns\n",
mpidr,
@@ -100,7 +100,7 @@ int32_t tsp_fiq_handler(void)
/* Update the statistics and print some messages */
tsp_stats[linear_id].fiq_count++;
spin_lock(&console_lock);
- printf("TSP: cpu 0x%x handled fiq %d \n\r",
+ tf_printf("TSP: cpu 0x%x handled fiq %d \n\r",
mpidr, id);
INFO("cpu 0x%x: %d fiq requests \n",
mpidr, tsp_stats[linear_id].fiq_count);
@@ -116,7 +116,7 @@ int32_t tsp_irq_received(void)
tsp_stats[linear_id].irq_count++;
spin_lock(&console_lock);
- printf("TSP: cpu 0x%x received irq\n\r", mpidr);
+ tf_printf("TSP: cpu 0x%x received irq\n\r", mpidr);
INFO("cpu 0x%x: %d irq requests \n",
mpidr, tsp_stats[linear_id].irq_count);
spin_unlock(&console_lock);
diff --git a/bl32/tsp/tsp_main.c b/bl32/tsp/tsp_main.c
index eaabe613..8844f41b 100644
--- a/bl32/tsp/tsp_main.c
+++ b/bl32/tsp/tsp_main.c
@@ -34,7 +34,6 @@
#include <platform.h>
#include <platform_def.h>
#include <spinlock.h>
-#include <stdio.h>
#include <tsp.h>
/*******************************************************************************
@@ -121,7 +120,7 @@ uint64_t tsp_main(void)
tsp_stats[linear_id].cpu_on_count++;
spin_lock(&console_lock);
- printf("TSP %s\n\r", build_message);
+ tf_printf("TSP %s\n\r", build_message);
INFO("Total memory base : 0x%x\n", (unsigned long)BL32_TOTAL_BASE);
INFO("Total memory size : 0x%x bytes\n",
(unsigned long)(BL32_TOTAL_LIMIT - BL32_TOTAL_BASE));
@@ -153,7 +152,7 @@ tsp_args_t *tsp_cpu_on_main(void)
tsp_stats[linear_id].cpu_on_count++;
spin_lock(&console_lock);
- printf("SP: cpu 0x%x turned on\n\r", mpidr);
+ tf_printf("SP: cpu 0x%x turned on\n\r", mpidr);
INFO("cpu 0x%x: %d smcs, %d erets %d cpu on requests\n", mpidr,
tsp_stats[linear_id].smc_count,
tsp_stats[linear_id].eret_count,
@@ -193,7 +192,7 @@ tsp_args_t *tsp_cpu_off_main(uint64_t arg0,
tsp_stats[linear_id].cpu_off_count++;
spin_lock(&console_lock);
- printf("SP: cpu 0x%x off request\n\r", mpidr);
+ tf_printf("SP: cpu 0x%x off request\n\r", mpidr);
INFO("cpu 0x%x: %d smcs, %d erets %d cpu off requests\n", mpidr,
tsp_stats[linear_id].smc_count,
tsp_stats[linear_id].eret_count,
@@ -235,7 +234,7 @@ tsp_args_t *tsp_cpu_suspend_main(uint64_t power_state,
tsp_stats[linear_id].cpu_suspend_count++;
spin_lock(&console_lock);
- printf("SP: cpu 0x%x suspend request. power state: 0x%x\n\r",
+ tf_printf("SP: cpu 0x%x suspend request. power state: 0x%x\n\r",
mpidr, power_state);
INFO("cpu 0x%x: %d smcs, %d erets %d cpu suspend requests\n", mpidr,
tsp_stats[linear_id].smc_count,
@@ -273,7 +272,7 @@ tsp_args_t *tsp_cpu_resume_main(uint64_t suspend_level,
tsp_stats[linear_id].cpu_resume_count++;
spin_lock(&console_lock);
- printf("SP: cpu 0x%x resumed. suspend level %d \n\r",
+ tf_printf("SP: cpu 0x%x resumed. suspend level %d \n\r",
mpidr, suspend_level);
INFO("cpu 0x%x: %d smcs, %d erets %d cpu suspend requests\n", mpidr,
tsp_stats[linear_id].smc_count,
@@ -312,7 +311,7 @@ tsp_args_t *tsp_smc_handler(uint64_t func,
smc_type = ((func >> 31) & 1) == 1 ? "fast" : "standard";
- printf("SP: cpu 0x%x received %s smc 0x%x\n", read_mpidr(), smc_type, func);
+ tf_printf("SP: cpu 0x%x received %s smc 0x%x\n", read_mpidr(), smc_type, func);
INFO("cpu 0x%x: %d smcs, %d erets\n", mpidr,
tsp_stats[linear_id].smc_count,
tsp_stats[linear_id].eret_count);