Search
lxdream.org :: lxdream/src/sh4/sh4trans.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4trans.c
changeset 559:06714bc64271
prev527:14c9489f647e
next561:533f6b478071
author nkeynes
date Tue Jan 01 04:58:57 2008 +0000 (12 years ago)
branchlxdream-mmu
permissions -rw-r--r--
last change Commit first pass at full TLB support - still needs a lot more work
file annotate diff log raw
1.1 --- a/src/sh4/sh4trans.c Sun Nov 18 11:12:44 2007 +0000
1.2 +++ b/src/sh4/sh4trans.c Tue Jan 01 04:58:57 2008 +0000
1.3 @@ -23,6 +23,9 @@
1.4 #include "sh4/sh4trans.h"
1.5 #include "sh4/xltcache.h"
1.6
1.7 +
1.8 +uint32_t last_pc;
1.9 +void *last_code;
1.10 /**
1.11 * Execute a timeslice using translated code only (ie translate/execute loop)
1.12 * Note this version does not support breakpoints
1.13 @@ -60,9 +63,22 @@
1.14
1.15 code = xlat_get_code(sh4r.pc);
1.16 if( code == NULL ) {
1.17 + uint64_t ppa = mmu_vma_to_phys_exec( sh4r.pc );
1.18 + if( ppa>>32 ) {
1.19 + // not found, exception
1.20 + ppa = mmu_vma_to_phys_exec( sh4r.pc );
1.21 + if( ppa>>32 ) {
1.22 + // double fault - halt
1.23 + dreamcast_stop();
1.24 + ERROR( "Double fault - halting" );
1.25 + return nanosecs;
1.26 + }
1.27 + }
1.28 code = sh4_translate_basic_block( sh4r.pc );
1.29 }
1.30 }
1.31 + last_pc = sh4r.pc;
1.32 + last_code = code;
1.33 code = code();
1.34 }
1.35
.