barebox/common/console_none.c
Jean-Christophe PLAGNIOL-VILLARD b1da925c8a introduce console none support
this will allow to have no console support

Use full for bootstrap as we can save 6.5 KiB (barebox.bin) and
3.8 KiB (zbarebox.bin lzo) on at91sam9263 as example vs console simple

As on bootstrap we have often very limited size.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-23 20:34:16 +01:00

43 lines
711 B
C

#include <config.h>
#include <common.h>
#include <fs.h>
#include <errno.h>
#include <debug_ll.h>
int fputc(int fd, char c)
{
if (fd != 1 && fd != 2)
return write(fd, &c, 1);
return 0;
}
EXPORT_SYMBOL(fputc);
int fputs(int fd, const char *s)
{
if (fd != 1 && fd != 2)
return write(fd, s, strlen(s));
return 0;
}
EXPORT_SYMBOL(fputs);
int fprintf(int file, const char *fmt, ...)
{
va_list args;
uint i;
char printbuffer[CFG_PBSIZE];
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 */
fputs(file, printbuffer);
return i;
}
EXPORT_SYMBOL(fprintf);