drivers/console/xtensa_sim_console: force \r\n byte sequence

Force `\r\n` byte sequence for newline for the Xtensa simulator console
driver. This effectively mirrors the behavior of the UART console driver.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
This commit is contained in:
Filip Kokosinski 2024-05-10 09:52:23 +02:00 committed by Alberto Escolar
parent 00b2ef8744
commit 99aa65c725

View file

@ -25,6 +25,14 @@ int arch_printk_char_out(int c)
register int ret_err __asm__ ("a3");
buf[0] = (char)c;
if (buf[0] == '\n') {
buf[1] = buf[0];
buf[0] = '\r';
a3++;
a5++;
}
__asm__ volatile ("simcall"
: "=a" (ret_val), "=a" (ret_err)
: "a" (a2), "a" (a3), "a" (a4), "a" (a5)