225 |
|
#else |
226 |
|
static struct sigaction sigsegv_action; // Data access exception signal (of emulator thread) |
227 |
|
static struct sigaction sigill_action; // Illegal instruction signal (of emulator thread) |
228 |
< |
static struct sigaltstack sig_stack; // Stack for signal handlers |
229 |
< |
static struct sigaltstack extra_stack; // Stack for SIGSEGV inside interrupt handler |
228 |
> |
static stack_t sig_stack; // Stack for signal handlers |
229 |
> |
static stack_t extra_stack; // Stack for SIGSEGV inside interrupt handler |
230 |
|
static bool emul_thread_fatal = false; // Flag: MacOS thread crashed, tick thread shall dump debug output |
231 |
|
static sigregs sigsegv_regs; // Register dump when crashed |
232 |
|
static const char *crash_reason = NULL; // Reason of the crash (SIGSEGV, SIGBUS, SIGILL) |
1623 |
|
*/ |
1624 |
|
|
1625 |
|
#if !EMULATED_PPC |
1626 |
+ |
// XXX: don't redefine locally? |
1627 |
+ |
// Note: Original declaration is in sigsegv.cpp |
1628 |
+ |
// FIXME: If HAVE_MACH_EXCEPTIONS is set, sigsegv_info_t has a bunch of other |
1629 |
+ |
// fields too! Let's hope Screen_fault_handler() doesn't use them... |
1630 |
+ |
struct sigsegv_info_t { |
1631 |
+ |
sigsegv_address_t addr; |
1632 |
+ |
sigsegv_address_t pc; |
1633 |
+ |
}; |
1634 |
+ |
|
1635 |
|
static void sigsegv_handler(int sig, siginfo_t *sip, void *scp) |
1636 |
|
{ |
1637 |
|
machine_regs *r = MACHINE_REGISTERS(scp); |
1650 |
|
|
1651 |
|
#if ENABLE_VOSF |
1652 |
|
// Handle screen fault |
1644 |
– |
// XXX: don't redefine locally? |
1653 |
|
#if SIGSEGV_CHECK_VERSION(1,0,0) |
1646 |
– |
struct sigsegv_info_t { |
1647 |
– |
sigsegv_address_t addr; |
1648 |
– |
sigsegv_address_t pc; |
1649 |
– |
}; |
1654 |
|
sigsegv_info_t si; |
1655 |
|
si.addr = (sigsegv_address_t)addr; |
1656 |
|
si.pc = (sigsegv_address_t)r->pc(); |