Skip to content

Commit

Permalink
syslog: convert \n to \r\n in syslog framework layer
Browse files Browse the repository at this point in the history
Signed-off-by: yangsong8 <[email protected]>
  • Loading branch information
yangsong8-ai authored and xiaoxiang781216 committed Oct 16, 2024
1 parent 67ed036 commit 8c13b8d
Show file tree
Hide file tree
Showing 108 changed files with 293 additions and 1,704 deletions.
18 changes: 0 additions & 18 deletions arch/arm/src/a1x/a1x_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -1574,15 +1574,6 @@ int up_putc(int ch)
up_disableuartint(priv, &ier);
#endif

/* Check for LF */

if (ch == '\n')
{
/* Add CR */

arm_lowputc('\r');
}

arm_lowputc(ch);
#ifdef HAVE_SERIAL_CONSOLE
up_restoreuartint(priv, ier);
Expand All @@ -1604,15 +1595,6 @@ int up_putc(int ch)
int up_putc(int ch)
{
#ifdef HAVE_UART_DEVICE
/* Check for LF */

if (ch == '\n')
{
/* Add CR */

arm_lowputc('\r');
}

arm_lowputc(ch);
#endif
return ch;
Expand Down
18 changes: 0 additions & 18 deletions arch/arm/src/am335x/am335x_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -1378,15 +1378,6 @@ int up_putc(int ch)
up_disableuartint(priv, &ier);
#endif

/* Check for LF */

if (ch == '\n')
{
/* Add CR */

arm_lowputc('\r');
}

arm_lowputc(ch);
#ifdef HAVE_SERIAL_CONSOLE
up_restoreuartint(priv, ier);
Expand All @@ -1408,15 +1399,6 @@ int up_putc(int ch)
int up_putc(int ch)
{
#ifdef HAVE_UART_DEVICE
/* Check for LF */

if (ch == '\n')
{
/* Add CR */

arm_lowputc('\r');
}

arm_lowputc(ch);
#endif
return ch;
Expand Down
19 changes: 0 additions & 19 deletions arch/arm/src/at32/at32_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -3004,16 +3004,6 @@ int up_putc(int ch)
uint16_t ie;

up_disableusartint(priv, &ie);

/* Check for LF */

if (ch == '\n')
{
/* Add CR */

arm_lowputc('\r');
}

arm_lowputc(ch);
up_restoreusartint(priv, ie);
#endif
Expand All @@ -3033,15 +3023,6 @@ int up_putc(int ch)
int up_putc(int ch)
{
#if CONSOLE_UART > 0
/* Check for LF */

if (ch == '\n')
{
/* Add CR */

arm_lowputc('\r');
}

arm_lowputc(ch);
#endif
return ch;
Expand Down
10 changes: 0 additions & 10 deletions arch/arm/src/c5471/c5471_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -839,16 +839,6 @@ int up_putc(int ch)
up_waittxready(priv);
up_serialout(priv, UART_THR_OFFS, (uint8_t)ch);

/* Check for LF */

if (ch == '\n')
{
/* Add CR */

up_waittxready(priv);
up_serialout(priv, UART_THR_OFFS, '\r');
}

up_waittxready(priv);
up_restoreuartint(priv, ier);
return ch;
Expand Down
9 changes: 0 additions & 9 deletions arch/arm/src/cxd32xx/cxd32_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -978,15 +978,6 @@ int up_putc(int ch)
up_disableuartint(priv, &ier);
#endif

/* Check for LF */

if (ch == '\n')
{
/* Add CR */

arm_lowputc('\r');
}

arm_lowputc(ch);
#ifdef HAVE_CONSOLE
up_restoreuartint(priv, ier);
Expand Down
18 changes: 0 additions & 18 deletions arch/arm/src/cxd56xx/cxd56_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -1116,15 +1116,6 @@ int up_putc(int ch)
up_disableuartint(priv, &ier);
#endif

/* Check for LF */

if (ch == '\n')
{
/* Add CR */

arm_lowputc('\r');
}

arm_lowputc(ch);
#ifdef HAVE_CONSOLE
up_restoreuartint(priv, ier);
Expand All @@ -1146,15 +1137,6 @@ int up_putc(int ch)
int up_putc(int ch)
{
#ifdef HAVE_UART
/* Check for LF */

if (ch == '\n')
{
/* Add CR */

arm_lowputc('\r');
}

arm_lowputc(ch);
#endif
return ch;
Expand Down
20 changes: 0 additions & 20 deletions arch/arm/src/dm320/dm320_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,16 +751,6 @@ int up_putc(int ch)
up_waittxready(priv);
up_serialout(priv, UART_DTRR, (uint16_t)ch);

/* Check for LF */

if (ch == '\n')
{
/* Add CR */

up_waittxready(priv);
up_serialout(priv, UART_DTRR, '\r');
}

up_waittxready(priv);
up_restoreuartint(priv, ier);
return ch;
Expand Down Expand Up @@ -804,16 +794,6 @@ int up_putc(int ch)
up_waittxready();
putreg16((uint16_t)ch, DM320_REGISTER_BASE + UART_DTRR);

/* Check for LF */

if (ch == '\n')
{
/* Add CR */

up_waittxready();
putreg16((uint16_t)'\r', DM320_REGISTER_BASE + UART_DTRR);
}

up_waittxready();
return ch;
}
Expand Down
19 changes: 0 additions & 19 deletions arch/arm/src/efm32/efm32_leserial.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,16 +815,6 @@ int up_putc(int ch)
uint32_t ien;

efm32_disableuartint(priv, &ien);

/* Check for LF */

if (ch == '\n')
{
/* Add CR */

efm32_lowputc('\r');
}

efm32_lowputc(ch);
efm32_restoreuartint(priv, ien);
return ch;
Expand All @@ -844,15 +834,6 @@ int up_putc(int ch)
#ifdef HAVE_LEUART_CONSOLE
int up_putc(int ch)
{
/* Check for LF */

if (ch == '\n')
{
/* Add CR */

efm32_lowputc('\r');
}

efm32_lowputc(ch);
return ch;
}
Expand Down
19 changes: 0 additions & 19 deletions arch/arm/src/efm32/efm32_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -1192,16 +1192,6 @@ int up_putc(int ch)
uint32_t ien;

efm32_disableuartint(priv, &ien);

/* Check for LF */

if (ch == '\n')
{
/* Add CR */

efm32_lowputc('\r');
}

efm32_lowputc(ch);
efm32_restoreuartint(priv, ien);
#endif
Expand All @@ -1223,15 +1213,6 @@ int up_putc(int ch)
int up_putc(int ch)
{
#ifdef HAVE_UART_CONSOLE
/* Check for LF */

if (ch == '\n')
{
/* Add CR */

efm32_lowputc('\r');
}

efm32_lowputc(ch);
#endif
return ch;
Expand Down
19 changes: 0 additions & 19 deletions arch/arm/src/eoss3/eoss3_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,16 +588,6 @@ int up_putc(int ch)
uint32_t ie;

eoss3_disableuartint(priv, &ie);

/* Check for LF */

if (ch == '\n')
{
/* Add CR */

arm_lowputc('\r');
}

arm_lowputc(ch);
eoss3_restoreuartint(priv, ie);
#endif
Expand All @@ -617,15 +607,6 @@ int up_putc(int ch)

int up_putc(int ch)
{
/* Check for LF */

if (ch == '\n')
{
/* Add CR */

arm_lowputc('\r');
}

/* Output the character */

arm_lowputc(ch);
Expand Down
19 changes: 0 additions & 19 deletions arch/arm/src/gd32f4/gd32f4xx_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -2937,16 +2937,6 @@ int up_putc(int ch)
uint32_t ie;

up_disableusartint(priv, &ie);

/* Check for LF */

if (ch == '\n')
{
/* Add CR */

arm_lowputc('\r');
}

arm_lowputc(ch);
up_restoreusartint(priv, ie);
#endif
Expand All @@ -2966,15 +2956,6 @@ int up_putc(int ch)
int up_putc(int ch)
{
#ifdef CONSOLE_UART
/* Check for LF */

if (ch == '\n')
{
/* Add CR */

arm_lowputc('\r');
}

arm_lowputc(ch);
#endif
return ch;
Expand Down
21 changes: 0 additions & 21 deletions arch/arm/src/imx1/imx_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -1166,16 +1166,6 @@ int up_putc(int ch)
up_disableuartint(priv, &ier);
up_waittxready(priv);

/* Check for LF */

if (ch == '\n')
{
/* Add CR */

up_serialout(priv, UART_TXD0, (uint32_t)'\r');
up_waittxready(priv);
}

up_serialout(priv, UART_TXD0, (uint32_t)ch);
up_waittxready(priv);
up_restoreuartint(priv, ier);
Expand Down Expand Up @@ -1224,17 +1214,6 @@ static inline void up_waittxready(void)
int up_putc(int ch)
{
up_waittxready();

/* Check for LF */

if (ch == '\n')
{
/* Add CR */

putreg32((uint16_t)'\r', IMX_REGISTER_BASE + UART_TXD0);
up_waittxready();
}

putreg32((uint16_t)ch, IMX_REGISTER_BASE + UART_TXD0);
return ch;
}
Expand Down
21 changes: 0 additions & 21 deletions arch/arm/src/imx6/imx_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -1124,16 +1124,6 @@ int up_putc(int ch)
*/

imx_disableuartint(priv, &ier);

/* Check for LF */

if (ch == '\n')
{
/* Add CR */

imx_lowputc('\r');
}

imx_lowputc(ch);
imx_restoreuartint(priv, ier);

Expand Down Expand Up @@ -1190,17 +1180,6 @@ int up_putc(int ch)
{
#ifdef IMX_CONSOLE_VBASE
imx_waittxready();

/* Check for LF */

if (ch == '\n')
{
/* Add CR */

putreg32((uint16_t)'\r', IMX_CONSOLE_VBASE + UART_TXD_OFFSET);
imx_waittxready();
}

putreg32((uint16_t)ch, IMX_CONSOLE_VBASE + UART_TXD_OFFSET);
#endif

Expand Down
Loading

0 comments on commit 8c13b8d

Please sign in to comment.