summaryrefslogtreecommitdiff
path: root/common/debug.c
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 /common/debug.c
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 'common/debug.c')
-rw-r--r--common/debug.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/debug.c b/common/debug.c
index 0f59ed5e..be54f5de 100644
--- a/common/debug.c
+++ b/common/debug.c
@@ -29,6 +29,7 @@
*/
#include <console.h>
#include <debug.h>
+#include <stdarg.h>
#include <stdio.h>
/******************************************************************
@@ -73,7 +74,7 @@ void print_string_value(char *s, unsigned long *mem)
#if DEBUG
void __dead2 do_panic(const char *file, int line)
{
- printf("PANIC in file: %s line: %d\n", file, line);
+ tf_printf("PANIC in file: %s line: %d\n", file, line);
while (1)
;
}
@@ -87,7 +88,7 @@ void __dead2 do_panic(void)
/* x30 reports the next eligible instruction whereas we want the
* place where panic() is invoked. Hence decrement by 4.
*/
- printf("PANIC in PC location 0x%016X\n", pc_reg - 0x4);
+ tf_printf("PANIC in PC location 0x%016X\n", pc_reg - 0x4);
while (1)
;