1.1 --- a/src/sh4/mmu.c Thu Jan 10 08:28:37 2008 +0000
1.2 +++ b/src/sh4/mmu.c Tue Jan 15 02:20:30 2008 +0000
1.8 +gboolean sh4_flush_store_queue( sh4addr_t addr )
1.10 + uint32_t mmucr = MMIO_READ(MMU,MMUCR);
1.11 + int queue = (addr&0x20)>>2;
1.12 + sh4ptr_t src = (sh4ptr_t)&sh4r.store_queue[queue];
1.14 + /* Store queue operation */
1.15 + if( mmucr & MMUCR_AT ) {
1.17 + if( ((mmucr & MMUCR_SV) == 0) || !IS_SH4_PRIVMODE() ) {
1.18 + entryNo = mmu_utlb_lookup_vpn_asid( addr );
1.20 + entryNo = mmu_utlb_lookup_vpn( addr );
1.24 + MMU_TLB_WRITE_MISS_ERROR(addr);
1.27 + MMU_TLB_MULTI_HIT_ERROR(addr);
1.30 + if( IS_SH4_PRIVMODE() ? ((mmu_utlb[entryNo].flags & TLB_WRITABLE) == 0)
1.31 + : ((mmu_utlb[entryNo].flags & TLB_USERWRITABLE) != TLB_USERWRITABLE) ) {
1.32 + /* protection violation */
1.33 + MMU_TLB_WRITE_PROT_ERROR(addr);
1.37 + if( (mmu_utlb[entryNo].flags & TLB_DIRTY) == 0 ) {
1.38 + MMU_TLB_INITIAL_WRITE_ERROR(addr);
1.42 + /* finally generate the target address */
1.43 + target = ((mmu_utlb[entryNo].ppn & mmu_utlb[entryNo].mask) |
1.44 + (addr & (~mmu_utlb[entryNo].mask))) & 0xFFFFFFE0;
1.47 + uint32_t hi = (MMIO_READ( MMU, (queue == 0 ? QACR0 : QACR1) ) & 0x1C) << 24;
1.48 + target = (addr&0x03FFFFE0) | hi;
1.50 + mem_copy_to_sh4( target, src, 32 );