zephyr/kernel
Nicolas Pitre 678b76e4b0 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 c5b898743a ("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>
2022-02-21 21:00:12 -05:00
..
include kernel/init.c: allow for memset/memcpy alternatives during early boot 2022-02-21 21:00:12 -05:00
paging kernel: mmu: z_backing_store* to k_mem_paging_backing_store* 2021-05-28 11:33:22 -04:00
atomic_c.c
banner.c
cache_handlers.c
CMakeLists.txt kernel: move thread usage routines to own file 2022-01-10 10:38:06 -05:00
compiler_stack_protect.c
condvar.c
device.c device: deprecate (z_)device_usable_check 2022-01-07 10:41:23 -05:00
errno.c
events.c kernel: add support for event objects 2021-10-16 06:27:10 -04:00
fatal.c
futex.c futex: Avoid unnecessary lock 2021-07-30 20:21:04 -04:00
idle.c pm: Do not suspend during kernel initialization 2022-01-19 14:14:28 -05:00
init.c kernel/init.c: allow for memset/memcpy alternatives during early boot 2022-02-21 21:00:12 -05:00
Kconfig kernel: move CONFIG_MMU into kernel Kconfig 2022-01-18 19:18:30 -05:00
Kconfig.vm kernel: introduce hidden CONFIG_KERNEL_VM_SUPPORT 2022-01-18 19:18:30 -05:00
kheap.c kernel: kheap: make init work with demand paging 2021-08-26 21:16:22 -04:00
mailbox.c kernel: remove @return doc for void functions 2022-01-12 16:02:16 -05:00
main_weak.c kernel: extract __weak main() into independent file 2021-08-28 08:48:03 -04:00
mem_domain.c kernel: mem_domain: k_mem_domain_add_thread to return errors 2021-11-22 12:45:22 -05:00
mem_slab.c kernel: remove @return doc for void functions 2022-01-12 16:02:16 -05:00
mempool.c Tracing: k_free tracing hook heap reference added 2021-11-16 09:45:01 -05:00
mmu.c kernel: mmu: Fix access to unpacked member inside packed struct 2021-12-10 14:08:59 +01:00
msg_q.c
mutex.c kernel: Fix negative mutex lock_count value 2021-07-06 19:19:41 -04:00
pipes.c kernel: pipes: add pipe flush routines 2022-01-10 12:17:14 -05:00
poll.c poll: modify the function z_vrfy_k_poll 2021-11-25 18:23:51 -05:00
queue.c
sched.c kernel: move thread usage routines to own file 2022-01-10 10:38:06 -05:00
sem.c
smp.c kernel: smp: change back the order of SMP thread and timer initialization 2022-01-18 12:59:50 -05:00
stack.c
system_work_q.c
thread.c kernel: Add function for calculating stack usage 2022-02-21 20:57:17 -05:00
timeout.c kernel: Fix timeout issue with SYSTEM_CLOCK_SLOPPY_IDLE 2022-02-15 13:05:04 -05:00
timer.c kernel: remove @return doc for void functions 2022-01-12 16:02:16 -05:00
usage.c kernel: Update CPU runtime stats of non-idle time 2022-01-20 08:22:01 -05:00
userspace_handler.c
userspace.c kernel: Fix typo in macro name 2022-01-07 11:20:46 -05:00
version.c
work.c kernel: work: remove unused if statement 2021-12-13 17:20:56 -05:00
xip.c kernel/init.c: allow for memset/memcpy alternatives during early boot 2022-02-21 21:00:12 -05:00