Search
lxdream.org :: lxdream :: r1301:b76840ccf94b
lxdream 0.9.1
released Jun 29
Download Now
changeset1301:b76840ccf94b
parent1300:d18488c8668b
child1302:765e514f99a6
authornkeynes
dateWed May 27 09:42:24 2015 +1000 (4 years ago)
Fix stack alignment when calling the end-block callback (broken on OS X)
src/sh4/sh4trans.c
src/sh4/sh4trans.h
src/sh4/sh4x86.in
1.1 --- a/src/sh4/sh4trans.c Wed May 27 08:46:29 2015 +1000
1.2 +++ b/src/sh4/sh4trans.c Wed May 27 09:42:24 2015 +1000
1.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 +1000
2.2 +++ b/src/sh4/sh4trans.h Wed May 27 09:42:24 2015 +1000
2.3 @@ -76,6 +76,12 @@
2.4 */
2.5 void sh4_shadow_init( void );
2.6
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 +1000
3.2 +++ b/src/sh4/sh4x86.in Wed May 27 09:42:24 2015 +1000
3.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 matter
3.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.25
3.26 /**
.