diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2014-12-08 10:28:59 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-01-05 11:30:59 +0100 |
commit | a9d7b3d00e681ee3cfe33b00d58ef9d6bd0645df (patch) | |
tree | 62eaf077255196c57cdd59193c1118615f7242cb /lib | |
parent | 017da2273a1bfef0b2b24e50cc124bdc1845e0f3 (diff) | |
download | barebox-a9d7b3d00e681ee3cfe33b00d58ef9d6bd0645df.tar.gz barebox-a9d7b3d00e681ee3cfe33b00d58ef9d6bd0645df.tar.xz |
Add PBL console support
This adds simple console support to the PBL which makes it
possible to print more complex messages in the PBL than just
strings or hex numbers. For now puts_ll is used to print the
messages, so it depends on CONFIG_DEBUG_LL which makes it
more a debugging option. However, this could be extended later
to get regular output from the PBL if desired.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Makefile | 2 | ||||
-rw-r--r-- | lib/vsprintf.c | 12 |
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/Makefile b/lib/Makefile index 604d934765..226570a7e6 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -6,7 +6,9 @@ obj-y += display_options.o obj-y += string.o obj-y += strtox.o obj-y += vsprintf.o +pbl-$(CONFIG_PBL_CONSOLE) += vsprintf.o obj-y += div64.o +pbl-y += div64.o obj-y += misc.o obj-$(CONFIG_PARAMETER) += parameter.o obj-y += xfuncs.o diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 7f6b161a47..800ded7939 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -175,6 +175,7 @@ static char *string(char *buf, char *end, char *s, int field_width, int precisio return buf; } +#ifndef __PBL__ static char *symbol_string(char *buf, char *end, void *ptr, int field_width, int precision, int flags) { unsigned long value = (unsigned long) ptr; @@ -277,6 +278,17 @@ static char *pointer(const char *fmt, char *buf, char *end, void *ptr, int field } return number(buf, end, (unsigned long) ptr, 16, field_width, precision, flags); } +#else +static char *pointer(const char *fmt, char *buf, char *end, void *ptr, int field_width, int precision, int flags) +{ + flags |= SMALL; + if (field_width == -1) { + field_width = 2*sizeof(void *); + flags |= ZEROPAD; + } + return number(buf, end, (unsigned long) ptr, 16, field_width, precision, flags); +} +#endif /** * vsnprintf - Format a string and place it in a buffer |