Search
lxdream.org :: lxdream/src/sh4/xltcache.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/xltcache.c
changeset 569:a1c49e1e8776
prev561:533f6b478071
next571:9bc09948d0f2
author nkeynes
date Fri Jan 04 11:54:17 2008 +0000 (14 years ago)
branchlxdream-mmu
permissions -rw-r--r--
last change Bring icache partially into line with the mmu, a little less slow with AT off
now.
file annotate diff log raw
1.1 --- a/src/sh4/xltcache.c Tue Jan 01 05:08:38 2008 +0000
1.2 +++ b/src/sh4/xltcache.c Fri Jan 04 11:54:17 2008 +0000
1.3 @@ -21,6 +21,7 @@
1.4 #include <assert.h>
1.5
1.6 #include "dreamcast.h"
1.7 +#include "sh4/sh4core.h"
1.8 #include "sh4/xltcache.h"
1.9 #include "x86dasm/x86dasm.h"
1.10
1.11 @@ -207,6 +208,29 @@
1.12 return result;
1.13 }
1.14
1.15 +void *xlat_get_code_by_vma( sh4vma_t vma )
1.16 +{
1.17 + void *result = NULL;
1.18 +
1.19 +
1.20 + if( !IS_IN_ICACHE(vma) ) {
1.21 + if( !mmu_update_icache(sh4r.pc) ) {
1.22 + // fault - off to the fault handler
1.23 + if( !mmu_update_icache(sh4r.pc) ) {
1.24 + // double fault - halt
1.25 + dreamcast_stop();
1.26 + ERROR( "Double fault - halting" );
1.27 + return NULL;
1.28 + }
1.29 + }
1.30 + }
1.31 + if( sh4_icache.page_vma != -1 ) {
1.32 + result = xlat_get_code( GET_ICACHE_PHYS(vma) );
1.33 + }
1.34 +
1.35 + return result;
1.36 +}
1.37 +
1.38 void **xlat_get_lut_entry( sh4addr_t address )
1.39 {
1.40 void **page = xlat_lut[XLAT_LUT_PAGE(address)];
.