This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit a98f7a104542f7119e587b7a7d34f0f51d7e1229
Author: Tiago Medicci Serrano <tiago.medi...@espressif.com>
AuthorDate: Fri Jun 20 14:11:40 2025 -0300

    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.
---
 arch/risc-v/src/common/riscv_swint.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/risc-v/src/common/riscv_swint.c 
b/arch/risc-v/src/common/riscv_swint.c
index 9ecd4c78e0..7b92136d17 100644
--- a/arch/risc-v/src/common/riscv_swint.c
+++ b/arch/risc-v/src/common/riscv_swint.c
@@ -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
     {

Reply via email to