revision 588:978ec0b33545
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 588:978ec0b33545 |
parent | 587:739a3136f269 |
child | 589:045ba6eb6df1 |
author | nkeynes |
date | Wed Jan 16 09:37:08 2008 +0000 (15 years ago) |
Fix vma lookups after itlb exception
1.1 --- a/src/sh4/sh4trans.c Wed Jan 16 09:35:30 2008 +00001.2 +++ b/src/sh4/sh4trans.c Wed Jan 16 09:37:08 2008 +00001.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.14 do {1.15 @@ -251,25 +256,27 @@1.16 {1.17 void *result = NULL;1.19 - if( !IS_IN_ICACHE(vma) ) {1.20 - if( vma > 0xFFFFFF00 ) {1.21 - // lxdream hook1.22 - return NULL;1.23 - }1.24 - if( !mmu_update_icache(sh4r.pc) ) {1.25 - // fault - off to the fault handler1.26 - if( !mmu_update_icache(sh4r.pc) ) {1.27 - // double fault - halt1.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.39 + if( vma > 0xFFFFFF00 ) {1.40 + // lxdream hook1.41 + return NULL;1.42 + }1.43 +1.44 + if( !mmu_update_icache(vma) ) {1.45 + // fault - off to the fault handler1.46 + if( !mmu_update_icache(sh4r.pc) ) {1.47 + // double fault - halt1.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 }
.