From b79af9344503b2d7b435451cfb8b1ab80b8afdf4 Mon Sep 17 00:00:00 2001 From: Soby Mathew Date: Thu, 12 Jun 2014 17:23:58 +0100 Subject: 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 --- include/common/debug.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'include/common/debug.h') diff --git a/include/common/debug.h b/include/common/debug.h index 5b496d76..c70109fd 100644 --- a/include/common/debug.h +++ b/include/common/debug.h @@ -43,14 +43,14 @@ * TODO : add debug levels. */ #if DEBUG - #define INFO(...) printf("INFO: " __VA_ARGS__) - #define WARN(...) printf("WARN: " __VA_ARGS__) + #define INFO(...) tf_printf("INFO: " __VA_ARGS__) + #define WARN(...) tf_printf("WARN: " __VA_ARGS__) #else #define INFO(...) #define WARN(...) #endif -#define ERROR(...) printf("ERROR: " __VA_ARGS__) +#define ERROR(...) tf_printf("ERROR: " __VA_ARGS__) /* For the moment this Panic function is very basic, Report an error and @@ -67,5 +67,7 @@ void __dead2 do_panic(void); #endif void print_string_value(char *s, unsigned long *mem); +void tf_printf(const char *fmt, ...); + #endif /* __DEBUG_H__ */ -- cgit