From 28f3f511a7e17aa4f67b2fa6ca1b9cfc7ed9e8c8 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 6 Sep 2007 13:11:45 +0000 Subject: [PATCH] 2007-09-06 Daniel Hellstrom * console/debugputs.c: Now works on multi-CPU systems. --- c/src/lib/libbsp/sparc/leon3/ChangeLog | 4 ++++ c/src/lib/libbsp/sparc/leon3/console/debugputs.c | 13 +++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/c/src/lib/libbsp/sparc/leon3/ChangeLog b/c/src/lib/libbsp/sparc/leon3/ChangeLog index 73a10a0d81..6306c90f64 100644 --- a/c/src/lib/libbsp/sparc/leon3/ChangeLog +++ b/c/src/lib/libbsp/sparc/leon3/ChangeLog @@ -1,3 +1,7 @@ +2007-09-06 Daniel Hellstrom + + * console/debugputs.c: Now works on multi-CPU systems. + 2007-09-05 Daniel Hellstrom * clock/ckinit.c, console/console.c, leon_greth/leon_greth.c, diff --git a/c/src/lib/libbsp/sparc/leon3/console/debugputs.c b/c/src/lib/libbsp/sparc/leon3/console/debugputs.c index af5b0370ea..b9cfeaef78 100644 --- a/c/src/lib/libbsp/sparc/leon3/console/debugputs.c +++ b/c/src/lib/libbsp/sparc/leon3/console/debugputs.c @@ -35,8 +35,9 @@ void console_outbyte_polled( { if ((port >= 0) && (port <= CONFIGURE_NUMBER_OF_TERMIOS_PORTS)) { - while ( (LEON3_Console_Uart[port]->status & LEON_REG_UART_STATUS_THE) == 0 ); - LEON3_Console_Uart[port]->data = (unsigned int) ch; + while ( (LEON3_Console_Uart[LEON3_Cpu_Index+port]->status & + LEON_REG_UART_STATUS_THE) == 0 ); + LEON3_Console_Uart[LEON3_Cpu_Index+port]->data = (unsigned int) ch; } } @@ -52,13 +53,13 @@ int console_inbyte_nonblocking( int port ) if ((port >=0) && (port < CONFIGURE_NUMBER_OF_TERMIOS_PORTS)) { - if (LEON3_Console_Uart[port]->status & LEON_REG_UART_STATUS_ERR) { - LEON3_Console_Uart[port]->status = ~LEON_REG_UART_STATUS_ERR; + if (LEON3_Console_Uart[LEON3_Cpu_Index+port]->status & LEON_REG_UART_STATUS_ERR) { + LEON3_Console_Uart[LEON3_Cpu_Index+port]->status = ~LEON_REG_UART_STATUS_ERR; } - if ((LEON3_Console_Uart[port]->status & LEON_REG_UART_STATUS_DR) == 0) + if ((LEON3_Console_Uart[LEON3_Cpu_Index+port]->status & LEON_REG_UART_STATUS_DR) == 0) return -1; - return (int) LEON3_Console_Uart[port]->data; + return (int) LEON3_Console_Uart[LEON3_Cpu_Index+port]->data; } else