Skip to content

Commit

Permalink
core: riscv: Support fault mitigations in non-threaded code
Browse files Browse the repository at this point in the history
The commit ce56605 supports fault mitigations in non-threaded code
for ARM architecture. This commit adds the related modification for
RISC-V architecture to support it too. Also the indentation in
__ftmn_get_tsd_func_arg_pp() is fixed.

Signed-off-by: Alvin Chang <alvinga@andestech.com>
  • Loading branch information
gagachang committed Oct 7, 2023
1 parent 3afba46 commit 71da903
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions core/arch/riscv/include/kernel/thread_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion lib/libutils/ext/include/fault_mitigation.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 71da903

Please sign in to comment.