Ignore:
Timestamp:
2009-11-28T20:19:29Z (14 years ago)
Author:
Pavel Rimsky <pavel@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3f35634c
Parents:
18baf9c0
Message:

Merged changes essential for the code to reach 'uinit'.

File:
1 edited

Legend:

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

    r18baf9c0 r3da11f37  
    11/*
    22 * Copyright (c) 2005 Jakub Jermar
     3 * Copyright (c) 2008 Pavel Rimsky
    34 * All rights reserved.
    45 *
     
    5253#include <panic.h>
    5354#include <arch/asm.h>
     55#include <arch/cpu.h>
     56#include <arch/mm/pagesize.h>
    5457
    5558#ifdef CONFIG_TSB
     
    518521void tlb_invalidate_asid(asid_t asid)
    519522{
    520         tlb_context_reg_t pc_save, ctx;
    521        
    522523        /* switch to nucleus because we are mapped by the primary context */
    523524        nucleus_enter();
    524        
    525         ctx.v = pc_save.v = mmu_primary_context_read();
    526         ctx.context = asid;
    527         mmu_primary_context_write(ctx.v);
    528        
    529         itlb_demap(TLB_DEMAP_CONTEXT, TLB_DEMAP_PRIMARY, 0);
    530         dtlb_demap(TLB_DEMAP_CONTEXT, TLB_DEMAP_PRIMARY, 0);
    531        
    532         mmu_primary_context_write(pc_save.v);
    533        
     525        __hypercall_fast4(MMU_DEMAP_CTX, 0, 0, asid,
     526                MMU_FLAG_ITLB | MMU_FLAG_DTLB);
     527
    534528        nucleus_leave();
    535529}
     
    545539{
    546540        unsigned int i;
    547         tlb_context_reg_t pc_save, ctx;
    548541       
    549542        /* switch to nucleus because we are mapped by the primary context */
    550543        nucleus_enter();
    551        
    552         ctx.v = pc_save.v = mmu_primary_context_read();
    553         ctx.context = asid;
    554         mmu_primary_context_write(ctx.v);
    555        
    556         for (i = 0; i < cnt * MMU_PAGES_PER_PAGE; i++) {
    557                 itlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_PRIMARY,
    558                     page + i * MMU_PAGE_SIZE);
    559                 dtlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_PRIMARY,
    560                     page + i * MMU_PAGE_SIZE);
    561         }
    562        
    563         mmu_primary_context_write(pc_save.v);
    564        
     544
     545        for (i = 0; i < cnt; i++) {
     546                __hypercall_fast5(MMU_DEMAP_PAGE, 0, 0, page, asid,
     547                        MMU_FLAG_DTLB | MMU_FLAG_ITLB);
     548        }
     549
    565550        nucleus_leave();
    566551}
Note: See TracChangeset for help on using the changeset viewer.