Ignore:
File:
1 edited

Legend:

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

    r8c2214e rba50a34  
    11/*
    22 * Copyright (c) 2006 Jakub Jermar
    3  * Copyright (c) 2009 Pavel Rimsky
    43 * All rights reserved.
    54 *
     
    3534
    3635#include <arch/mm/as.h>
    37 #include <arch/mm/pagesize.h>
    3836#include <arch/mm/tlb.h>
    3937#include <genarch/mm/page_ht.h>
     
    4139#include <debug.h>
    4240#include <config.h>
    43 #include <arch/sun4v/hypercall.h>
    4441
    4542#ifdef CONFIG_TSB
     
    8986{
    9087#ifdef CONFIG_TSB
    91         size_t cnt = (TSB_ENTRY_COUNT * sizeof(tsb_entry_t)) >> FRAME_WIDTH;
     88        count_t cnt = (TSB_ENTRY_COUNT * sizeof(tsb_entry_t)) >> FRAME_WIDTH;
    9289        frame_free((uintptr_t) as->arch.tsb_description.tsb_base);
    9390        return cnt;
     
    115112{
    116113        mmu_secondary_context_write(as->asid);
    117 #ifdef CONFIG_TSB       
    118         uintptr_t base = ALIGN_DOWN(config.base, 1 << KERNEL_PAGE_WIDTH);
    119 
    120         ASSERT(as->arch.tsb_description.tsb_base);
    121         uintptr_t tsb = PA2KA(as->arch.tsb_description.tsb_base);
    122                
    123         if (!overlaps(tsb, 8 * MMU_PAGE_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) {
    124                 /*
    125                  * TSBs were allocated from memory not covered
    126                  * by the locked 4M kernel DTLB entry. We need
    127                  * to map both TSBs explicitly.
    128                  */
    129                 mmu_demap_page(tsb, 0, MMU_FLAG_DTLB);
    130                 dtlb_insert_mapping(tsb, KA2PA(tsb), PAGESIZE_64K, true, true);
    131         }
    132 
    133         __hypercall_fast2(MMU_TSB_CTXNON0, 1, KA2PA(&(as->arch.tsb_description)));
    134        
    135 #endif
    136114}
    137115
     
    156134        uintptr_t base = ALIGN_DOWN(config.base, 1 << KERNEL_PAGE_WIDTH);
    157135
    158         ASSERT(as->arch.tsb_description.tsb_base);
     136        ASSERT(as->arch.itsb && as->arch.dtsb);
    159137
    160         uintptr_t tsb = PA2KA(as->arch.tsb_description.tsb_base);
     138        uintptr_t tsb = (uintptr_t) as->arch.itsb;
    161139               
    162140        if (!overlaps(tsb, 8 * MMU_PAGE_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) {
     
    166144                 * to demap the entry installed by as_install_arch().
    167145                 */
    168                 __hypercall_fast3(MMU_UNMAP_PERM_ADDR, tsb, 0, MMU_FLAG_DTLB);
     146                dtlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_NUCLEUS, tsb);
    169147        }
    170148#endif
Note: See TracChangeset for help on using the changeset viewer.