mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-01-26 16:31:11 +00:00
Sync with the new SIGSEGV API.
This commit is contained in:
parent
902079ec8e
commit
016dfddd79
@ -129,13 +129,13 @@ static int vm_acquire_mac_fixed(void *addr, size_t size)
|
||||
* SIGSEGV handler
|
||||
*/
|
||||
|
||||
static sigsegv_return_t sigsegv_handler(sigsegv_address_t fault_address,
|
||||
sigsegv_address_t fault_instruction)
|
||||
static sigsegv_return_t sigsegv_handler(sigsegv_info_t *sip)
|
||||
{
|
||||
const uintptr fault_address = (uintptr)sigsegv_get_fault_address(sip);
|
||||
#if ENABLE_VOSF
|
||||
// Handle screen fault
|
||||
extern bool Screen_fault_handler(sigsegv_address_t, sigsegv_address_t);
|
||||
if (Screen_fault_handler(fault_address, fault_instruction))
|
||||
extern bool Screen_fault_handler(sigsegv_info_t *sip);
|
||||
if (Screen_fault_handler(sip))
|
||||
return SIGSEGV_RETURN_SUCCESS;
|
||||
#endif
|
||||
|
||||
@ -157,10 +157,12 @@ static sigsegv_return_t sigsegv_handler(sigsegv_address_t fault_address,
|
||||
* Dump state when everything went wrong after a SEGV
|
||||
*/
|
||||
|
||||
static void sigsegv_dump_state(sigsegv_address_t fault_address, sigsegv_address_t fault_instruction)
|
||||
static void sigsegv_dump_state(sigsegv_info_t *sip)
|
||||
{
|
||||
const sigsegv_address_t fault_address = sigsegv_get_fault_address(sip);
|
||||
const sigsegv_address_t fault_instruction = sigsegv_get_fault_instruction_address(sip);
|
||||
fprintf(stderr, "Caught SIGSEGV at address %p", fault_address);
|
||||
if (fault_instruction != SIGSEGV_INVALID_PC)
|
||||
if (fault_instruction != SIGSEGV_INVALID_ADDRESS)
|
||||
fprintf(stderr, " [IP=%p]", fault_instruction);
|
||||
fprintf(stderr, "\n");
|
||||
uaecptr nextpc;
|
||||
|
@ -245,12 +245,13 @@ static int vm_acquire_mac_fixed(void *addr, size_t size)
|
||||
* SIGSEGV handler
|
||||
*/
|
||||
|
||||
static sigsegv_return_t sigsegv_handler(sigsegv_address_t fault_address, sigsegv_address_t fault_instruction)
|
||||
static sigsegv_return_t sigsegv_handler(sigsegv_info_t *sip)
|
||||
{
|
||||
const uintptr fault_address = (uintptr)sigsegv_get_fault_address(sip);
|
||||
#if ENABLE_VOSF
|
||||
// Handle screen fault
|
||||
extern bool Screen_fault_handler(sigsegv_address_t, sigsegv_address_t);
|
||||
if (Screen_fault_handler(fault_address, fault_instruction))
|
||||
extern bool Screen_fault_handler(sigsegv_info_t *sip);
|
||||
if (Screen_fault_handler(sip))
|
||||
return SIGSEGV_RETURN_SUCCESS;
|
||||
#endif
|
||||
|
||||
@ -271,10 +272,12 @@ static sigsegv_return_t sigsegv_handler(sigsegv_address_t fault_address, sigsegv
|
||||
* Dump state when everything went wrong after a SEGV
|
||||
*/
|
||||
|
||||
static void sigsegv_dump_state(sigsegv_address_t fault_address, sigsegv_address_t fault_instruction)
|
||||
static void sigsegv_dump_state(sigsegv_info_t *sip)
|
||||
{
|
||||
const sigsegv_address_t fault_address = sigsegv_get_fault_address(sip);
|
||||
const sigsegv_address_t fault_instruction = sigsegv_get_fault_instruction_address(sip);
|
||||
fprintf(stderr, "Caught SIGSEGV at address %p", fault_address);
|
||||
if (fault_instruction != SIGSEGV_INVALID_PC)
|
||||
if (fault_instruction != SIGSEGV_INVALID_ADDRESS)
|
||||
fprintf(stderr, " [IP=%p]", fault_instruction);
|
||||
fprintf(stderr, "\n");
|
||||
#if EMULATED_68K
|
||||
|
@ -407,9 +407,9 @@ static void vosf_set_dirty_area(int x, int y, int w, int h, int screen_width, in
|
||||
* Screen fault handler
|
||||
*/
|
||||
|
||||
bool Screen_fault_handler(sigsegv_address_t fault_address, sigsegv_address_t fault_instruction)
|
||||
bool Screen_fault_handler(sigsegv_info_t *sip)
|
||||
{
|
||||
const uintptr addr = (uintptr)fault_address;
|
||||
const uintptr addr = (uintptr)sigsegv_get_fault_address(sip);
|
||||
|
||||
/* Someone attempted to write to the frame buffer. Make it writeable
|
||||
* now so that the data could actually be written to. It will be made
|
||||
|
@ -141,12 +141,13 @@ void *vm_acquire_mac(size_t size)
|
||||
* SIGSEGV handler
|
||||
*/
|
||||
|
||||
static sigsegv_return_t sigsegv_handler(sigsegv_address_t fault_address, sigsegv_address_t fault_instruction)
|
||||
static sigsegv_return_t sigsegv_handler(sigsegv_info_t *sip)
|
||||
{
|
||||
const uintptr fault_address = (uintptr)sigsegv_get_fault_address(sip);
|
||||
#if ENABLE_VOSF
|
||||
// Handle screen fault
|
||||
extern bool Screen_fault_handler(sigsegv_address_t, sigsegv_address_t);
|
||||
if (Screen_fault_handler(fault_address, fault_instruction))
|
||||
extern bool Screen_fault_handler(sigsegv_info_t *sip);
|
||||
if (Screen_fault_handler(sip))
|
||||
return SIGSEGV_RETURN_SUCCESS;
|
||||
#endif
|
||||
|
||||
@ -167,10 +168,12 @@ static sigsegv_return_t sigsegv_handler(sigsegv_address_t fault_address, sigsegv
|
||||
* Dump state when everything went wrong after a SEGV
|
||||
*/
|
||||
|
||||
static void sigsegv_dump_state(sigsegv_address_t fault_address, sigsegv_address_t fault_instruction)
|
||||
static void sigsegv_dump_state(sigsegv_info_t *sip)
|
||||
{
|
||||
const sigsegv_address_t fault_address = sigsegv_get_fault_address(sip);
|
||||
const sigsegv_address_t fault_instruction = sigsegv_get_fault_instruction_address(sip);
|
||||
fprintf(stderr, "Caught SIGSEGV at address %p", fault_address);
|
||||
if (fault_instruction != SIGSEGV_INVALID_PC)
|
||||
if (fault_instruction != SIGSEGV_INVALID_ADDRESS)
|
||||
fprintf(stderr, " [IP=%p]", fault_instruction);
|
||||
fprintf(stderr, "\n");
|
||||
uaecptr nextpc;
|
||||
|
Loading…
x
Reference in New Issue
Block a user