]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - examples/api/libgenwrap.c
lib/tiny-printf.c: Add tiny printf function for space limited environments
[people/ms/u-boot.git] / examples / api / libgenwrap.c
index c1afa5bc09a1f155fd957ce1a6a3cb12c1bffa9b..ba51007b14a6a268e3c87d72b48055a0a7bd511f 100644 (file)
 
 #include "glue.h"
 
-/*
- * printf() and vprintf() are stolen from u-boot/common/console.c
- */
-int printf (const char *fmt, ...)
-{
-       va_list args;
-       uint i;
-       char printbuffer[256];
-
-       va_start (args, fmt);
-
-       /* For this to work, printbuffer must be larger than
-        * anything we ever want to print.
-        */
-       i = vsprintf (printbuffer, fmt, args);
-       va_end (args);
-
-       /* Print the string */
-       ub_puts (printbuffer);
-       return i;
-}
-
-int vprintf (const char *fmt, va_list args)
+void putc(const char c)
 {
-       uint i;
-       char printbuffer[256];
-
-       /* For this to work, printbuffer must be larger than
-        * anything we ever want to print.
-        */
-       i = vsprintf (printbuffer, fmt, args);
-
-       /* Print the string */
-       ub_puts (printbuffer);
-       return i;
+       ub_putc(c);
 }
 
-void putc (const char c)
+void puts(const char *s)
 {
-       ub_putc(c);
+       ub_puts(s);
 }
 
 void __udelay(unsigned long usec)