riscv: catch up with EARLY_PRINTF changes

On this platform early console access is possible via SBI. Follow recent
changes to EARLY_PRINTF option and give it a named constant.

Update the commented option in GENERIC so that it compiles.

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D44100
This commit is contained in:
Mitchell Horne 2024-03-04 14:45:17 -04:00
parent 84ed86380a
commit da48ddbf7c
3 changed files with 3 additions and 2 deletions

View file

@ -165,7 +165,7 @@ options WITNESS # Enable checks to detect deadlocks and cycles
options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed
options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones
options ALT_BREAK_TO_DEBUGGER # Enter debugger on keyboard escape sequence
# options EARLY_PRINTF
# options EARLY_PRINTF=sbi
options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default
# Kernel dump features.

View file

@ -110,7 +110,7 @@ riscv_putc(int c)
sbi_console_putchar(c);
}
#ifdef EARLY_PRINTF
#if CHECK_EARLY_PRINTF(sbi)
early_putc_t *early_putc = riscv_putc;
#endif

View file

@ -215,6 +215,7 @@ extern early_putc_t *early_putc;
#define early_printf_ns8250 3
#define early_printf_pl011 4
#define early_printf_snps 5
#define early_printf_sbi 6
#else
#define CHECK_EARLY_PRINTF(x) 0
#endif