|
@@ -32,6 +32,9 @@ u32 *uart;
|
|
/* PORT_16C550A, in polled non-fifo mode */
|
|
/* PORT_16C550A, in polled non-fifo mode */
|
|
static void putc(char c)
|
|
static void putc(char c)
|
|
{
|
|
{
|
|
|
|
+ if (!uart)
|
|
|
|
+ return;
|
|
|
|
+
|
|
while (!(uart[UART_LSR] & UART_LSR_THRE))
|
|
while (!(uart[UART_LSR] & UART_LSR_THRE))
|
|
barrier();
|
|
barrier();
|
|
uart[UART_TX] = c;
|
|
uart[UART_TX] = c;
|
|
@@ -39,6 +42,9 @@ static void putc(char c)
|
|
|
|
|
|
static inline void flush(void)
|
|
static inline void flush(void)
|
|
{
|
|
{
|
|
|
|
+ if (!uart)
|
|
|
|
+ return;
|
|
|
|
+
|
|
while (!(uart[UART_LSR] & UART_LSR_THRE))
|
|
while (!(uart[UART_LSR] & UART_LSR_THRE))
|
|
barrier();
|
|
barrier();
|
|
}
|
|
}
|