Search
lxdream.org :: lxdream/src/sh4/mmu.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/mmu.c
changeset 1090:71e28626b358
prev1088:cf3900ae8acc
next1173:49207ef698e1
author nkeynes
date Mon Dec 21 08:23:54 2009 +1000 (14 years ago)
permissions -rw-r--r--
last change Fix symbol output in 64-bit disassembly
Add sh4_translate_dump_block(pc) function
file annotate diff log raw
1.1 --- a/src/sh4/mmu.c Fri Dec 04 18:06:12 2009 +1000
1.2 +++ b/src/sh4/mmu.c Mon Dec 21 08:23:54 2009 +1000
1.3 @@ -208,7 +208,7 @@
1.4 void MMU_ldtlb()
1.5 {
1.6 int urc = mmu_read_urc();
1.7 - if( mmu_utlb[urc].flags & TLB_VALID )
1.8 + if( IS_TLB_ENABLED() && mmu_utlb[urc].flags & TLB_VALID )
1.9 mmu_utlb_remove_entry( urc );
1.10 mmu_utlb[urc].vpn = MMIO_READ(MMU, PTEH) & 0xFFFFFC00;
1.11 mmu_utlb[urc].asid = MMIO_READ(MMU, PTEH) & 0x000000FF;
1.12 @@ -216,7 +216,7 @@
1.13 mmu_utlb[urc].flags = MMIO_READ(MMU, PTEL) & 0x00001FF;
1.14 mmu_utlb[urc].pcmcia = MMIO_READ(MMU, PTEA);
1.15 mmu_utlb[urc].mask = get_tlb_size_mask(mmu_utlb[urc].flags);
1.16 - if( mmu_utlb[urc].flags & TLB_VALID )
1.17 + if( IS_TLB_ENABLED() && mmu_utlb[urc].flags & TLB_VALID )
1.18 mmu_utlb_insert_entry( urc );
1.19 }
1.20
1.21 @@ -1312,7 +1312,7 @@
1.22 ent->flags = ent->flags & ~(TLB_DIRTY|TLB_VALID);
1.23 ent->flags |= (val & TLB_VALID);
1.24 ent->flags |= ((val & 0x200)>>7);
1.25 - if( ((old_flags^ent->flags) & (TLB_VALID|TLB_DIRTY)) != 0 ) {
1.26 + if( IS_TLB_ENABLED() && ((old_flags^ent->flags) & (TLB_VALID|TLB_DIRTY)) != 0 ) {
1.27 if( old_flags & TLB_VALID )
1.28 mmu_utlb_remove_entry( utlb );
1.29 if( ent->flags & TLB_VALID )
1.30 @@ -1327,20 +1327,20 @@
1.31 }
1.32
1.33 if( itlb == -2 || utlb == -2 ) {
1.34 - RAISE_TLB_MULTIHIT_ERROR(addr);
1.35 + RAISE_TLB_MULTIHIT_ERROR(addr); /* FIXME: should this only be raised if TLB is enabled? */
1.36 EXCEPTION_EXIT();
1.37 return;
1.38 }
1.39 } else {
1.40 struct utlb_entry *ent = &mmu_utlb[UTLB_ENTRY(addr)];
1.41 - if( ent->flags & TLB_VALID )
1.42 + if( IS_TLB_ENABLED() && ent->flags & TLB_VALID )
1.43 mmu_utlb_remove_entry( UTLB_ENTRY(addr) );
1.44 ent->vpn = (val & 0xFFFFFC00);
1.45 ent->asid = (val & 0xFF);
1.46 ent->flags = (ent->flags & ~(TLB_DIRTY|TLB_VALID));
1.47 ent->flags |= (val & TLB_VALID);
1.48 ent->flags |= ((val & 0x200)>>7);
1.49 - if( ent->flags & TLB_VALID )
1.50 + if( IS_TLB_ENABLED() && ent->flags & TLB_VALID )
1.51 mmu_utlb_insert_entry( UTLB_ENTRY(addr) );
1.52 }
1.53 }
1.54 @@ -1351,12 +1351,12 @@
1.55 if( UTLB_DATA2(addr) ) {
1.56 ent->pcmcia = val & 0x0000000F;
1.57 } else {
1.58 - if( ent->flags & TLB_VALID )
1.59 + if( IS_TLB_ENABLED() && ent->flags & TLB_VALID )
1.60 mmu_utlb_remove_entry( UTLB_ENTRY(addr) );
1.61 ent->ppn = (val & 0x1FFFFC00);
1.62 ent->flags = (val & 0x000001FF);
1.63 ent->mask = get_tlb_size_mask(val);
1.64 - if( ent->flags & TLB_VALID )
1.65 + if( IS_TLB_ENABLED() && ent->flags & TLB_VALID )
1.66 mmu_utlb_insert_entry( UTLB_ENTRY(addr) );
1.67 }
1.68 }
.