mirror of
https://github.com/ipxe/ipxe
synced 2026-01-22 20:19:08 +03:00
[serial] Explicitly initialise serial console UART to NULL
When debugging is enabled for the device tree or memory map parsing code, the active serial console UART variable will be accessed during early initialisation, before the .bss section has been zeroed. Place this variable in the .data section (by providing an explicit initialiser), so that reading this variable is well defined even during early initialisation. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -61,8 +61,12 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
#define COMSPEED 0
|
||||
#endif
|
||||
|
||||
/** Active serial console UART */
|
||||
struct uart *serial_console;
|
||||
/** Active serial console UART
|
||||
*
|
||||
* Explicitly initialised to @c NULL since this variable may be
|
||||
* accessed before .bss has been zeroed.
|
||||
*/
|
||||
struct uart *serial_console = NULL;
|
||||
|
||||
/**
|
||||
* Get fixed serial console UART
|
||||
|
||||
Reference in New Issue
Block a user