/* * Helpful for debugging :-) */ int prom_printf(const char * fmt, ...) { #ifdef CONFIG_SERIAL //extern void serial_outc(char); static char buf[1024]; va_list args; char c; int i = 0; /* * Printing messages via serial port */ va_start(args, fmt); vsprintf(buf, fmt, args); va_end(args); for (i = 0; buf[i] != '\0'; i++) { c = buf[i]; if (c == '\n') serial_outc('\r'); serial_outc(c); } return i; #else return 0; #endif }
int prom_printf(const char * fmt, ...) { static char buf[1024]; va_list args; char c; int i = 0; /* * Printing messages via serial port */ va_start(args, fmt); vsprintf(buf, fmt, args); //do_printf(buf, fmt, args); va_end(args); for (i = 0; buf[i] != '\0'; i++) { c = buf[i]; if (c == '\n') serial_outc('\r'); serial_outc(c); } return i; }
static void serial_console_write(struct console *co, const char *s, unsigned count) { unsigned int i; for (i = 0; i < count; i++) { if (*s == '\n') serial_outc('\r'); serial_outc(*s++); } }
static void ser_console_write(struct console *cons, const char *s, unsigned int count) { int line = cons->index; uart_state_t *port = uart_states + line; u32 imr; imr = READ_SERCSR(port->imr, line); WRITE_SERCSR(0, port->imr, line); while (count--) { if (*s == '\n') serial_outc('\r', line); serial_outc(*s++, line); } WRITE_SERCSR(imr, port->imr, line); }
void board_putc(int ch) { serial_outc(ch); }