revision 1301:b76840ccf94b
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 1301:b76840ccf94b |
parent | 1300:d18488c8668b |
child | 1302:765e514f99a6 |
author | nkeynes |
date | Wed May 27 09:42:24 2015 +1000 (8 years ago) |
Fix stack alignment when calling the end-block callback (broken on OS X)
src/sh4/sh4trans.c | view | annotate | diff | log | ||
src/sh4/sh4trans.h | view | annotate | diff | log | ||
src/sh4/sh4x86.in | view | annotate | diff | log |
1.1 --- a/src/sh4/sh4trans.c Wed May 27 08:46:29 2015 +10001.2 +++ b/src/sh4/sh4trans.c Wed May 27 09:42:24 2015 +10001.3 @@ -316,6 +316,8 @@1.4 { "sh4_write_sr", sh4_write_sr },1.5 { "sh4_read_sr", sh4_read_sr },1.6 { "sh4_raise_exception", sh4_raise_exception },1.7 + { "sh4_shadow_block_begin", sh4_shadow_block_begin },1.8 + { "sh4_shadow_block_end", sh4_shadow_block_end },1.9 { "sh4_sleep", sh4_sleep },1.10 { "sh4_fsca", sh4_fsca },1.11 { "sh4_ftrv", sh4_ftrv },
2.1 --- a/src/sh4/sh4trans.h Wed May 27 08:46:29 2015 +10002.2 +++ b/src/sh4/sh4trans.h Wed May 27 09:42:24 2015 +10002.3 @@ -76,6 +76,12 @@2.4 */2.5 void sh4_shadow_init( void );2.7 +/**2.8 + * Shadow mode callbacks.2.9 + */2.10 +void sh4_shadow_block_begin( void );2.11 +void sh4_shadow_block_end( void );2.12 +2.13 extern uint8_t *xlat_output;2.14 extern struct xlat_recovery_record xlat_recovery[MAX_RECOVERY_SIZE];2.15 extern xlat_cache_block_t xlat_current_block;
3.1 --- a/src/sh4/sh4x86.in Wed May 27 08:46:29 2015 +10003.2 +++ b/src/sh4/sh4x86.in Wed May 27 09:42:24 2015 +10003.3 @@ -519,9 +519,6 @@3.4 }3.5 JNE_label(wrongmode);3.6 if( sh4_x86.end_callback ) {3.7 - /* Note this does leave the stack out of alignment, but doesn't matter3.8 - * for what we're currently using it for.3.9 - */3.10 PUSH_r32(REG_EAX);3.11 MOVP_immptr_rptr(sh4_x86.end_callback, REG_ECX);3.12 JMP_rptr(REG_ECX);3.13 @@ -618,11 +615,9 @@3.14 static void exit_block()3.15 {3.16 if( sh4_x86.end_callback ) {3.17 - MOVP_immptr_rptr(sh4_x86.end_callback, REG_ECX);3.18 - JMP_rptr(REG_ECX);3.19 - } else {3.20 - RET();3.21 + CALL_ptr(sh4_x86.end_callback);3.22 }3.23 + RET();3.24 }3.26 /**
.