Search
lxdream.org :: lxdream/src/sh4/sh4trans.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4trans.c
changeset 906:268ea359f884
prev905:4c17ebd9ef5e
next914:72abecf5a315
author nkeynes
date Fri Oct 31 03:24:49 2008 +0000 (15 years ago)
permissions -rw-r--r--
last change Remove FASTCALL from mem_copy_*, not really helping atm (and sometimes hurting)
file annotate diff log raw
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.4
1.5 void sh4_translate_exit_recover( )
1.6 {
1.7 - void *pc = xlat_get_native_pc();
1.8 - if( pc != NULL ) {
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.25 + }
1.26 }
1.27 }
1.28 }
1.29 @@ -191,19 +194,22 @@
1.30 */
1.31 gboolean sh4_translate_flush_cache()
1.32 {
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.40
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.47 - return TRUE;
1.48 - } else {
1.49 - xlat_flush_cache();
1.50 - return FALSE;
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.56 + return TRUE;
1.57 + } else {
1.58 + xlat_flush_cache();
1.59 + return FALSE;
1.60 + }
1.61 }
1.62 }
1.63
.