x86: don't clear BSS if not in physical memory at boot

If the BSS section is not present in physical memory at boot,
do not zero the section, or else page faults would occur.
The zeroing of BSS will be done once the paging mechanism
has been initialized.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2021-07-12 11:22:34 -07:00 committed by Christopher Friedt
commit 30e5968d34

View file

@ -257,7 +257,14 @@ __csSet:
#ifdef CONFIG_LINKER_USE_PINNED_SECTION
call z_bss_zero_pinned
#endif
#ifdef CONFIG_LINKER_GENERIC_SECTIONS_PRESENT_AT_BOOT
/* Don't clear BSS if the section is not present
* in memory at boot. Or else it would cause page
* faults. Zeroing BSS will be done later once the
* the paging mechanism has been initialized.
*/
call z_bss_zero
#endif
/* load 32-bit operand size IDT */
lidt z_x86_idt