Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Modules/_testinternalcapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ static const uintptr_t min_frame_pointer_addr = 0x1000;
// https://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi-1.9.html#STACK
# define FRAME_POINTER_NEXT_OFFSET 0
# define FRAME_POINTER_RETURN_OFFSET 2
#elif defined(__riscv)
// RISC-V saves the return address at fp[-1], and the previous frame pointer at fp[-2].
// See: https://riscv-non-isa.github.io/riscv-elf-psabi-doc/#_frame_pointer_convention
# define FRAME_POINTER_NEXT_OFFSET -2
# define FRAME_POINTER_RETURN_OFFSET -1
#else
# define FRAME_POINTER_NEXT_OFFSET 0
# define FRAME_POINTER_RETURN_OFFSET 1
Expand Down
Loading