Search
lxdream.org :: lxdream :: r588:978ec0b33545
lxdream 0.9.1
released Jun 29
Download Now
changeset588:978ec0b33545
parent587:739a3136f269
child589:045ba6eb6df1
authornkeynes
dateWed Jan 16 09:37:08 2008 +0000 (12 years ago)
Fix vma lookups after itlb exception
src/sh4/sh4trans.c
1.1 --- a/src/sh4/sh4trans.c Wed Jan 16 09:35:30 2008 +0000
1.2 +++ b/src/sh4/sh4trans.c Wed Jan 16 09:37:08 2008 +0000
1.3 @@ -123,6 +123,11 @@
1.4 xlat_output = (uint8_t *)block->code;
1.5 xlat_recovery_posn = 0;
1.6 uint8_t *eob = xlat_output + block->size;
1.7 +
1.8 + if( GET_ICACHE_END() < lastpc ) {
1.9 + lastpc = GET_ICACHE_END();
1.10 + }
1.11 +
1.12 sh4_translate_begin_block(pc);
1.13
1.14 do {
1.15 @@ -251,25 +256,27 @@
1.16 {
1.17 void *result = NULL;
1.18
1.19 - if( !IS_IN_ICACHE(vma) ) {
1.20 - if( vma > 0xFFFFFF00 ) {
1.21 - // lxdream hook
1.22 - return NULL;
1.23 - }
1.24 - if( !mmu_update_icache(sh4r.pc) ) {
1.25 - // fault - off to the fault handler
1.26 - if( !mmu_update_icache(sh4r.pc) ) {
1.27 - // double fault - halt
1.28 - ERROR( "Double fault - halting" );
1.29 - dreamcast_stop();
1.30 - return NULL;
1.31 - }
1.32 - }
1.33 - }
1.34 - if( sh4_icache.page_vma != -1 ) {
1.35 + if( IS_IN_ICACHE(vma) ) {
1.36 result = xlat_get_code( GET_ICACHE_PHYS(vma) );
1.37 }
1.38
1.39 + if( vma > 0xFFFFFF00 ) {
1.40 + // lxdream hook
1.41 + return NULL;
1.42 + }
1.43 +
1.44 + if( !mmu_update_icache(vma) ) {
1.45 + // fault - off to the fault handler
1.46 + if( !mmu_update_icache(sh4r.pc) ) {
1.47 + // double fault - halt
1.48 + ERROR( "Double fault - halting" );
1.49 + dreamcast_stop();
1.50 + return NULL;
1.51 + }
1.52 + }
1.53 +
1.54 + assert( IS_IN_ICACHE(sh4r.pc) );
1.55 + result = xlat_get_code( GET_ICACHE_PHYS(sh4r.pc) );
1.56 return result;
1.57 }
1.58
.