Stop using early_putc immediately after configuring console with cninit()

Early UART should be released right after system console initialization is
completed. Otherwise, after cninit() both early and system console coexist
what may lead to various issues (i.a. writing to unmapped early
UART address). This cannot be done in cninit_finish() since it can be
called late at the end of MI configuration.

Obtained from:   Semihalf
Reviewed by:     andrew
Sponsored by:    The FreeBSD Foundation
This commit is contained in:
Zbigniew Bodek 2014-11-19 14:23:29 +00:00
parent 46ad509bf8
commit dc61566f95

View File

@ -156,6 +156,13 @@ cninit(void)
* Make the best console the preferred console.
*/
cnselect(best_cn);
#ifdef EARLY_PRINTF
/*
* Release early console.
*/
early_putc = NULL;
#endif
}
void