/* DWARF2 EH unwinding support for MIPS Linux.
- Copyright (C) 2004-2013 Free Software Foundation, Inc.
+ Copyright (C) 2004-2024 Free Software Foundation, Inc.
This file is part of GCC.
state data appropriately. See unwind-dw2.c for the structs. */
#include <signal.h>
-#include <asm/unistd.h>
+#include <sys/syscall.h>
/* The third parameter to the signal handler points to something with
* this structure defined in asm/ucontext.h, but the name clashes with
_Unwind_Ptr new_cfa, reg_offset;
int i;
+ /* A MIPS16 or microMIPS frame. Signal frames always use the standard
+ ISA encoding. */
+ if ((_Unwind_Ptr) pc & 3)
+ return _URC_END_OF_STACK;
+
/* 24021061 li v0, 0x1061 (rt_sigreturn)*/
/* 0000000c syscall */
/* or */
new_cfa = (_Unwind_Ptr) sc;
fs->regs.cfa_how = CFA_REG_OFFSET;
- fs->regs.cfa_reg = STACK_POINTER_REGNUM;
+ fs->regs.cfa_reg = __LIBGCC_STACK_POINTER_REGNUM__;
fs->regs.cfa_offset = new_cfa - (_Unwind_Ptr) context->cfa;
/* On o32 Linux, the register save slots in the sigcontext are
#endif
for (i = 0; i < 32; i++) {
- fs->regs.reg[i].how = REG_SAVED_OFFSET;
+ fs->regs.how[i] = REG_SAVED_OFFSET;
fs->regs.reg[i].loc.offset
= (_Unwind_Ptr)&(sc->sc_regs[i]) + reg_offset - new_cfa;
}
Note that setting fs->signal_frame would not work. As the comment
above MASK_RETURN_ADDR explains, MIPS unwinders must earch for an
odd-valued address. */
- fs->regs.reg[DWARF_ALT_FRAME_RETURN_COLUMN].how = REG_SAVED_VAL_OFFSET;
- fs->regs.reg[DWARF_ALT_FRAME_RETURN_COLUMN].loc.offset
+ fs->regs.how[__LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__]
+ = REG_SAVED_VAL_OFFSET;
+ fs->regs.reg[__LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__].loc.offset
= (_Unwind_Ptr)(sc->sc_pc) + 2 - new_cfa;
- fs->retaddr_column = DWARF_ALT_FRAME_RETURN_COLUMN;
+ fs->retaddr_column = __LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__;
return _URC_NO_REASON;
}