nuttx/arch
liang.huang bdfa666f3e arch/risc-v: fix stale ustkptr used for backtrace in kernel stack mode
xcp.ustkptr is only assigned once in up_initial_state() when a task is
created and, since the syscall fast path was optimized in
e6973c764c, is never updated afterwards. up_backtrace() used
"ustkptr != NULL" to decide whether a task is currently blocked
inside a syscall, and *(ustkptr + 1) as the frame pointer to resume
tracing from. Since ustkptr is now a dead value fixed at task
creation time, the check is always true and the "frame pointer" it
derives points at stale data near the initial stack top, unrelated
to where the task is actually blocked.

Use rtcb->flags & TCB_FLAG_SYSCALL together with xcp.sregs, which
dispatch_syscall() maintains precisely across the entire syscall
execution window (including any nested context switches caused by
blocking), to locate the frame pointer/return address saved at
syscall entry instead.

Signed-off-by: liang.huang <liang.huang@houmo.ai>
2026-08-03 20:58:32 +08:00
..
arm arch/common: fix host_flags_to_mode() O_RDONLY sentinel collision 2026-08-03 20:58:21 +08:00
arm64 arch/common: fix host_flags_to_mode() O_RDONLY sentinel collision 2026-08-03 20:58:21 +08:00
avr arch/avr/src/avrdx/avrdx_delay: add custom up_udelay function 2026-06-17 17:10:02 +08:00
ceva arch/ceva: Replace board_app_initialize 2026-05-02 18:36:46 +08:00
dummy
hc style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
mips drivers: Fix comment typos — 'Pubic' → 'Public' across drivers and headers. 2026-07-04 02:00:24 +08:00
misoc include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
or1k include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
renesas drivers/efuse/efuse: Drivers Registered With World Write Permissions(Part 1) 2026-08-03 17:23:22 +08:00
risc-v arch/risc-v: fix stale ustkptr used for backtrace in kernel stack mode 2026-08-03 20:58:32 +08:00
sim !include/fcntl.h: align open flags with Linux values 2026-07-03 10:33:47 +08:00
sparc drivers: Fix comment typos — 'Pubic' → 'Public' across drivers and headers. 2026-07-04 02:00:24 +08:00
tricore arch/tricore: Add hardware debug breakpoint and watchpoint support. 2026-05-22 15:38:36 +08:00
x86 drivers/efuse/efuse: Drivers Registered With World Write Permissions(Part 1) 2026-08-03 17:23:22 +08:00
x86_64 !include/fcntl.h: align open flags with Linux values 2026-07-03 10:33:47 +08:00
xtensa drivers/: Multiple Drivers Are Registered With World Writable - Part 2 2026-08-03 17:23:22 +08:00
z16 include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
z80 style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
CMakeLists.txt
Kconfig sched/clock/clock_delay: added config flag to remove weak up_udelay 2026-06-17 17:10:02 +08:00