diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-06-13 16:29:25 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-06-13 16:29:25 +0000 |
commit | db7d4daea91e105e3859cf461d7e53b9b77454b2 (patch) | |
tree | 9bb65b95440af09e8aca63abe56970dd3360cc57 /include/asm-sparc64/mmu_context.h | |
parent | 9c1c01ead627bdda9211c9abd5b758d6c687d8ac (diff) |
Merge with Linux 2.2.8.
Diffstat (limited to 'include/asm-sparc64/mmu_context.h')
-rw-r--r-- | include/asm-sparc64/mmu_context.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/include/asm-sparc64/mmu_context.h b/include/asm-sparc64/mmu_context.h index 7fa368638..d29cb2a35 100644 --- a/include/asm-sparc64/mmu_context.h +++ b/include/asm-sparc64/mmu_context.h @@ -1,4 +1,4 @@ -/* $Id: mmu_context.h,v 1.32 1998/10/13 14:03:52 davem Exp $ */ +/* $Id: mmu_context.h,v 1.35 1999/05/08 03:03:20 davem Exp $ */ #ifndef __SPARC64_MMU_CONTEXT_H #define __SPARC64_MMU_CONTEXT_H @@ -13,7 +13,6 @@ #ifndef __ASSEMBLY__ extern unsigned long tlb_context_cache; -extern spinlock_t scheduler_lock; extern unsigned long mmu_context_bmap[]; #define CTX_VERSION_SHIFT (PAGE_SHIFT - 3) @@ -38,11 +37,9 @@ extern void get_new_mmu_context(struct mm_struct *mm); #define destroy_context(__mm) do { \ if ((__mm)->context != NO_CONTEXT && \ atomic_read(&(__mm)->count) == 1) { \ - spin_lock(&scheduler_lock); \ if (!(((__mm)->context ^ tlb_context_cache) & CTX_VERSION_MASK))\ clear_bit((__mm)->context & ~(CTX_VERSION_MASK), \ mmu_context_bmap); \ - spin_unlock(&scheduler_lock); \ (__mm)->context = NO_CONTEXT; \ if(current->mm == (__mm)) { \ current->tss.ctx = 0; \ @@ -89,7 +86,7 @@ extern __inline__ void __get_mmu_context(struct task_struct *tsk) paddr = __pa(mm->pgd); if((tsk->tss.flags & (SPARC_FLAG_32BIT|SPARC_FLAG_KTHREAD)) == (SPARC_FLAG_32BIT)) - pgd_cache = (unsigned long) mm->pgd[0]; + pgd_cache = ((unsigned long) mm->pgd[0]) << 11UL; else pgd_cache = 0; __asm__ __volatile__(" @@ -115,13 +112,19 @@ extern __inline__ void __get_mmu_context(struct task_struct *tsk) /* * After we have set current->mm to a new value, this activates - * the context for the new mm so we see the new mappings. + * the context for the new mm so we see the new mappings. Currently, + * this is always called for 'current', if that changes put appropriate + * checks here. + * + * We set the cpu_vm_mask first to zero to enforce a tlb flush for + * the new context above, then we set it to the current cpu so the + * smp tlb flush routines do not get confused. */ #define activate_context(__tsk) \ do { flushw_user(); \ - spin_lock(&scheduler_lock); \ + (__tsk)->mm->cpu_vm_mask = 0; \ __get_mmu_context(__tsk); \ - spin_unlock(&scheduler_lock); \ + (__tsk)->mm->cpu_vm_mask = (1UL<<smp_processor_id()); \ } while(0) #endif /* !(__ASSEMBLY__) */ |