Ignore:
Timestamp:
2010-03-07T15:11:56Z (14 years ago)
Author:
Lukas Mejdrech <lukasmejdrech@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
aadf01e
Parents:
2e99277 (diff), 137691a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes, revision 308

File:
1 edited

Legend:

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

    r2e99277 raa85487  
    11/*
    22 * Copyright (c) 2006 Jakub Jermar
     3 * Copyright (c) 2009 Pavel Rimsky
    34 * All rights reserved.
    45 *
     
    3435
    3536#include <arch/mm/as.h>
     37#include <arch/mm/pagesize.h>
    3638#include <arch/mm/tlb.h>
    3739#include <genarch/mm/page_ht.h>
     
    3941#include <debug.h>
    4042#include <config.h>
     43#include <arch/sun4v/hypercall.h>
    4144
    4245#ifdef CONFIG_TSB
     
    8689{
    8790#ifdef CONFIG_TSB
    88         count_t cnt = (TSB_ENTRY_COUNT * sizeof(tsb_entry_t)) >> FRAME_WIDTH;
     91        size_t cnt = (TSB_ENTRY_COUNT * sizeof(tsb_entry_t)) >> FRAME_WIDTH;
    8992        frame_free((uintptr_t) as->arch.tsb_description.tsb_base);
    9093        return cnt;
     
    112115{
    113116        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
    114136}
    115137
     
    134156        uintptr_t base = ALIGN_DOWN(config.base, 1 << KERNEL_PAGE_WIDTH);
    135157
    136         ASSERT(as->arch.itsb && as->arch.dtsb);
     158        ASSERT(as->arch.tsb_description.tsb_base);
    137159
    138         uintptr_t tsb = (uintptr_t) as->arch.itsb;
     160        uintptr_t tsb = PA2KA(as->arch.tsb_description.tsb_base);
    139161               
    140162        if (!overlaps(tsb, 8 * MMU_PAGE_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) {
     
    144166                 * to demap the entry installed by as_install_arch().
    145167                 */
    146                 dtlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_NUCLEUS, tsb);
     168                __hypercall_fast3(MMU_UNMAP_PERM_ADDR, tsb, 0, MMU_FLAG_DTLB);
    147169        }
    148170#endif
Note: See TracChangeset for help on using the changeset viewer.