nuttx/libs/libc/machine
Marco Casaroli f0669ebd59 arch/arm64: Save d8-d15 in setjmp() and make jmp_buf hold them.
arch_setjmp.S stores d8-d15 only under CONFIG_ARCH_FPU, but it did not
include nuttx/config.h.  So setjmp() never saved these registers and
longjmp() never restored them.  They are callee-saved (AAPCS64), so a
function that kept a value in one of them could see it change after a
longjmp().

Include nuttx/config.h.  The assembly then stores d8-d15, eight bytes
each, at offsets 112 to 176.  struct setjmp_buf_s declared them as
eight 4-byte floats, 32 bytes short, so declare them as uint64_t too.
jmp_buf is now 176 bytes with the FPU, and its layout matches the
assembly.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-10-09 06:11:29 -03:00
..
arm libs/libc/machine/arm: Include nuttx/config.h in arch_mcount.S. 2026-10-09 06:07:54 -03:00
arm64 arch/arm64: Save d8-d15 in setjmp() and make jmp_buf hold them. 2026-10-09 06:11:29 -03:00
mips arch/mips: Add support for loadable ELF modules 2026-08-11 09:46:46 -03:00
renesas
risc-v libs/libc/machine/risc-v: Compare a register at a time on equal offsets. 2026-08-17 12:24:06 +02:00
sim include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
sparc include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
tricore arch/tricore: drop illd dependence for atomic 2026-08-25 10:07:25 +08:00
x86 include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
x86_64 libs/libc/machine/x86_64: accept R_X86_64_NONE relocations 2026-10-03 21:55:56 +08:00
xtensa include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
arch_atomic.c libc/machine: realize atomic based on hwspinlock 2026-08-27 11:13:29 +08:00
arch_atomic.h libc/machine: split atomic into header, arch_atomic_irq.c, arch_atomic64.c 2026-08-24 13:20:45 +08:00
arch_atomic64.c nuttx/atomic: use toolchain builtin atomic function 2026-08-24 13:20:45 +08:00
arch_libc.c string:use builtin function to optimize libc function 2025-12-20 10:38:53 +08:00
CMakeLists.txt libc/machine: realize atomic based on hwspinlock 2026-08-27 11:13:29 +08:00
Kconfig libc/machine: realize atomic based on hwspinlock 2026-08-27 11:13:29 +08:00
Make.defs libc/machine: realize atomic based on hwspinlock 2026-08-27 11:13:29 +08:00