summaryrefslogtreecommitdiffstats
path: root/pbl
diff options
context:
space:
mode:
Diffstat (limited to 'pbl')
-rw-r--r--pbl/Makefile1
-rw-r--r--pbl/console.c32
2 files changed, 33 insertions, 0 deletions
diff --git a/pbl/Makefile b/pbl/Makefile
index a2d7468687..c5a08c1354 100644
--- a/pbl/Makefile
+++ b/pbl/Makefile
@@ -4,3 +4,4 @@
pbl-y += misc.o
pbl-y += string.o
pbl-y += decomp.o
+pbl-$(CONFIG_PBL_CONSOLE) += console.o
diff --git a/pbl/console.c b/pbl/console.c
new file mode 100644
index 0000000000..3875e2aafd
--- /dev/null
+++ b/pbl/console.c
@@ -0,0 +1,32 @@
+#include <common.h>
+#include <debug_ll.h>
+
+int printf(const char *fmt, ...)
+{
+ va_list args;
+ uint i;
+ char printbuffer[CFG_PBSIZE];
+
+ va_start(args, fmt);
+ i = vsprintf(printbuffer, fmt, args);
+ va_end(args);
+
+ puts_ll(printbuffer);
+
+ return i;
+}
+
+int pr_print(int level, const char *fmt, ...)
+{
+ va_list args;
+ uint i;
+ char printbuffer[CFG_PBSIZE];
+
+ va_start(args, fmt);
+ i = vsprintf(printbuffer, fmt, args);
+ va_end(args);
+
+ puts_ll(printbuffer);
+
+ return i;
+}