# HG changeset patch # User nkeynes # Date 1243153835 0 # Node ID f5914b2fd0dbc7c44dbf9736188ba8e9b49fcad6 # Parent a506a2f661807fcdeb9ee86e030cccb403e67d9c 000068: Handle sh4_finalize_instruction being called from a syscall (assertion failure) (Also introduce IS_SYSCALL() macro to tidy up slightly) --- a/src/sh4/sh4core.in Sun Apr 12 02:04:27 2009 +0000 +++ b/src/sh4/sh4core.in Sun May 24 08:30:35 2009 +0000 @@ -239,6 +239,9 @@ unsigned short ir; uint32_t tmp; + if( IS_SYSCALL(sh4r.pc) ) { + return; + } assert( IS_IN_ICACHE(sh4r.pc) ); ir = *(uint16_t *)GET_ICACHE_PTR(sh4r.pc); --- a/src/sh4/sh4trans.c Sun Apr 12 02:04:27 2009 +0000 +++ b/src/sh4/sh4trans.c Sun May 24 08:30:35 2009 +0000 @@ -46,7 +46,7 @@ } if( code == NULL ) { - if( sh4r.pc > 0xFFFFFF00 ) { + if( IS_SYSCALL(sh4r.pc) ) { syscall_invoke( sh4r.pc ); sh4r.in_delay_slot = 0; sh4r.pc = sh4r.pr; @@ -220,7 +220,7 @@ return xlat_get_code( GET_ICACHE_PHYS(vma) ); } - if( vma > 0xFFFFFF00 ) { + if( IS_SYSCALL(vma) ) { // lxdream hook return NULL; } --- a/src/syscall.h Sun Apr 12 02:04:27 2009 +0000 +++ b/src/syscall.h Sun May 24 08:30:35 2009 +0000 @@ -71,6 +71,8 @@ */ void dcload_set_allow_unsafe( gboolean allow ); +#define IS_SYSCALL(pc) (((uint32_t)pc)>=0xFFFFFF00) + #ifdef __cplusplus } #endif