kernel/init.c: allow for memset/memcpy alternatives during early boot
Zeroing the BSS and copying data to RAM with regular memset/memcpy may cause problems when those functions are assuming a fully initialized system for their optimizations to work e.g. some instructions require an active MMU, but turning the MMU on needs the .bss section to be cleared first, etc. Commit c5b89874 ("aarch64: Fix alignment fault on z_bss_zero()") provides a detailed explanation of such a case. Replacing z_bss_zero() with an architecture specific one is problematic as the former may see new sections added to it that would be missed by the later. The same reasoning goes for z_data_copy(). Let's make maintenance much easier by providing weak versions of memset/memcpy that can be overridden by architecture-specific safe versions when needed. Signed-off-by:Nicolas Pitre <npitre@baylibre.com>
Loading
Please sign in to comment