256 |
|
#define SIGSEGV_REGISTER_FILE ((unsigned long *)SIGSEGV_CONTEXT_REGS), SIGSEGV_SPARC_GWINDOWS, SIGSEGV_SPARC_RWINDOW |
257 |
|
#define SIGSEGV_SKIP_INSTRUCTION sparc_skip_instruction |
258 |
|
#endif |
259 |
+ |
#if defined(__i386__) |
260 |
+ |
#include <sys/regset.h> |
261 |
+ |
#define SIGSEGV_CONTEXT_REGS (((ucontext_t *)scp)->uc_mcontext.gregs) |
262 |
+ |
#define SIGSEGV_FAULT_INSTRUCTION SIGSEGV_CONTEXT_REGS[EIP] |
263 |
+ |
#define SIGSEGV_REGISTER_FILE (unsigned long *)SIGSEGV_CONTEXT_REGS |
264 |
+ |
#define SIGSEGV_SKIP_INSTRUCTION ix86_skip_instruction |
265 |
+ |
#endif |
266 |
|
#endif |
267 |
|
#if defined(__FreeBSD__) |
268 |
|
#if (defined(i386) || defined(__i386__)) |
737 |
|
#endif |
738 |
|
}; |
739 |
|
#endif |
740 |
+ |
#if defined(__sun__) |
741 |
+ |
// Same as for Linux, need to check for x86-64 |
742 |
+ |
enum { |
743 |
+ |
#if defined(__i386__) |
744 |
+ |
X86_REG_EIP = EIP, |
745 |
+ |
X86_REG_EAX = EAX, |
746 |
+ |
X86_REG_ECX = ECX, |
747 |
+ |
X86_REG_EDX = EDX, |
748 |
+ |
X86_REG_EBX = EBX, |
749 |
+ |
X86_REG_ESP = ESP, |
750 |
+ |
X86_REG_EBP = EBP, |
751 |
+ |
X86_REG_ESI = ESI, |
752 |
+ |
X86_REG_EDI = EDI |
753 |
+ |
#endif |
754 |
+ |
}; |
755 |
+ |
#endif |
756 |
|
#if defined(_WIN32) |
757 |
|
enum { |
758 |
|
#if (defined(i386) || defined(__i386__)) |
2148 |
|
if (vm_init() < 0) |
2149 |
|
return 1; |
2150 |
|
|
2151 |
< |
#ifdef _WIN32 |
2129 |
< |
page_size = 4096; |
2130 |
< |
#else |
2131 |
< |
page_size = getpagesize(); |
2132 |
< |
#endif |
2151 |
> |
page_size = vm_get_page_size(); |
2152 |
|
if ((page = (char *)vm_acquire(page_size)) == VM_MAP_FAILED) |
2153 |
|
return 2; |
2154 |
|
|