Changeset 687246b in mainline


Ignore:
Timestamp:
2009-05-17T19:04:21Z (15 years ago)
Author:
Pavel Rimsky <rimskyp@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c5747fe
Parents:
acf37bc
Message:

TLB demap optimalization for US3.

File:
1 edited

Legend:

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

    racf37bc r687246b  
    498498}
    499499
    500 #if defined (US3)
    501 /** Invalidates given TLB entry if and only if it is non-locked or global.
    502  *
    503  * @param tlb           TLB number (one of TLB_DSMALL, TLB_DBIG_0, TLB_DBIG_1,
    504  *                      TLB_ISMALL, TLB_IBIG).
    505  * @param entry         Entry index within the given TLB.
    506  */
    507 static void tlb_invalidate_entry(int tlb, index_t entry)
    508 {
    509         tlb_data_t d;
    510         tlb_tag_read_reg_t t;
    511        
    512         if (tlb == TLB_DSMALL || tlb == TLB_DBIG_0 || tlb == TLB_DBIG_1) {
    513                 d.value = dtlb_data_access_read(tlb, entry);
    514                 if (!d.l || d.g) {
    515                         t.value = dtlb_tag_read_read(tlb, entry);
    516                         d.v = false;
    517                         dtlb_tag_access_write(t.value);
    518                         dtlb_data_access_write(tlb, entry, d.value);
    519                 }
    520         } else if (tlb == TLB_ISMALL || tlb == TLB_IBIG) {
    521                 d.value = itlb_data_access_read(tlb, entry);
    522                 if (!d.l || d.g) {
    523                         t.value = itlb_tag_read_read(tlb, entry);
    524                         d.v = false;
    525                         itlb_tag_access_write(t.value);
    526                         itlb_data_access_write(tlb, entry, d.value);
    527                 }
    528         }
    529 }
    530 #endif
    531 
     500#if defined (US)
    532501/** Invalidate all unlocked ITLB and DTLB entries. */
    533502void tlb_invalidate_all(void)
     
    544513         */
    545514
    546 #if defined (US)
    547515        tlb_data_t d;
    548516        tlb_tag_read_reg_t t;
     
    568536        }
    569537
     538}
     539
    570540#elif defined (US3)
    571541
    572         for (i = 0; i < tlb_ismall_size(); i++)
    573                 tlb_invalidate_entry(TLB_ISMALL, i);
    574         for (i = 0; i < tlb_ibig_size(); i++)
    575                 tlb_invalidate_entry(TLB_IBIG, i);
    576         for (i = 0; i < tlb_dsmall_size(); i++)
    577                 tlb_invalidate_entry(TLB_DSMALL, i);
    578         for (i = 0; i < tlb_dbig_size(); i++)
    579                 tlb_invalidate_entry(TLB_DBIG_0, i);
    580         for (i = 0; i < tlb_dbig_size(); i++)
    581                 tlb_invalidate_entry(TLB_DBIG_1, i);
     542/** Invalidate all unlocked ITLB and DTLB entries. */
     543void tlb_invalidate_all(void)
     544{
     545        itlb_demap(TLB_DEMAP_ALL, 0, 0);
     546        dtlb_demap(TLB_DEMAP_ALL, 0, 0);
     547}
     548
    582549#endif
    583 
    584 }
    585550
    586551/** Invalidate all ITLB and DTLB entries that belong to specified ASID
Note: See TracChangeset for help on using the changeset viewer.