31,16 → 31,25 |
#include <arch/cp0.h> |
#include <arch/console.h> |
#include <arch.h> |
#include <arch/drivers/arc.h> |
#include <arch/arch.h> |
|
/** Putchar that works with MSIM & gxemul */ |
static void arc_putchar(const char ch) |
{ |
int cnt; |
pri_t pri; |
|
/* TODO: Should be spinlock? */ |
pri = cpu_priority_high(); |
bios_write(1, &ch, 1, &cnt); |
cpu_priority_restore(pri); |
|
} |
|
static void cons_putchar(const char ch) |
{ |
*((char *) VIDEORAM) = ch; |
} |
|
/** Putchar that works with simics */ |
|
static void serial_putchar(const char ch) |
{ |
int i; |
58,10 → 67,8 |
|
void console_init(void) |
{ |
if (arc_enabled()) |
putchar_func = arc_putchar; |
/* The LSR on the start usually contains this value */ |
else if (*SERIAL_LSR == 0x60) |
if (*SERIAL_LSR == 0x60) |
putchar_func = serial_putchar; |
else |
putchar_func = cons_putchar; |