diff --git a/core/arch/riscv/include/kernel/thread_arch.h b/core/arch/riscv/include/kernel/thread_arch.h index e150fa10e86..1e2da17b726 100644 --- a/core/arch/riscv/include/kernel/thread_arch.h +++ b/core/arch/riscv/include/kernel/thread_arch.h @@ -32,6 +32,9 @@ struct thread_core_local { #ifdef CFG_CORE_DEBUG_CHECK_STACKS bool stackcheck_recursion; #endif +#ifdef CFG_FAULT_MITIGATION + struct ftmn_func_arg *ftmn_arg; +#endif } THREAD_CORE_LOCAL_ALIGNED; struct thread_user_vfp_state { diff --git a/lib/libutils/ext/include/fault_mitigation.h b/lib/libutils/ext/include/fault_mitigation.h index b0610ba22a5..06a6f7f017b 100644 --- a/lib/libutils/ext/include/fault_mitigation.h +++ b/lib/libutils/ext/include/fault_mitigation.h @@ -250,7 +250,7 @@ extern struct ftmn_func_arg *__ftmn_global_func_arg; static inline struct ftmn_func_arg **__ftmn_get_tsd_func_arg_pp(void) { #if defined(CFG_FAULT_MITIGATION) && defined(__KERNEL__) - if (thread_get_id_may_fail() >= 0) + if (thread_get_id_may_fail() >= 0) return &thread_get_tsd()->ftmn_arg; else return &thread_get_core_local()->ftmn_arg;