[rtems commit] Simplify and unify BSP_output_char
Sebastian Huber
sebh at rtems.org
Tue Sep 12 08:01:08 UTC 2017
Module: rtems
Branch: master
Commit: 1bc0ad2e12e9e523a9b9043ac47254a0597826bf
Changeset: http://git.rtems.org/rtems/commit/?id=1bc0ad2e12e9e523a9b9043ac47254a0597826bf
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Fri Sep 8 10:38:46 2017 +0200
Simplify and unify BSP_output_char
The BSP_output_char should output a char and not mingle with high level
processing, e.g. '\n' to '\r\n' translation. Move this translation to
rtems_putc(). Remove it from all the BSP_output_char implementations.
Close #3122.
---
.../lib/libbsp/arm/altera-cyclone-v/console/console-config.c | 4 ----
c/src/lib/libbsp/arm/atsam/console/debug-console.c | 4 ----
c/src/lib/libbsp/arm/beagle/console/console-config.c | 3 ---
c/src/lib/libbsp/arm/csb336/console/uart.c | 3 ---
c/src/lib/libbsp/arm/imx/console/console-config.c | 10 +---------
c/src/lib/libbsp/arm/lm3s69xx/console/console-config.c | 3 ---
c/src/lib/libbsp/arm/raspberrypi/console/console-config.c | 3 ---
c/src/lib/libbsp/arm/realview-pbx-a9/console/console-config.c | 4 ----
c/src/lib/libbsp/arm/rtl22xx/console/uart.c | 3 ---
c/src/lib/libbsp/arm/shared/comm/uart.c | 1 -
c/src/lib/libbsp/arm/smdk2410/console/uart.c | 3 ---
c/src/lib/libbsp/arm/stm32f4/console/console-config.c | 5 +----
c/src/lib/libbsp/arm/tms570/console/printk-support.c | 4 ----
c/src/lib/libbsp/arm/xilinx-zynq/console/debug-console.c | 4 ----
c/src/lib/libbsp/i386/pc386/console/printk_support.c | 5 -----
c/src/lib/libbsp/i386/shared/comm/uart.c | 1 -
c/src/lib/libbsp/m68k/av5282/console/console.c | 2 --
c/src/lib/libbsp/m68k/genmcf548x/console/console.c | 2 --
c/src/lib/libbsp/m68k/mcf5225x/console/debugio.c | 3 ---
c/src/lib/libbsp/m68k/mcf5235/console/console.c | 2 --
c/src/lib/libbsp/m68k/mcf5329/console/console.c | 2 --
c/src/lib/libbsp/m68k/mvme167/console/console.c | 2 --
c/src/lib/libbsp/m68k/uC5282/console/console.c | 2 --
c/src/lib/libbsp/mips/csb350/console/console-io.c | 3 ---
c/src/lib/libbsp/or1k/generic_or1k/console/console-config.c | 3 ---
c/src/lib/libbsp/powerpc/gen5200/console/console.c | 3 ---
c/src/lib/libbsp/powerpc/gen83xx/console/console-config.c | 4 ----
c/src/lib/libbsp/powerpc/haleakala/startup/bspstart.c | 2 --
c/src/lib/libbsp/powerpc/mpc55xxevb/console/console-generic.c | 4 ----
c/src/lib/libbsp/powerpc/mpc8260ads/console/console.c | 5 -----
c/src/lib/libbsp/powerpc/qoriq/console/console-config.c | 4 ----
c/src/lib/libbsp/powerpc/shared/console/polled_io.c | 4 +---
c/src/lib/libbsp/powerpc/shared/console/uart.c | 1 -
c/src/lib/libbsp/powerpc/t32mppc/console/console.c | 11 +----------
c/src/lib/libbsp/powerpc/tqm8xx/console/console.c | 4 ----
c/src/lib/libbsp/powerpc/virtex/console/consolelite.c | 3 ---
c/src/lib/libbsp/powerpc/virtex4/startup/dummy_console.c | 2 +-
c/src/lib/libbsp/powerpc/virtex5/startup/dummy_console.c | 2 +-
c/src/lib/libbsp/shared/console-output-char.c | 4 ----
c/src/lib/libbsp/shared/src/uart-output-char.c | 4 ----
c/src/lib/libcpu/arm/at91rm9200/dbgu/dbgu.c | 2 --
c/src/lib/libcpu/powerpc/mpc55xx/esci/esci.c | 3 ---
cpukit/include/rtems/bspIo.h | 9 +++++++--
cpukit/libcsupport/src/putk.c | 4 ++--
cpukit/libmisc/serdbg/termios_printk.c | 3 ---
45 files changed, 15 insertions(+), 144 deletions(-)
diff --git a/c/src/lib/libbsp/arm/altera-cyclone-v/console/console-config.c b/c/src/lib/libbsp/arm/altera-cyclone-v/console/console-config.c
index 3249bbd..5ee02d0 100644
--- a/c/src/lib/libbsp/arm/altera-cyclone-v/console/console-config.c
+++ b/c/src/lib/libbsp/arm/altera-cyclone-v/console/console-config.c
@@ -150,10 +150,6 @@ static void output_char(char c)
{
rtems_termios_device_context *ctx = console_device_table[0].context;
- if (c == '\n') {
- ns16550_polled_putchar( ctx, '\r' );
- }
-
ns16550_polled_putchar( ctx, c );
}
diff --git a/c/src/lib/libbsp/arm/atsam/console/debug-console.c b/c/src/lib/libbsp/arm/atsam/console/debug-console.c
index aebc60f..4924e88 100644
--- a/c/src/lib/libbsp/arm/atsam/console/debug-console.c
+++ b/c/src/lib/libbsp/arm/atsam/console/debug-console.c
@@ -20,10 +20,6 @@
static void atsam_debug_console_out(char c)
{
- if (c == '\n') {
- DBG_PutChar('\r');
- }
-
DBG_PutChar((uint8_t) c);
}
diff --git a/c/src/lib/libbsp/arm/beagle/console/console-config.c b/c/src/lib/libbsp/arm/beagle/console/console-config.c
index ec50154..78af5f6 100644
--- a/c/src/lib/libbsp/arm/beagle/console/console-config.c
+++ b/c/src/lib/libbsp/arm/beagle/console/console-config.c
@@ -136,9 +136,6 @@ static void uart_write_polled( char c )
static void _BSP_put_char( char c ) {
uart_write_polled( c );
- if (c == '\n') {
- uart_write_polled('\r');
- }
}
static int _BSP_get_char(void)
diff --git a/c/src/lib/libbsp/arm/csb336/console/uart.c b/c/src/lib/libbsp/arm/csb336/console/uart.c
index e2e6bc2..7e1bb4d 100644
--- a/c/src/lib/libbsp/arm/csb336/console/uart.c
+++ b/c/src/lib/libbsp/arm/csb336/console/uart.c
@@ -461,9 +461,6 @@ static void imx_uart_poll_write_char(int minor, char c)
static void _BSP_output_char(char c)
{
poll_write(c);
- if (c == '\n') {
- poll_write('\r');
- }
}
BSP_output_char_function_type BSP_output_char = _BSP_output_char;
diff --git a/c/src/lib/libbsp/arm/imx/console/console-config.c b/c/src/lib/libbsp/arm/imx/console/console-config.c
index bc9a3d2..a5b3682 100644
--- a/c/src/lib/libbsp/arm/imx/console/console-config.c
+++ b/c/src/lib/libbsp/arm/imx/console/console-config.c
@@ -61,15 +61,7 @@ static void imx_uart_write_polled(rtems_termios_device_context *base, char c)
static void imx_output_char(char c)
{
- imx_uart_context *ctx;
-
- ctx = imx_uart_console;
-
- if (c == '\n') {
- imx_uart_write_polled(&ctx->base, '\r');
- }
-
- imx_uart_write_polled(&ctx->base, c);
+ imx_uart_write_polled(&imx_uart_console->base, c);
}
static void imx_uart_init_context(
diff --git a/c/src/lib/libbsp/arm/lm3s69xx/console/console-config.c b/c/src/lib/libbsp/arm/lm3s69xx/console/console-config.c
index c6c4900..b702f0c 100644
--- a/c/src/lib/libbsp/arm/lm3s69xx/console/console-config.c
+++ b/c/src/lib/libbsp/arm/lm3s69xx/console/console-config.c
@@ -70,9 +70,6 @@ static void output_char(char c)
const console_fns *con =
Console_Configuration_Ports [Console_Port_Minor].pDeviceFns;
- if (c == '\n') {
- con->deviceWritePolled((int) Console_Port_Minor, '\r');
- }
con->deviceWritePolled((int) Console_Port_Minor, c);
}
diff --git a/c/src/lib/libbsp/arm/raspberrypi/console/console-config.c b/c/src/lib/libbsp/arm/raspberrypi/console/console-config.c
index dfb9826..d2186c9 100644
--- a/c/src/lib/libbsp/arm/raspberrypi/console/console-config.c
+++ b/c/src/lib/libbsp/arm/raspberrypi/console/console-config.c
@@ -60,9 +60,6 @@ static void output_char(char c)
const console_fns *con =
Console_Configuration_Ports [Console_Port_Minor].pDeviceFns;
- if (c == '\n') {
- con->deviceWritePolled((int) Console_Port_Minor, '\r');
- }
con->deviceWritePolled((int) Console_Port_Minor, c);
}
diff --git a/c/src/lib/libbsp/arm/realview-pbx-a9/console/console-config.c b/c/src/lib/libbsp/arm/realview-pbx-a9/console/console-config.c
index 1dc7760..66dcfa6 100644
--- a/c/src/lib/libbsp/arm/realview-pbx-a9/console/console-config.c
+++ b/c/src/lib/libbsp/arm/realview-pbx-a9/console/console-config.c
@@ -37,10 +37,6 @@ static arm_pl050_context pl050_context = {
static void output_char(char c)
{
- if (c == '\n') {
- arm_pl011_write_polled(&pl011_context.base, '\r');
- }
-
arm_pl011_write_polled(&pl011_context.base, c);
}
diff --git a/c/src/lib/libbsp/arm/rtl22xx/console/uart.c b/c/src/lib/libbsp/arm/rtl22xx/console/uart.c
index 91f7f32..2952e74 100644
--- a/c/src/lib/libbsp/arm/rtl22xx/console/uart.c
+++ b/c/src/lib/libbsp/arm/rtl22xx/console/uart.c
@@ -250,9 +250,6 @@ static int uart_set_attributes(int minor, const struct termios *t)
static void _BSP_put_char( char c )
{
uart_write_polled(0, c);
- if (c == '\n') {
- uart_write_polled(0, '\r');
- }
}
BSP_output_char_function_type BSP_output_char = _BSP_put_char;
diff --git a/c/src/lib/libbsp/arm/shared/comm/uart.c b/c/src/lib/libbsp/arm/shared/comm/uart.c
index 54f0735..e9528f1 100644
--- a/c/src/lib/libbsp/arm/shared/comm/uart.c
+++ b/c/src/lib/libbsp/arm/shared/comm/uart.c
@@ -294,7 +294,6 @@ void
BSP_output_char_via_serial(int val)
{
BSP_uart_polled_write(BSPConsolePort, val);
- if (val == '\n') BSP_uart_polled_write(BSPConsolePort,'\r');
}
/*
diff --git a/c/src/lib/libbsp/arm/smdk2410/console/uart.c b/c/src/lib/libbsp/arm/smdk2410/console/uart.c
index 9878c33..06adecf 100644
--- a/c/src/lib/libbsp/arm/smdk2410/console/uart.c
+++ b/c/src/lib/libbsp/arm/smdk2410/console/uart.c
@@ -230,9 +230,6 @@ int uart_poll_read(int minor)
*/
static void _BSP_put_char( char c ) {
uart_write_polled(0, c);
- if (c == '\n') {
- uart_write_polled(0, '\r');
- }
}
BSP_output_char_function_type BSP_output_char = _BSP_put_char;
diff --git a/c/src/lib/libbsp/arm/stm32f4/console/console-config.c b/c/src/lib/libbsp/arm/stm32f4/console/console-config.c
index 96b022d..6bf2d7e 100644
--- a/c/src/lib/libbsp/arm/stm32f4/console/console-config.c
+++ b/c/src/lib/libbsp/arm/stm32f4/console/console-config.c
@@ -100,10 +100,7 @@ static void output_char(char c)
{
const console_fns *con =
Console_Configuration_Ports [Console_Port_Minor].pDeviceFns;
-
- if (c == '\n') {
- con->deviceWritePolled((int) Console_Port_Minor, '\r');
- }
+
con->deviceWritePolled((int) Console_Port_Minor, c);
}
diff --git a/c/src/lib/libbsp/arm/tms570/console/printk-support.c b/c/src/lib/libbsp/arm/tms570/console/printk-support.c
index 31e2c19..529c5db 100644
--- a/c/src/lib/libbsp/arm/tms570/console/printk-support.c
+++ b/c/src/lib/libbsp/arm/tms570/console/printk-support.c
@@ -65,10 +65,6 @@ static void tms570_debug_console_putc(char ch)
*/
static void tms570_debug_console_out(char c)
{
- if ( c == '\n' ) {
- tms570_debug_console_putc('\r');
- }
-
tms570_debug_console_putc(c);
}
diff --git a/c/src/lib/libbsp/arm/xilinx-zynq/console/debug-console.c b/c/src/lib/libbsp/arm/xilinx-zynq/console/debug-console.c
index 887a7ea..38c0050 100644
--- a/c/src/lib/libbsp/arm/xilinx-zynq/console/debug-console.c
+++ b/c/src/lib/libbsp/arm/xilinx-zynq/console/debug-console.c
@@ -24,10 +24,6 @@ static void zynq_debug_console_out(char c)
rtems_termios_device_context *base =
&zynq_uart_instances[BSP_CONSOLE_MINOR].base;
- if (c == '\n') {
- zynq_uart_write_polled(base, '\r');
- }
-
zynq_uart_write_polled(base, c);
}
diff --git a/c/src/lib/libbsp/i386/pc386/console/printk_support.c b/c/src/lib/libbsp/i386/pc386/console/printk_support.c
index d6dd569..d5447ad 100644
--- a/c/src/lib/libbsp/i386/pc386/console/printk_support.c
+++ b/c/src/lib/libbsp/i386/pc386/console/printk_support.c
@@ -44,11 +44,6 @@ void BSP_outch(char ch)
console_tbl *port = Console_Port_Tbl[BSPPrintkPort];
if (port->pDeviceFns && port->pDeviceFns->deviceWritePolled) {
port->pDeviceFns->deviceWritePolled( BSPPrintkPort, ch );
- /*
- * No termios so expand the LF to LF/CR.
- */
- if ( ch == '\n')
- port->pDeviceFns->deviceWritePolled( BSPPrintkPort, '\r' );
}
return;
}
diff --git a/c/src/lib/libbsp/i386/shared/comm/uart.c b/c/src/lib/libbsp/i386/shared/comm/uart.c
index fd64eb2..5d2dd64 100644
--- a/c/src/lib/libbsp/i386/shared/comm/uart.c
+++ b/c/src/lib/libbsp/i386/shared/comm/uart.c
@@ -397,7 +397,6 @@ void
BSP_output_char_via_serial(char val)
{
BSP_uart_polled_write(BSPConsolePort, val);
- if (val == '\n') BSP_uart_polled_write(BSPConsolePort,'\r');
}
/*
diff --git a/c/src/lib/libbsp/m68k/av5282/console/console.c b/c/src/lib/libbsp/m68k/av5282/console/console.c
index f56305a..dd55766 100644
--- a/c/src/lib/libbsp/m68k/av5282/console/console.c
+++ b/c/src/lib/libbsp/m68k/av5282/console/console.c
@@ -29,8 +29,6 @@ static void _BSP_null_char( char c )
{
rtems_interrupt_level level;
- if (c == '\n')
- _BSP_null_char('\r');
rtems_interrupt_disable(level);
while ( (MCF5282_UART_USR(CONSOLE_PORT) & MCF5282_UART_USR_TXRDY) == 0 )
continue;
diff --git a/c/src/lib/libbsp/m68k/genmcf548x/console/console.c b/c/src/lib/libbsp/m68k/genmcf548x/console/console.c
index 23186fc..d22cfe6 100644
--- a/c/src/lib/libbsp/m68k/genmcf548x/console/console.c
+++ b/c/src/lib/libbsp/m68k/genmcf548x/console/console.c
@@ -77,8 +77,6 @@ _BSP_null_char( char c )
{
int level;
- if (c == '\n')
- _BSP_null_char('\r');
rtems_interrupt_disable(level);
while (!((MCF548X_PSC_SR(CONSOLE_PORT) & MCF548X_PSC_SR_TXRDY)))
continue;
diff --git a/c/src/lib/libbsp/m68k/mcf5225x/console/debugio.c b/c/src/lib/libbsp/m68k/mcf5225x/console/debugio.c
index cf80692..b91048a 100644
--- a/c/src/lib/libbsp/m68k/mcf5225x/console/debugio.c
+++ b/c/src/lib/libbsp/m68k/mcf5225x/console/debugio.c
@@ -22,9 +22,6 @@ static void _BSP_null_char(char c)
{
rtems_interrupt_level level=UART0_IRQ_LEVEL;
- if (c == '\n')
- _BSP_null_char('\r');
-
rtems_interrupt_disable(level);
while ((MCF_UART_USR(CONSOLE_PORT) & MCF_UART_USR_TXRDY) == 0)
continue;
diff --git a/c/src/lib/libbsp/m68k/mcf5235/console/console.c b/c/src/lib/libbsp/m68k/mcf5235/console/console.c
index 4829de0..3831713 100644
--- a/c/src/lib/libbsp/m68k/mcf5235/console/console.c
+++ b/c/src/lib/libbsp/m68k/mcf5235/console/console.c
@@ -30,8 +30,6 @@ _BSP_null_char( char c )
{
int level;
- if (c == '\n')
- _BSP_null_char('\r');
rtems_interrupt_disable(level);
while ( (MCF5235_UART_USR(CONSOLE_PORT) & MCF5235_UART_USR_TXRDY) == 0 )
continue;
diff --git a/c/src/lib/libbsp/m68k/mcf5329/console/console.c b/c/src/lib/libbsp/m68k/mcf5329/console/console.c
index ba4a7d9..797e5b0 100644
--- a/c/src/lib/libbsp/m68k/mcf5329/console/console.c
+++ b/c/src/lib/libbsp/m68k/mcf5329/console/console.c
@@ -30,8 +30,6 @@ static void _BSP_null_char(char c)
{
int level;
- if (c == '\n')
- _BSP_null_char('\r');
rtems_interrupt_disable(level);
while ((MCF_UART_USR(CONSOLE_PORT) & MCF_UART_USR_TXRDY) == 0)
continue;
diff --git a/c/src/lib/libbsp/m68k/mvme167/console/console.c b/c/src/lib/libbsp/m68k/mvme167/console/console.c
index 3b7aecb..0499ac4 100644
--- a/c/src/lib/libbsp/m68k/mvme167/console/console.c
+++ b/c/src/lib/libbsp/m68k/mvme167/console/console.c
@@ -1426,8 +1426,6 @@ void _BSP_output_char(char c)
printk_minor = PRINTK_MINOR;
_167Bug_pollWrite(printk_minor, &c, 1);
- if ( c == '\n' )
- _167Bug_pollWrite(printk_minor, &cr_char, 1);
}
/*
diff --git a/c/src/lib/libbsp/m68k/uC5282/console/console.c b/c/src/lib/libbsp/m68k/uC5282/console/console.c
index 485db20..276d0c6 100644
--- a/c/src/lib/libbsp/m68k/uC5282/console/console.c
+++ b/c/src/lib/libbsp/m68k/uC5282/console/console.c
@@ -41,8 +41,6 @@ _BSP_null_char( char c )
{
int level;
- if (c == '\n')
- _BSP_null_char('\r');
rtems_interrupt_disable(level);
while ( (MCF5282_UART_USR(CONSOLE_PORT) & MCF5282_UART_USR_TXRDY) == 0 )
continue;
diff --git a/c/src/lib/libbsp/mips/csb350/console/console-io.c b/c/src/lib/libbsp/mips/csb350/console/console-io.c
index 18c8be0..e1beff8 100644
--- a/c/src/lib/libbsp/mips/csb350/console/console-io.c
+++ b/c/src/lib/libbsp/mips/csb350/console/console-io.c
@@ -73,9 +73,6 @@ int console_inbyte_nonblocking(
static void csb250_output_char(char c)
{
console_outbyte_polled( 0, c );
- if (c == '\n') {
- console_outbyte_polled( 0, '\r' );
- }
}
static int csb250_get_char(void)
diff --git a/c/src/lib/libbsp/or1k/generic_or1k/console/console-config.c b/c/src/lib/libbsp/or1k/generic_or1k/console/console-config.c
index a5b29a9..5fc75dc 100644
--- a/c/src/lib/libbsp/or1k/generic_or1k/console/console-config.c
+++ b/c/src/lib/libbsp/or1k/generic_or1k/console/console-config.c
@@ -47,9 +47,6 @@ static void output_char(char c)
const console_fns *con =
Console_Configuration_Ports [Console_Port_Minor].pDeviceFns;
- if (c == '\n') {
- con->deviceWritePolled((int) Console_Port_Minor, '\r');
- }
con->deviceWritePolled((int) Console_Port_Minor, c);
}
diff --git a/c/src/lib/libbsp/powerpc/gen5200/console/console.c b/c/src/lib/libbsp/powerpc/gen5200/console/console.c
index 754a527..705769d 100644
--- a/c/src/lib/libbsp/powerpc/gen5200/console/console.c
+++ b/c/src/lib/libbsp/powerpc/gen5200/console/console.c
@@ -637,9 +637,6 @@ static void A_BSP_output_char(
#define PRINTK_WRITE mpc5200_uart_pollWrite
PRINTK_WRITE(PRINTK_MINOR, &c, 1 );
-
- if( c == '\n' )
- PRINTK_WRITE( PRINTK_MINOR, &cr, 1 );
}
static int A_BSP_get_char(void)
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/console/console-config.c b/c/src/lib/libbsp/powerpc/gen83xx/console/console-config.c
index 8dd7249..d0071cd 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/console/console-config.c
+++ b/c/src/lib/libbsp/powerpc/gen83xx/console/console-config.c
@@ -99,10 +99,6 @@ static void gen83xx_output_char(char c)
{
rtems_termios_device_context *ctx = console_device_table[0].context;
- if (c == '\n') {
- ns16550_polled_putchar(ctx, '\r');
- }
-
ns16550_polled_putchar(ctx, c);
}
diff --git a/c/src/lib/libbsp/powerpc/haleakala/startup/bspstart.c b/c/src/lib/libbsp/powerpc/haleakala/startup/bspstart.c
index 00f44c2..8facb27 100644
--- a/c/src/lib/libbsp/powerpc/haleakala/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/haleakala/startup/bspstart.c
@@ -150,8 +150,6 @@ DirectUARTWrite(const char c)
volatile uint8_t* up = (uint8_t*)(BSP_UART_IOBASE_COM1);
while ((up[LSR] & THRE) == 0) { ; }
up[THR] = c;
- if (c=='\n')
- DirectUARTWrite('\r');
}
/* We will provide our own printk output function as it may get used early */
diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/console/console-generic.c b/c/src/lib/libbsp/powerpc/mpc55xxevb/console/console-generic.c
index 2c79545..71385ad 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/console/console-generic.c
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/console/console-generic.c
@@ -37,10 +37,6 @@ static void console_generic_char_out(char c)
const console_generic_callbacks *cb =
console_generic_info_table [minor].callbacks;
- if (c == '\n') {
- (*cb->poll_write)(minor, '\r');
- }
-
(*cb->poll_write)(minor, c);
}
diff --git a/c/src/lib/libbsp/powerpc/mpc8260ads/console/console.c b/c/src/lib/libbsp/powerpc/mpc8260ads/console/console.c
index f0ce259..873c38d 100644
--- a/c/src/lib/libbsp/powerpc/mpc8260ads/console/console.c
+++ b/c/src/lib/libbsp/powerpc/mpc8260ads/console/console.c
@@ -193,8 +193,6 @@ static rtems_status_code do_poll_write(
static void _BSP_output_char( char c )
{
- char cr = '\r';
-
/*
* Can't rely on console_initialize having been called before this function
* is used, so it may fail unless output is done through EPPC-Bug.
@@ -202,9 +200,6 @@ static void _BSP_output_char( char c )
#define PRINTK_WRITE m8xx_uart_pollWrite
PRINTK_WRITE( PRINTK_MINOR, &c, 1 );
- if( c == '\n' )
- PRINTK_WRITE( PRINTK_MINOR, &cr, 1 );
-
}
/*
diff --git a/c/src/lib/libbsp/powerpc/qoriq/console/console-config.c b/c/src/lib/libbsp/powerpc/qoriq/console/console-config.c
index 8486891..53e8b5e 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/console/console-config.c
+++ b/c/src/lib/libbsp/powerpc/qoriq/console/console-config.c
@@ -183,10 +183,6 @@ static void output_char(char c)
{
rtems_termios_device_context *ctx = console_device_table[0].context;
- if (c == '\n') {
- ns16550_polled_putchar(ctx, '\r');
- }
-
ns16550_polled_putchar(ctx, c);
}
diff --git a/c/src/lib/libbsp/powerpc/shared/console/polled_io.c b/c/src/lib/libbsp/powerpc/shared/console/polled_io.c
index 2ec68d0..1086e59 100644
--- a/c/src/lib/libbsp/powerpc/shared/console/polled_io.c
+++ b/c/src/lib/libbsp/powerpc/shared/console/polled_io.c
@@ -426,8 +426,6 @@ void debug_putc(const u_char c)
void
debug_putc_onlcr(const char c)
{
- if ('\n'==c)
- debug_putc('\r');
debug_putc(c);
}
@@ -525,7 +523,7 @@ void my_puts(const u_char *s)
char c;
while ( ( c = *s++ ) != '\0' ) {
- debug_putc_onlcr((const char)c);
+ rtems_putc(c);
}
}
diff --git a/c/src/lib/libbsp/powerpc/shared/console/uart.c b/c/src/lib/libbsp/powerpc/shared/console/uart.c
index cd8657c..62212b9 100644
--- a/c/src/lib/libbsp/powerpc/shared/console/uart.c
+++ b/c/src/lib/libbsp/powerpc/shared/console/uart.c
@@ -417,7 +417,6 @@ void
BSP_output_char_via_serial(const char val)
{
BSP_uart_polled_write(BSPConsolePort, val);
- if (val == '\n') BSP_uart_polled_write(BSPConsolePort,'\r');
}
/*
diff --git a/c/src/lib/libbsp/powerpc/t32mppc/console/console.c b/c/src/lib/libbsp/powerpc/t32mppc/console/console.c
index bc94f85..5fbd648 100644
--- a/c/src/lib/libbsp/powerpc/t32mppc/console/console.c
+++ b/c/src/lib/libbsp/powerpc/t32mppc/console/console.c
@@ -123,15 +123,6 @@ rtems_device_driver console_initialize(
return RTEMS_SUCCESSFUL;
}
-static void t32_output_char(char c)
-{
- if (c == '\n') {
- t32_console_write_char_polled('\r');
- }
-
- t32_console_write_char_polled(c);
-}
-
-BSP_output_char_function_type BSP_output_char = t32_output_char;
+BSP_output_char_function_type BSP_output_char = t32_console_write_char_polled;
BSP_polling_getchar_function_type BSP_poll_char = NULL;
diff --git a/c/src/lib/libbsp/powerpc/tqm8xx/console/console.c b/c/src/lib/libbsp/powerpc/tqm8xx/console/console.c
index e109303..7810bc1 100644
--- a/c/src/lib/libbsp/powerpc/tqm8xx/console/console.c
+++ b/c/src/lib/libbsp/powerpc/tqm8xx/console/console.c
@@ -846,14 +846,10 @@ int BSP_output_chan = CONS_CHN_NONE; /* channel used for printk operation */
static void console_debug_putc_onlcr(const char c)
{
rtems_interrupt_level irq_level;
- static char cr_chr = '\r';
if (BSP_output_chan != CONS_CHN_NONE) {
rtems_interrupt_disable(irq_level);
- if (c == '\n') {
- sccPollWrite (BSP_output_chan,&cr_chr,1);
- }
sccPollWrite (BSP_output_chan,&c,1);
rtems_interrupt_enable(irq_level);
}
diff --git a/c/src/lib/libbsp/powerpc/virtex/console/consolelite.c b/c/src/lib/libbsp/powerpc/virtex/console/consolelite.c
index 6c8e6e3..4d0b2db 100644
--- a/c/src/lib/libbsp/powerpc/virtex/console/consolelite.c
+++ b/c/src/lib/libbsp/powerpc/virtex/console/consolelite.c
@@ -411,9 +411,6 @@ unsigned long Console_Configuration_Count =
static void outputChar(char ch)
{
- if (ch == '\n') {
- xlite_write_char_polled( 0, '\r' );
- }
xlite_write_char_polled( 0, ch );
}
diff --git a/c/src/lib/libbsp/powerpc/virtex4/startup/dummy_console.c b/c/src/lib/libbsp/powerpc/virtex4/startup/dummy_console.c
index 6ff24b2..642fe45 100644
--- a/c/src/lib/libbsp/powerpc/virtex4/startup/dummy_console.c
+++ b/c/src/lib/libbsp/powerpc/virtex4/startup/dummy_console.c
@@ -18,7 +18,7 @@ ssize_t __bsp_memory_write(int minor, const char* buf, size_t len)
const char* const last = buf+len;
while (buf < last)
{
- BSP_output_char(*buf++);
+ rtems_putc(*buf++);
}
return len;
}
diff --git a/c/src/lib/libbsp/powerpc/virtex5/startup/dummy_console.c b/c/src/lib/libbsp/powerpc/virtex5/startup/dummy_console.c
index 8a35eb9..2cdab33 100644
--- a/c/src/lib/libbsp/powerpc/virtex5/startup/dummy_console.c
+++ b/c/src/lib/libbsp/powerpc/virtex5/startup/dummy_console.c
@@ -15,7 +15,7 @@ ssize_t __bsp_memory_write(int minor, const char* buf, size_t len)
const char* const last = buf+len;
while (buf < last)
{
- BSP_output_char(*buf++);
+ rtems_putc(*buf++);
}
return len;
}
diff --git a/c/src/lib/libbsp/shared/console-output-char.c b/c/src/lib/libbsp/shared/console-output-char.c
index 40f728d..fec2046 100644
--- a/c/src/lib/libbsp/shared/console-output-char.c
+++ b/c/src/lib/libbsp/shared/console-output-char.c
@@ -23,10 +23,6 @@ static void output_char(char c)
Console_Port_Tbl[minor] : &Console_Configuration_Ports[minor];
const console_fns *cf = ct->pDeviceFns;
- if (c == '\n') {
- (*cf->deviceWritePolled)(minor, '\r');
- }
-
(*cf->deviceWritePolled)(minor, c);
}
diff --git a/c/src/lib/libbsp/shared/src/uart-output-char.c b/c/src/lib/libbsp/shared/src/uart-output-char.c
index a11d41a..0831b8d 100644
--- a/c/src/lib/libbsp/shared/src/uart-output-char.c
+++ b/c/src/lib/libbsp/shared/src/uart-output-char.c
@@ -35,10 +35,6 @@ static void uart_output_raw(char c)
static void uart_output(char c)
{
- if (c == '\n') {
- uart_output_raw('\r');
- }
-
uart_output_raw(c);
}
diff --git a/c/src/lib/libcpu/arm/at91rm9200/dbgu/dbgu.c b/c/src/lib/libcpu/arm/at91rm9200/dbgu/dbgu.c
index fa14a8e..1a16762 100644
--- a/c/src/lib/libcpu/arm/at91rm9200/dbgu/dbgu.c
+++ b/c/src/lib/libcpu/arm/at91rm9200/dbgu/dbgu.c
@@ -211,8 +211,6 @@ static int dbgu_poll_read(int minor)
*/
static void _BSP_put_char( char c ) {
dbgu_write_polled(0, c);
- if ( c == '\n' )
- dbgu_write_polled(0, '\r');
}
BSP_output_char_function_type BSP_output_char = _BSP_put_char;
diff --git a/c/src/lib/libcpu/powerpc/mpc55xx/esci/esci.c b/c/src/lib/libcpu/powerpc/mpc55xx/esci/esci.c
index a500743b..63791b8 100644
--- a/c/src/lib/libcpu/powerpc/mpc55xx/esci/esci.c
+++ b/c/src/lib/libcpu/powerpc/mpc55xx/esci/esci.c
@@ -659,9 +659,6 @@ static void mpc55xx_esci_output_char( char c)
mpc55xx_esci_driver_entry *e = &mpc55xx_esci_driver_table [MPC55XX_ESCI_CONSOLE_MINOR];
mpc55xx_esci_interrupts_disable( e);
- if (c == '\n') {
- mpc55xx_esci_write_char( e, '\r');
- }
mpc55xx_esci_write_char( e, c);
mpc55xx_esci_interrupts_enable( e);
}
diff --git a/cpukit/include/rtems/bspIo.h b/cpukit/include/rtems/bspIo.h
index d0d8f83..8ab46af 100644
--- a/cpukit/include/rtems/bspIo.h
+++ b/cpukit/include/rtems/bspIo.h
@@ -55,6 +55,9 @@ typedef int (*BSP_polling_getchar_function_type) (void);
/**
* This variable points to the BSP provided method to output a
* character for the purposes of debug output.
+ *
+ * It must output only the specific character. It must not perform character
+ * translations, e.g. "\n" to "\r\n".
*/
extern BSP_output_char_function_type BSP_output_char;
@@ -94,7 +97,8 @@ extern int vprintk(const char *fmt, va_list ap);
/**
* @brief Kernel Print
*
- * This method allows the user to perform a debug printk().
+ * This method allows the user to perform a debug printk(). It performs a
+ * character translation from "\n" to "\r\n".
*
* @param[in] fmt is a printf()-style format string
*
@@ -116,7 +120,8 @@ extern int putk(const char *s);
/**
* @brief Kernel Put Character
*
- * This method allows the user to perform a debug putc().
+ * This method allows the user to perform a debug putc(). It performs a
+ * character translation from "\n" to "\r\n".
*
* @param[in] c is the character to print
*/
diff --git a/cpukit/libcsupport/src/putk.c b/cpukit/libcsupport/src/putk.c
index 76fa8b0..5a84a4be 100644
--- a/cpukit/libcsupport/src/putk.c
+++ b/cpukit/libcsupport/src/putk.c
@@ -29,7 +29,7 @@ int putk(const char *s)
int len_out = 0;
for (p=s ; *p ; p++, len_out++ )
- BSP_output_char(*p);
- BSP_output_char('\n');
+ rtems_putc(*p);
+ rtems_putc('\n');
return len_out + 1;
}
diff --git a/cpukit/libmisc/serdbg/termios_printk.c b/cpukit/libmisc/serdbg/termios_printk.c
index 01ed334..510753d 100644
--- a/cpukit/libmisc/serdbg/termios_printk.c
+++ b/cpukit/libmisc/serdbg/termios_printk.c
@@ -85,9 +85,6 @@ void termios_printk_outputchar
/*
* send character to debug serial port
*/
- if (c == '\n') {
- termios_printk_tty->device.write(termios_printk_tty->minor,&cr,1);
- }
termios_printk_tty->device.write(termios_printk_tty->minor,&c,1);
}
}
More information about the vc
mailing list