1.1 --- a/src/sh4/sh4trans.c Wed Oct 29 23:51:58 2008 +0000
1.2 +++ b/src/sh4/sh4trans.c Fri Oct 31 03:24:49 2008 +0000
1.3 @@ -158,14 +158,17 @@
1.5 void sh4_translate_exit_recover( )
1.7 - void *pc = xlat_get_native_pc();
1.9 - // could be null if we're not actually running inside the translator
1.10 - void *code = xlat_get_code( sh4r.pc );
1.11 - xlat_recovery_record_t recover = xlat_get_post_recovery(code, pc, TRUE);
1.12 - if( recover != NULL ) {
1.13 - // Can be null if there is no recovery necessary
1.14 - sh4_translate_run_recovery(recover);
1.15 + void *code = xlat_get_code_by_vma( sh4r.pc );
1.16 + if( code != NULL ) {
1.17 + uint32_t size = xlat_get_code_size( code );
1.18 + void *pc = xlat_get_native_pc( code, size );
1.19 + if( pc != NULL ) {
1.20 + // could be null if we're not actually running inside the translator
1.21 + xlat_recovery_record_t recover = xlat_get_post_recovery(code, pc, TRUE);
1.22 + if( recover != NULL ) {
1.23 + // Can be null if there is no recovery necessary
1.24 + sh4_translate_run_recovery(recover);
1.29 @@ -191,19 +194,22 @@
1.31 gboolean sh4_translate_flush_cache()
1.33 - void *pc = xlat_get_native_pc();
1.34 - assert( pc != NULL );
1.35 + void *code = xlat_get_code_by_vma( sh4r.pc );
1.36 + if( code != NULL ) {
1.37 + uint32_t size = xlat_get_code_size( code );
1.38 + void *pc = xlat_get_native_pc( code, size );
1.39 + assert( pc != NULL );
1.41 - void *code = xlat_get_code( sh4r.pc );
1.42 - xlat_recovery_record_t recover = xlat_get_post_recovery(code, pc, FALSE);
1.43 - if( recover != NULL ) {
1.44 - // Can be null if there is no recovery necessary
1.45 - sh4_translate_run_recovery(recover);
1.46 - xlat_flush_cache();
1.49 - xlat_flush_cache();
1.51 + xlat_recovery_record_t recover = xlat_get_post_recovery(code, pc, FALSE);
1.52 + if( recover != NULL ) {
1.53 + // Can be null if there is no recovery necessary
1.54 + sh4_translate_run_recovery(recover);
1.55 + xlat_flush_cache();
1.58 + xlat_flush_cache();