226 |
|
|
227 |
|
#if HAVE_SIGINFO_T |
228 |
|
// Generic extended signal handler |
229 |
< |
#if defined(__NetBSD__) || defined(__FreeBSD__) |
229 |
> |
#if defined(__FreeBSD__) |
230 |
|
#define SIGSEGV_ALL_SIGNALS FAULT_HANDLER(SIGBUS) |
231 |
|
#else |
232 |
|
#define SIGSEGV_ALL_SIGNALS FAULT_HANDLER(SIGSEGV) |
264 |
|
#define SIGSEGV_SKIP_INSTRUCTION ix86_skip_instruction |
265 |
|
#endif |
266 |
|
#endif |
267 |
+ |
#if defined(__NetBSD__) |
268 |
+ |
#if (defined(i386) || defined(__i386__)) |
269 |
+ |
#include <sys/ucontext.h> |
270 |
+ |
#define SIGSEGV_CONTEXT_REGS (((ucontext_t *)scp)->uc_mcontext.__gregs) |
271 |
+ |
#define SIGSEGV_FAULT_INSTRUCTION SIGSEGV_CONTEXT_REGS[_REG_EIP] |
272 |
+ |
#define SIGSEGV_REGISTER_FILE (unsigned long *)SIGSEGV_CONTEXT_REGS |
273 |
+ |
#define SIGSEGV_SKIP_INSTRUCTION ix86_skip_instruction |
274 |
+ |
#endif |
275 |
+ |
#endif |
276 |
|
#if defined(__linux__) |
277 |
|
#if (defined(i386) || defined(__i386__)) |
278 |
|
#include <sys/ucontext.h> |
693 |
|
#endif |
694 |
|
}; |
695 |
|
#endif |
696 |
< |
#if defined(__NetBSD__) || defined(__FreeBSD__) |
696 |
> |
#if defined(__NetBSD__) |
697 |
> |
enum { |
698 |
> |
#if (defined(i386) || defined(__i386__)) |
699 |
> |
X86_REG_EIP = _REG_EIP, |
700 |
> |
X86_REG_EAX = _REG_EAX, |
701 |
> |
X86_REG_ECX = _REG_ECX, |
702 |
> |
X86_REG_EDX = _REG_EDX, |
703 |
> |
X86_REG_EBX = _REG_EBX, |
704 |
> |
X86_REG_ESP = _REG_ESP, |
705 |
> |
X86_REG_EBP = _REG_EBP, |
706 |
> |
X86_REG_ESI = _REG_ESI, |
707 |
> |
X86_REG_EDI = _REG_EDI |
708 |
> |
#endif |
709 |
> |
}; |
710 |
> |
#endif |
711 |
> |
#if defined(__FreeBSD__) |
712 |
|
enum { |
713 |
|
#if (defined(i386) || defined(__i386__)) |
714 |
|
X86_REG_EIP = 10, |