arch/risc-v: Fix debugging syscall info

This commit fixes an issue when `CONFIG_DEBUG_SYSCALL_INFO=y`: the
`cmd` variable doesn't exist (instead, `regs[REG_A0]` represents
the syscall command directly. Also, it fixes the parameter for
`up_dump_register`, as `tcb` is a pointer here. By applying these
fixes, debugging syscall info is now possible again.
This commit is contained in:
Tiago Medicci Serrano 2025-06-20 14:11:40 -03:00 committed by Xiang Xiao
parent c3cccf7d43
commit ef39cffe63

View file

@ -312,10 +312,10 @@ int riscv_swint(int irq, void *context, void *arg)
*/
#ifdef CONFIG_DEBUG_SYSCALL_INFO
if (cmd <= SYS_switch_context)
if (regs[REG_A0] <= SYS_switch_context)
{
svcinfo("SWInt Return: Context switch!\n");
up_dump_register(tcb.xcp.regs);
up_dump_register(tcb->xcp.regs);
}
else
{