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/shared | |
parent | LEON3: devfs free nodes must be sized (diff) | |
download | rtems-516a60a6f8d5cdaabf4329872b8d6cef52a67542.tar.bz2 |
bsps/sparc: Reduce copy and paste
Diffstat (limited to '')
-rw-r--r-- | c/src/lib/libbsp/sparc/shared/include/apbuart.h | 1 | ||||
-rw-r--r-- | c/src/lib/libbsp/sparc/shared/uart/apbuart.c | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/c/src/lib/libbsp/sparc/shared/include/apbuart.h b/c/src/lib/libbsp/sparc/shared/include/apbuart.h index 139d1ec4ce..2f34a11083 100644 --- a/c/src/lib/libbsp/sparc/shared/include/apbuart.h +++ b/c/src/lib/libbsp/sparc/shared/include/apbuart.h @@ -71,6 +71,7 @@ typedef struct { #define APBUART_STATUS_OV 0x10 #define APBUART_STATUS_PE 0x20 #define APBUART_STATUS_FE 0x40 +#define APBUART_STATUS_ERR 0x78 #define APBUART_STATUS_TH 0x80 #define APBUART_STATUS_RH 0x100 #define APBUART_STATUS_TF 0x200 diff --git a/c/src/lib/libbsp/sparc/shared/uart/apbuart.c b/c/src/lib/libbsp/sparc/shared/uart/apbuart.c index e64784faec..f7e9a7f58e 100644 --- a/c/src/lib/libbsp/sparc/shared/uart/apbuart.c +++ b/c/src/lib/libbsp/sparc/shared/uart/apbuart.c @@ -158,7 +158,7 @@ static void apbuart_hw_open(apbuart_priv *uart); #if 0 static int apbuart_outbyte_try(struct apbuart_regs *regs, unsigned char ch) { - if ( (READ_REG(®s->status) & LEON_REG_UART_STATUS_THE) == 0 ) + if ( (READ_REG(®s->status) & APBUART_STATUS_TE) == 0 ) return -1; /* Failed */ /* There is room in fifo, put ch in it */ @@ -171,12 +171,12 @@ static int apbuart_inbyte_try(struct apbuart_regs *regs) { unsigned int status; /* Clear errors if any */ - if ( (status=READ_REG(®s->status)) & LEON_REG_UART_STATUS_ERR) { - regs->status = status & ~LEON_REG_UART_STATUS_ERR; + if ( (status=READ_REG(®s->status)) & APBUART_STATUS_ERR) { + regs->status = status & ~APBUART_STATUS_ERR; } /* Is Data available? */ - if ( (READ_REG(®s->status) & LEON_REG_UART_STATUS_DR) == 0 ) + if ( (READ_REG(®s->status) & APBUART_STATUS_DR) == 0 ) return -1; /* No data avail */ /* Return Data */ |