diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-06-30 13:34:09 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-07-01 10:25:27 +0200 |
commit | 516a60a6f8d5cdaabf4329872b8d6cef52a67542 (patch) | |
tree | 763411e06aa2def42c00c30cd87e95fe8f2113ab /c/src/lib/libbsp/sparc/leon3/console/printk_support.c | |
parent | LEON3: devfs free nodes must be sized (diff) | |
download | rtems-516a60a6f8d5cdaabf4329872b8d6cef52a67542.tar.bz2 |
bsps/sparc: Reduce copy and paste
Diffstat (limited to 'c/src/lib/libbsp/sparc/leon3/console/printk_support.c')
-rw-r--r-- | c/src/lib/libbsp/sparc/leon3/console/printk_support.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/c/src/lib/libbsp/sparc/leon3/console/printk_support.c b/c/src/lib/libbsp/sparc/leon3/console/printk_support.c index 35fb4b52e5..d12099b1a6 100644 --- a/c/src/lib/libbsp/sparc/leon3/console/printk_support.c +++ b/c/src/lib/libbsp/sparc/leon3/console/printk_support.c @@ -21,6 +21,7 @@ #include <stdlib.h> #include <assert.h> #include <stdio.h> +#include <apbuart.h> int debug_uart_index __attribute__((weak)) = 0; static struct apbuart_regs *dbg_uart = NULL; @@ -69,7 +70,7 @@ void bsp_debug_uart_init(void) */ apb = (struct ambapp_apb_info *)adev->devinfo; dbg_uart = (struct apbuart_regs *)apb->start; - dbg_uart->ctrl |= LEON_REG_UART_CTRL_RE | LEON_REG_UART_CTRL_TE; + dbg_uart->ctrl |= APBUART_CTRL_RE | APBUART_CTRL_TE; dbg_uart->status = 0; } } @@ -87,7 +88,7 @@ void apbuart_outbyte_polled( ) { send: - while ( (regs->status & LEON_REG_UART_STATUS_THE) == 0 ) { + while ( (regs->status & APBUART_STATUS_TE) == 0 ) { /* Lower bus utilization while waiting for UART */ __asm__ volatile ("nop"::); __asm__ volatile ("nop"::); __asm__ volatile ("nop"::); __asm__ volatile ("nop"::); @@ -103,7 +104,7 @@ send: /* Wait until the character has been sent? */ if (wait_sent) { - while ((regs->status & LEON_REG_UART_STATUS_THE) == 0) + while ((regs->status & APBUART_STATUS_TE) == 0) ; } } @@ -116,10 +117,10 @@ send: int apbuart_inbyte_nonblocking(struct apbuart_regs *regs) { /* Clear errors */ - if (regs->status & LEON_REG_UART_STATUS_ERR) - regs->status = ~LEON_REG_UART_STATUS_ERR; + if (regs->status & APBUART_STATUS_ERR) + regs->status = ~APBUART_STATUS_ERR; - if ((regs->status & LEON_REG_UART_STATUS_DR) == 0) + if ((regs->status & APBUART_STATUS_DR) == 0) return EOF; else return (int) regs->data; |