Make putchar() match a standard prototype and add puts()
Also make puts() add carriage returns before linefeeds so the
users don't have to do it all over the place.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
return potato_uart_read();
}
-void putchar(unsigned char c)
+int putchar(int c)
{
while (potato_uart_tx_full())
/* Do Nothing */;
potato_uart_write(c);
+ return c;
}
void putstr(const char *str, unsigned long len)
}
}
+int puts(const char *str)
+{
+ unsigned int i;
+
+ for (i = 0; *str; i++) {
+ char c = *(str++);
+ if (c == 10)
+ putchar(13);
+ putchar(c);
+ }
+ return 0;
+}
+
size_t strlen(const char *s)
{
size_t len = 0;