215 |
|
#endif |
216 |
|
#define SIGSEGV_FAULT_HANDLER_ARGLIST int sig, siginfo_t *sip, void *scp |
217 |
|
#define SIGSEGV_FAULT_ADDRESS sip->si_addr |
218 |
+ |
#if defined(__NetBSD__) || defined(__FreeBSD__) |
219 |
|
#if (defined(i386) || defined(__i386__)) |
220 |
|
#define SIGSEGV_FAULT_INSTRUCTION (((struct sigcontext *)scp)->sc_eip) |
221 |
|
#define SIGSEGV_REGISTER_FILE ((unsigned int *)&(((struct sigcontext *)scp)->sc_edi)) /* EDI is the first GPR (even below EIP) in sigcontext */ |
221 |
– |
/* (gb) Disable because this would hang configure script for some reason |
222 |
– |
* though standalone testing gets it right. Any idea why? |
222 |
|
#define SIGSEGV_SKIP_INSTRUCTION ix86_skip_instruction |
223 |
< |
*/ |
223 |
> |
#endif |
224 |
|
#endif |
225 |
|
#if defined(__linux__) |
226 |
|
#if (defined(i386) || defined(__i386__)) |
230 |
|
#define SIGSEGV_REGISTER_FILE (unsigned int *)SIGSEGV_CONTEXT_REGS |
231 |
|
#define SIGSEGV_SKIP_INSTRUCTION ix86_skip_instruction |
232 |
|
#endif |
233 |
+ |
#if (defined(x86_64) || defined(__x86_64__)) |
234 |
+ |
#include <sys/ucontext.h> |
235 |
+ |
#define SIGSEGV_CONTEXT_REGS (((ucontext_t *)scp)->uc_mcontext.gregs) |
236 |
+ |
#define SIGSEGV_FAULT_INSTRUCTION SIGSEGV_CONTEXT_REGS[16] /* should use REG_RIP instead */ |
237 |
+ |
#define SIGSEGV_REGISTER_FILE (unsigned long *)SIGSEGV_CONTEXT_REGS |
238 |
+ |
#endif |
239 |
|
#if (defined(ia64) || defined(__ia64__)) |
240 |
|
#define SIGSEGV_FAULT_INSTRUCTION (((struct sigcontext *)scp)->sc_ip & ~0x3ULL) /* slot number is in bits 0 and 1 */ |
241 |
|
#endif |