Changeset ed166f7 in mainline for kernel/arch/sparc64/src/mm/tlb.c


Ignore:
Timestamp:
2006-08-31T18:53:14Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6767c1d
Parents:
e0b241f
Message:

A lot of untested sparc64 stuff:

  • Write ASID to hardware when a thread is about to run in userspace.
  • Add userspace() and switch_to_userspace() functions.
  • Handle special cases when the userspace spill/fill handler causes MMU trap.
  • Resolve some TODOs in the existing sparc64 code.
  • sparc64 has now C99 compliant header guards.
  • Formatting and indentation fixes.
File:
1 edited

Legend:

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

    re0b241f red166f7  
    375375void tlb_invalidate_asid(asid_t asid)
    376376{
    377         /* TODO: write asid to some Context register and encode the register in second parameter below. */
    378         itlb_demap(TLB_DEMAP_CONTEXT, TLB_DEMAP_NUCLEUS, 0);
    379         dtlb_demap(TLB_DEMAP_CONTEXT, TLB_DEMAP_NUCLEUS, 0);
     377        tlb_context_reg_t sc_save, ctx;
     378       
     379        ctx.v = sc_save.v = mmu_secondary_context_read();
     380        ctx.context = asid;
     381        mmu_secondary_context_write(ctx.v);
     382       
     383        itlb_demap(TLB_DEMAP_CONTEXT, TLB_DEMAP_SECONDARY, 0);
     384        dtlb_demap(TLB_DEMAP_CONTEXT, TLB_DEMAP_SECONDARY, 0);
     385       
     386        mmu_secondary_context_write(sc_save.v);
    380387}
    381388
     
    389396{
    390397        int i;
     398        tlb_context_reg_t sc_save, ctx;
     399       
     400        ctx.v = sc_save.v = mmu_secondary_context_read();
     401        ctx.context = asid;
     402        mmu_secondary_context_write(ctx.v);
    391403       
    392404        for (i = 0; i < cnt; i++) {
    393                 /* TODO: write asid to some Context register and encode the register in second parameter below. */
    394                 itlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_NUCLEUS, page + i * PAGE_SIZE);
    395                 dtlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_NUCLEUS, page + i * PAGE_SIZE);
    396         }
     405                itlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_SECONDARY, page + i * PAGE_SIZE);
     406                dtlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_SECONDARY, page + i * PAGE_SIZE);
     407        }
     408       
     409        mmu_secondary_context_write(sc_save.v);
    397410}
    398411
Note: See TracChangeset for help on using the changeset viewer.