zephyr/arch
Yong Cong Sin 26d75ab796 arch: riscv: optionally stores a pointer to csf in struct arch_esf
The callee-saved-registers can be helpful to debug the state of
a core upon an exception, however, currently there's no way to
access that information in user-implemented
`k_sys_fatal_error_handler()`, even though the csf is already stored
in the stack.

This patch conditionally add a `csf` member in the `arch_esf` when
`CONFIG_EXTRA_EXCEPTION_INFO=y`*, which the `_isr_wrapper` would update
when a fatal error occurs before invoking `z_riscv_fatal_error_csf()`.

Functions such as `k_sys_fatal_error_handler()` would then be able
to access the callee-saved-registers at the time of exception via
`esf->csf`.

* For SoCs that select `RISCV_SOC_HAS_ISR_STACKING`, the
  `SOC_ISR_STACKING_ESF_DECLARE` has to include the `csf` member,
  otherwise the build would fail.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-09-10 11:43:40 +02:00
..
arc arch: arc: replace ARC_EARLY_SOC_INIT with PLATFORM_RESET_HOOK 2024-09-09 10:07:33 +02:00
arm arch: arm: select PLATFORM_RESET_HOOK if is PLATFORM_SPECIFIC_INIT set 2024-09-09 10:07:33 +02:00
arm64 init: introduce soc and board hooks 2024-09-09 10:07:33 +02:00
common arch: multilevel_irq: fix interrupt bits check 2024-09-06 14:06:23 -05:00
mips init: introduce soc and board hooks 2024-09-09 10:07:33 +02:00
nios2 init: introduce soc and board hooks 2024-09-09 10:07:33 +02:00
posix arch posix: Implement arch_thread_name_set() 2024-08-23 08:01:33 -04:00
riscv arch: riscv: optionally stores a pointer to csf in struct arch_esf 2024-09-10 11:43:40 +02:00
sparc init: introduce soc and board hooks 2024-09-09 10:07:33 +02:00
x86 x86: skip printing args when unwinding stack 2024-09-09 18:41:04 -04:00
xtensa init: introduce soc and board hooks 2024-09-09 10:07:33 +02:00
archs.yml hwmv2: Introduce Hardware model version 2 and convert devices 2024-03-02 16:56:33 -05:00
CMakeLists.txt
Kconfig arch: riscv: add an option for empty spurious interrupt handler 2024-09-02 12:35:57 -04:00
Kconfig.v1 hwmv2: Introduce Hardware model version 2 and convert devices 2024-03-02 16:56:33 -05:00
Kconfig.v2 hwmv2: Introduce Hardware model version 2 and convert devices 2024-03-02 16:56:33 -05:00