zephyr/kernel/include
Nicolas Pitre 1f362a81f1 riscv: fix crash resulting from touching the initial stack's guard area
The interrupt stack is used as the system stack during kernel
initialization while IRQs are not yet enabled. The sp register is
set to z_interrupt_stacks + CONFIG_ISR_STACK_SIZE.

CONFIG_ISR_STACK_SIZE only represents the desired usable stack size.
This does not take into account the added guard area. Result is a stack
whose pointer is much closer to the trigger zone than expected when
CONFIG_PMP_STACK_GUARD=y, and the SMP configuration in particular pushes
it over the edge during many CI test cases.

Worse: during early init we're not quite ready to handle exceptions
yet and complete havoc ensues with no meaningful debugging output.

Make sure the early assembly code locates the actual top of the stack
by generating a constant with its true size.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2022-09-28 07:53:56 +00:00
..
gen_offset.h kernel: migrate includes to <zephyr/...> 2022-05-09 09:26:20 +02:00
kernel_arch_interface.h kernel: migrate includes to <zephyr/...> 2022-05-09 09:26:20 +02:00
kernel_internal.h kernel: Migrate to K_KERNEL_PINNED_STACK_ARRAY_DECLARE 2022-06-20 10:25:52 +02:00
kernel_offsets.h riscv: fix crash resulting from touching the initial stack's guard area 2022-09-28 07:53:56 +00:00
kernel_tls.h kernel: migrate includes to <zephyr/...> 2022-05-09 09:26:20 +02:00
ksched.h kernel: migrate includes to <zephyr/...> 2022-05-09 09:26:20 +02:00
kswap.h kernel: Init the base.slice_ticks for dummy_thread 2022-08-04 19:44:24 -04:00
mmu.h kernel: migrate includes to <zephyr/...> 2022-05-09 09:26:20 +02:00
offsets_short.h