zephyr/arch/riscv/include
Nicolas Pitre 00a9634c05 riscv: new TLS-based arch_is_user_context() implementation
This reverts the bulk of commit c8bfc2afda ("riscv: make
arch_is_user_context() SMP compatible") and replaces it with a flag
stored in the thread local storage (TLS) area, therefore making TLS
mandatory for userspace support on RISC-V.

This has many advantages:

- The tp (x4) register is already dedicated by the standard for this
  purpose, making TLS support almost free.

- This is very efficient, requiring only a single instruction to clear
  and 2 instructions to set.

- This makes the SMP case much more efficient. No need for funky
  exception code any longer.

- SMP and non-SMP now use the same implementation making maintenance
  easier.

- The is_user_mode variable no longer requires a dedicated PMP mapping
  and therefore freeing one PMP slot for other purposes.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>

5f65dbcc9dab3d39473b05397e05.
2022-06-23 13:12:05 -04:00
..
kernel_arch_data.h arch: migrate includes to <zephyr/...> 2022-05-06 19:57:22 +02:00
kernel_arch_func.h riscv: new TLS-based arch_is_user_context() implementation 2022-06-23 13:12:05 -04:00
offsets_short_arch.h riscv: implement arch_switch() 2022-03-21 07:28:05 -04:00
pmp.h riscv: pmp: add new usermode support 2022-04-29 15:30:00 +02:00