arm uart: Rename getc/putc to getchar/getchar

* Avoid name collisions
* This uart stuff may work better as a class at
  some point, however I didn't want to rock the
  u-boot boat *too* much as I don't have the
  hardware to test.
This commit is contained in:
Alexander von Gluck IV
2012-05-06 17:03:34 -05:00
parent 917e9be1a6
commit aa7d070732
7 changed files with 16 additions and 16 deletions
+2 -2
View File
@@ -26,8 +26,8 @@ struct uart_info {
void (*init)(addr_t base); void (*init)(addr_t base);
void (*init_early)(void); void (*init_early)(void);
void (*init_port)(addr_t base, uint baud); void (*init_port)(addr_t base, uint baud);
int (*putc)(addr_t base, char c); int (*putchar)(addr_t base, char c);
int (*getc)(addr_t base, bool wait); int (*getchar)(addr_t base, bool wait);
void (*flush_tx)(addr_t base); void (*flush_tx)(addr_t base);
void (*flush_rx)(addr_t base); void (*flush_rx)(addr_t base);
}; };
+2 -2
View File
@@ -35,8 +35,8 @@ extern "C" {
void uart_8250_init_port(addr_t base, uint baud); void uart_8250_init_port(addr_t base, uint baud);
void uart_8250_init_early(void); void uart_8250_init_early(void);
void uart_8250_init(addr_t base); void uart_8250_init(addr_t base);
int uart_8250_putc(addr_t base, char c); int uart_8250_putchar(addr_t base, char c);
int uart_8250_getc(addr_t base, bool wait); int uart_8250_getchar(addr_t base, bool wait);
void uart_8250_flush_tx(addr_t base); void uart_8250_flush_tx(addr_t base);
void uart_8250_flush_rx(addr_t base); void uart_8250_flush_rx(addr_t base);
@@ -28,7 +28,7 @@ static void
serial_putc(char c) serial_putc(char c)
{ {
if (gUARTInfo != NULL) if (gUARTInfo != NULL)
gUARTInfo->putc(gUARTInfo->base, c); gUARTInfo->putchar(gUARTInfo->base, c);
} }
+1 -1
View File
@@ -26,7 +26,7 @@ static uint32 sBufferPosition;
static void static void
serial_putc(char c) serial_putc(char c)
{ {
gUARTInfo->putc(gUARTInfo->base, c); gUARTInfo->putchar(gUARTInfo->base, c);
} }
@@ -60,8 +60,8 @@ arch_debug_serial_try_getchar(void)
char char
arch_debug_serial_getchar(void) arch_debug_serial_getchar(void)
{ {
if (gUART->getc != NULL) if (gUART->getchar != NULL)
return gUART->getc(gUART->base, false); return gUART->getchar(gUART->base, false);
return 0; return 0;
} }
@@ -70,8 +70,8 @@ arch_debug_serial_getchar(void)
void void
arch_debug_serial_putchar(const char c) arch_debug_serial_putchar(const char c)
{ {
if (gUART->putc != NULL) if (gUART->putchar != NULL)
gUART->putc(gUART->base, c); gUART->putchar(gUART->base, c);
} }
+4 -4
View File
@@ -54,8 +54,8 @@ uart_create(void)
uart->init = uart_8250_init; uart->init = uart_8250_init;
uart->init_early = uart_8250_init_early; uart->init_early = uart_8250_init_early;
uart->init_port = uart_8250_init_port; uart->init_port = uart_8250_init_port;
uart->putc = uart_8250_putc; uart->putchar = uart_8250_putchar;
uart->getc = uart_8250_getc; uart->getchar = uart_8250_getchar;
uart->flush_tx = uart_8250_flush_tx; uart->flush_tx = uart_8250_flush_tx;
uart->flush_rx = uart_8250_flush_rx; uart->flush_rx = uart_8250_flush_rx;
#elif defined(BOARD_UART_AMBA) #elif defined(BOARD_UART_AMBA)
@@ -63,8 +63,8 @@ uart_create(void)
uart->init = uart_amba_init; uart->init = uart_amba_init;
uart->init_early = uart_amba_init_early; uart->init_early = uart_amba_init_early;
uart->init_port = uart_amba_init_port; uart->init_port = uart_amba_init_port;
uart->putc = uart_amba_putc; uart->putchar = uart_amba_putchar;
uart->getc = uart_amba_getc; uart->getchar = uart_amba_getchar;
uart->flush_tx = uart_amba_flush_tx; uart->flush_tx = uart_amba_flush_tx;
uart->flush_rx = uart_amba_flush_rx; uart->flush_rx = uart_amba_flush_rx;
#else #else
+2 -2
View File
@@ -138,7 +138,7 @@ uart_8250_init(addr_t base)
int int
uart_8250_putc(addr_t base, char c ) uart_8250_putchar(addr_t base, char c)
{ {
while (!(read_8250(base, UART_LSR) & (1<<6))); while (!(read_8250(base, UART_LSR) & (1<<6)));
// wait for the last char to get out // wait for the last char to get out
@@ -149,7 +149,7 @@ uart_8250_putc(addr_t base, char c )
/* returns -1 if no data available */ /* returns -1 if no data available */
int int
uart_8250_getc(addr_t base, bool wait) uart_8250_getchar(addr_t base, bool wait)
{ {
if (wait) { if (wait) {
while (!(read_8250(base, UART_LSR) & (1<<0))); while (!(read_8250(base, UART_LSR) & (1<<0)));