#define CONSOLE_SBI ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_LOG )
#endif
+extern void early_uart_putchar ( int character );
+
/** Buffered input character (if any) */
static unsigned char sbi_console_input;
static void sbi_putchar ( int character ) {
struct sbi_return ret;
+ /* Write byte to early UART, if enabled */
+ early_uart_putchar ( character );
+
/* Write byte to console */
ret = sbi_ecall_1 ( SBI_DBCN, SBI_DBCN_WRITE_BYTE, character );
if ( ! ret.error )
bltz a1, early_uart_sifive_wait_\@
.endm
+/*****************************************************************************
+ *
+ * Print single character to early UART (from C code)
+ *
+ *****************************************************************************
+ *
+ * This function is called by the SBI console driver to output a
+ * character to the early UART (if enabled).
+ *
+ * The standard C ABI applies to this function.
+ *
+ * Parameters:
+ *
+ * a0 - Character to print
+ *
+ * Returns: none
+ *
+ */
+
+ .section ".prefix.early_uart_putchar", "ax", @progbits
+ .globl early_uart_putchar
+early_uart_putchar:
+ print_char_uart
+ ret
+ .size early_uart_putchar, . - early_uart_putchar
+
/*****************************************************************************
*
* Print message to debug console