Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/mips32/src/mm/tlb.c

    rbd81386 r54a7a20  
    7373                tlbwi();
    7474        }
    75                
     75       
    7676        /*
    7777         * The kernel is going to make use of some wired
     
    9999        asid = AS->asid;
    100100        mutex_unlock(&AS->lock);
    101        
    102         page_table_lock(AS, true);
    103101       
    104102        pte = find_mapping_and_check(badvaddr, PF_ACCESS_READ, istate, &pfrc);
     
    113111                         * or copy_to_uspace().
    114112                         */
    115                         page_table_unlock(AS, true);
    116113                        return;
    117114                default:
     
    144141        tlbwr();
    145142
    146         page_table_unlock(AS, true);
    147143        return;
    148144       
    149145fail:
    150         page_table_unlock(AS, true);
    151146        tlb_refill_fail(istate);
    152147}
     
    176171        index.value = cp0_index_read();
    177172
    178         page_table_lock(AS, true);     
    179        
    180173        /*
    181174         * Fail if the entry is not in TLB.
     
    197190                         * or copy_to_uspace().
    198191                         */
    199                         page_table_unlock(AS, true);                     
    200192                        return;
    201193                default:
     
    227219        tlbwi();
    228220
    229         page_table_unlock(AS, true);
    230221        return;
    231222       
    232223fail:
    233         page_table_unlock(AS, true);
    234224        tlb_invalid_fail(istate);
    235225}
     
    259249        index.value = cp0_index_read();
    260250
    261         page_table_lock(AS, true);     
    262        
    263251        /*
    264252         * Fail if the entry is not in TLB.
     
    280268                         * or copy_to_uspace().
    281269                         */
    282                         page_table_unlock(AS, true);                     
    283270                        return;
    284271                default:
     
    311298        tlbwi();
    312299
    313         page_table_unlock(AS, true);
    314300        return;
    315301       
    316302fail:
    317         page_table_unlock(AS, true);
    318303        tlb_modified_fail(istate);
    319304}
     
    364349        pte_t *pte;
    365350
    366         ASSERT(mutex_locked(&AS->lock));
    367 
    368351        hi.value = cp0_entry_hi_read();
    369352
     
    379362         * Check if the mapping exists in page tables.
    380363         */     
    381         pte = page_mapping_find(AS, badvaddr);
     364        pte = page_mapping_find(AS, badvaddr, true);
    382365        if (pte && pte->p && (pte->w || access != PF_ACCESS_WRITE)) {
    383366                /*
     
    393376                 * Resort to higher-level page fault handler.
    394377                 */
    395                 page_table_unlock(AS, true);
    396378                switch (rc = as_page_fault(badvaddr, access, istate)) {
    397379                case AS_PF_OK:
     
    400382                         * The mapping ought to be in place.
    401383                         */
    402                         page_table_lock(AS, true);
    403                         pte = page_mapping_find(AS, badvaddr);
     384                        pte = page_mapping_find(AS, badvaddr, true);
    404385                        ASSERT(pte && pte->p);
    405386                        ASSERT(pte->w || access != PF_ACCESS_WRITE);
    406387                        return pte;
    407                         break;
    408388                case AS_PF_DEFER:
    409                         page_table_lock(AS, true);
    410389                        *pfrc = AS_PF_DEFER;
    411390                        return NULL;
    412                         break;
    413391                case AS_PF_FAULT:
    414                         page_table_lock(AS, true);
    415392                        *pfrc = AS_PF_FAULT;
    416393                        return NULL;
    417                         break;
    418394                default:
    419395                        panic("Unexpected rc (%d).", rc);
Note: See TracChangeset for help on using the changeset viewer.