Skip to content
Commit 34d2c4d6 authored by Chen Xingyu's avatar Chen Xingyu Committed by Carles Cufi
Browse files

soc: riscv: privileged: Conditionally override `arch_cpu_idle()`



The current configuration comes with a common implementation of
`arch_cpu_idle()` for the whole riscv-privileged family, utilizing the
`WFI` instruction to place the CPU into a light sleep state, with the
assumption that it will be awakened later by interrupts such as SYSTICK.
However, this approach is not always effective, particularly in scenarios
where the SYSTICK is not a valid wake source.

This commit uses `CONFIG_RISCV_HAS_CPU_IDLE` as the build condition of the
family-level `idle.c`, allowing CPUs that do not enable this option to
fallback to a generic arch-level implementation in
`arch/riscv/core/cpu_idle.c`.

Signed-off-by: default avatarChen Xingyu <hi@xingrz.me>
parent fcee384a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment