Skip to content

Commit

Permalink
arch/risc-v/src/common/supervisor/riscv_perform_syscall.c: Record the…
Browse files Browse the repository at this point in the history
… currently running task in risc-v syscall

If a context switch occurs in syscall, the g_running_task need to be recorded for assert logic.
This copies the logic from arm platforms

Signed-off-by: Jukka Laitinen <[email protected]>
  • Loading branch information
jlaitine committed Mar 21, 2024
1 parent f5bc130 commit 13ea8e1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions arch/risc-v/src/common/supervisor/riscv_perform_syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include <nuttx/addrenv.h>

#include "sched/sched.h"
#include "riscv_internal.h"

/****************************************************************************
Expand Down Expand Up @@ -59,6 +60,12 @@ void *riscv_perform_syscall(uintptr_t *regs)

if (regs != CURRENT_REGS)
{
/* Record the new "running" task. g_running_tasks[] is only used by
* assertion logic for reporting crashes.
*/

g_running_tasks[this_cpu()] = this_task();

/* Restore the cpu lock */

restore_critical_section();
Expand Down

0 comments on commit 13ea8e1

Please sign in to comment.