1.1 --- a/src/sh4/mmu.c Tue Jan 13 11:56:28 2009 +0000
1.2 +++ b/src/sh4/mmu.c Wed Jan 14 00:16:44 2009 +0000
1.4 static void mmu_utlb_1k_init();
1.5 static struct utlb_1k_entry *mmu_utlb_1k_alloc();
1.6 static void mmu_utlb_1k_free( struct utlb_1k_entry *entry );
1.7 -static void mmu_fix_urc();
1.8 +static int mmu_read_urc();
1.10 static void FASTCALL tlb_miss_read( sh4addr_t addr, void *exc );
1.11 static int32_t FASTCALL tlb_protected_read( sh4addr_t addr, void *exc );
1.14 void MMU_save_state( FILE *f )
1.18 fwrite( &mmu_itlb, sizeof(mmu_itlb), 1, f );
1.19 fwrite( &mmu_utlb, sizeof(mmu_utlb), 1, f );
1.20 fwrite( &mmu_urc, sizeof(mmu_urc), 1, f );
1.21 @@ -201,17 +201,17 @@
1.26 - if( mmu_utlb[mmu_urc].flags & TLB_VALID )
1.27 - mmu_utlb_remove_entry( mmu_urc );
1.28 - mmu_utlb[mmu_urc].vpn = MMIO_READ(MMU, PTEH) & 0xFFFFFC00;
1.29 - mmu_utlb[mmu_urc].asid = MMIO_READ(MMU, PTEH) & 0x000000FF;
1.30 - mmu_utlb[mmu_urc].ppn = MMIO_READ(MMU, PTEL) & 0x1FFFFC00;
1.31 - mmu_utlb[mmu_urc].flags = MMIO_READ(MMU, PTEL) & 0x00001FF;
1.32 - mmu_utlb[mmu_urc].pcmcia = MMIO_READ(MMU, PTEA);
1.33 - mmu_utlb[mmu_urc].mask = get_tlb_size_mask(mmu_utlb[mmu_urc].flags);
1.34 - if( mmu_utlb[mmu_urc].flags & TLB_VALID )
1.35 - mmu_utlb_insert_entry( mmu_urc );
1.36 + int urc = mmu_read_urc();
1.37 + if( mmu_utlb[urc].flags & TLB_VALID )
1.38 + mmu_utlb_remove_entry( urc );
1.39 + mmu_utlb[urc].vpn = MMIO_READ(MMU, PTEH) & 0xFFFFFC00;
1.40 + mmu_utlb[urc].asid = MMIO_READ(MMU, PTEH) & 0x000000FF;
1.41 + mmu_utlb[urc].ppn = MMIO_READ(MMU, PTEL) & 0x1FFFFC00;
1.42 + mmu_utlb[urc].flags = MMIO_READ(MMU, PTEL) & 0x00001FF;
1.43 + mmu_utlb[urc].pcmcia = MMIO_READ(MMU, PTEA);
1.44 + mmu_utlb[urc].mask = get_tlb_size_mask(mmu_utlb[urc].flags);
1.45 + if( mmu_utlb[urc].flags & TLB_VALID )
1.46 + mmu_utlb_insert_entry( urc );
1.55 - return MMIO_READ( MMU, MMUCR) | (mmu_urc<<10) | ((mmu_urb&0x3F)<<18) | (mmu_lrui<<26);
1.56 + return MMIO_READ( MMU, MMUCR) | (mmu_read_urc()<<10) | ((mmu_urb&0x3F)<<18) | (mmu_lrui<<26);
1.58 return MMIO_READ( MMU, reg );
1.62 * MMU accessor functions just increment URC - fixup here if necessary
1.64 -static inline void mmu_fix_urc()
1.65 +static int mmu_read_urc()
1.67 if( mmu_urc_overflow ) {
1.68 if( mmu_urc >= 0x40 ) {
1.76 static void mmu_register_mem_region( uint32_t start, uint32_t end, mem_region_fn_t fn )