arch: riscv: added support for custom initialization of gp register

Plus added implementation for esp32c3 SoC.

Signed-off-by: Felipe Neves <ryukokki.felipe@gmail.com>
Signed-off-by: Felipe Neves <felipe.neves@espressif.com>
This commit is contained in:
Felipe Neves 2021-06-14 11:10:47 -03:00 committed by Anas Nashif
commit 7b09d031fa
4 changed files with 18 additions and 0 deletions

View file

@ -47,6 +47,10 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
stack_init->a2 = (ulong_t)p2;
stack_init->a3 = (ulong_t)p3;
#ifdef CONFIG_RISCV_SOC_INIT_GP_VALUE
stack_init->gp = __soc_get_gp_initial_value();
#endif
#ifdef CONFIG_THREAD_LOCAL_STORAGE
stack_init->tp = (ulong_t)thread->tls;
#endif