1 |
|
/* |
2 |
|
* sheepshaver_glue.cpp - Glue Kheperix CPU to SheepShaver CPU engine interface |
3 |
|
* |
4 |
< |
* SheepShaver (C) 1997-2005 Christian Bauer and Marc Hellwig |
4 |
> |
* SheepShaver (C) 1997-2008 Christian Bauer and Marc Hellwig |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
171 |
|
void interrupt(uint32 entry); |
172 |
|
|
173 |
|
// Make sure the SIGSEGV handler can access CPU registers |
174 |
< |
friend sigsegv_return_t sigsegv_handler(sigsegv_address_t, sigsegv_address_t); |
174 |
> |
friend sigsegv_return_t sigsegv_handler(sigsegv_info_t *sip); |
175 |
|
}; |
176 |
|
|
177 |
|
sheepshaver_cpu::sheepshaver_cpu() |
730 |
|
* Initialize CPU emulation |
731 |
|
*/ |
732 |
|
|
733 |
< |
sigsegv_return_t sigsegv_handler(sigsegv_address_t fault_address, sigsegv_address_t fault_instruction) |
733 |
> |
sigsegv_return_t sigsegv_handler(sigsegv_info_t *sip) |
734 |
|
{ |
735 |
|
#if ENABLE_VOSF |
736 |
|
// Handle screen fault |
737 |
< |
extern bool Screen_fault_handler(sigsegv_address_t, sigsegv_address_t); |
738 |
< |
if (Screen_fault_handler(fault_address, fault_instruction)) |
737 |
> |
extern bool Screen_fault_handler(sigsegv_info_t *sip); |
738 |
> |
if (Screen_fault_handler(sip)) |
739 |
|
return SIGSEGV_RETURN_SUCCESS; |
740 |
|
#endif |
741 |
|
|
742 |
< |
const uintptr addr = (uintptr)fault_address; |
742 |
> |
const uintptr addr = (uintptr)sigsegv_get_fault_address(sip); |
743 |
|
#if HAVE_SIGSEGV_SKIP_INSTRUCTION |
744 |
|
// Ignore writes to ROM |
745 |
|
if ((addr - (uintptr)ROMBaseHost) < ROM_SIZE) |
790 |
|
#endif |
791 |
|
|
792 |
|
fprintf(stderr, "SIGSEGV\n"); |
793 |
< |
fprintf(stderr, " pc %p\n", fault_instruction); |
794 |
< |
fprintf(stderr, " ea %p\n", fault_address); |
793 |
> |
fprintf(stderr, " pc %p\n", sigsegv_get_fault_instruction_address(sip)); |
794 |
> |
fprintf(stderr, " ea %p\n", sigsegv_get_fault_address(sip)); |
795 |
|
dump_registers(); |
796 |
|
ppc_cpu->dump_log(); |
797 |
|
enter_mon(); |