seL4/include/drivers/uart.h
Axel Heider 4608941f38 debug: restructure kernel console handling
Remove the UART handling details from the top level I/O handling that
implements printf(). The architecture's I/O handling must define how
the debug channel is implemented and what special handling is
required. This allows separating UART and SBI debug output handling.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-05-14 13:13:36 +10:00

27 lines
512 B
C

/*
* Copyright 2021, Axel Heider <axelheider@gmx.de>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#ifdef CONFIG_PRINTING
void uart_drv_putchar(unsigned char c);
static inline void uart_console_putchar(
unsigned char c)
{
/* UART console requires printing a '\r' (CR) before any '\n' (LF) */
if (c == '\n') {
uart_drv_putchar('\r');
}
uart_drv_putchar(c);
}
#endif /* CONFIG_PRINTING */
#ifdef CONFIG_DEBUG_BUILD
unsigned char uart_drv_getchar(void);
#endif