From: NIIBE Y. <gn...@m1...> - 2002-03-26 05:49:55
|
Clean it up a bit. 2002-03-26 NIIBE Yutaka <gn...@m1...> * include/asm-sh/mmu_context.h (switch_mm): Remove setting/resetting of mm->cpu_vm_mask. It's for SMP implementation. (get_new_mmu_context): Removed. (get_mmu_context): Merved with get_new_mmu_context. Index: include/asm-sh/mmu_context.h =================================================================== RCS file: /cvsroot/linuxsh/linux/include/asm-sh/mmu_context.h,v retrieving revision 1.6 diff -u -3 -p -r1.6 mmu_context.h --- include/asm-sh/mmu_context.h 22 Mar 2002 03:58:40 -0000 1.6 +++ include/asm-sh/mmu_context.h 26 Mar 2002 05:43:04 -0000 @@ -6,9 +6,10 @@ #ifndef __ASM_SH_MMU_CONTEXT_H #define __ASM_SH_MMU_CONTEXT_H -/* The MMU "context" consists of two things: - (a) TLB cache version (or round, cycle whatever expression you like) - (b) ASID (Address Space IDentifier) +/* + * The MMU "context" consists of two things: + * (a) TLB cache version (or round, cycle whatever expression you like) + * (b) ASID (Address Space IDentifier) */ /* @@ -29,19 +30,32 @@ extern unsigned long mmu_context_cache; */ #define MMU_VPN_MASK 0xfffff000 +/* + * Get MMU context if needed. + */ static __inline__ void -get_new_mmu_context(struct mm_struct *mm) +get_mmu_context(struct mm_struct *mm) { extern void flush_tlb_all(void); + unsigned long mc = mmu_context_cache; - unsigned long mc = ++mmu_context_cache; + /* Check if we have old version of context. */ + if (((mm->context ^ mc) & MMU_CONTEXT_VERSION_MASK) == 0) + /* It's up to date, do nothing */ + return; + /* It's old, we need to get new context with new version. */ + mc = ++mmu_context_cache; if (!(mc & MMU_CONTEXT_ASID_MASK)) { - /* We exhaust ASID of this version. - Flush all TLB and start new cycle. */ + /* + * We exhaust ASID of this version. + * Flush all TLB and start new cycle. + */ flush_tlb_all(); - /* Fix version if needed. - Note that we avoid version #0 to distingush NO_CONTEXT. */ + /* + * Fix version; Note that we avoid version #0 + * to distingush NO_CONTEXT. + */ if (!mc) mmu_context_cache = mc = MMU_CONTEXT_FIRST_VERSION; } @@ -49,21 +63,6 @@ get_new_mmu_context(struct mm_struct *mm } /* - * Get MMU context if needed. - */ -static __inline__ void -get_mmu_context(struct mm_struct *mm) -{ - if (mm) { - unsigned long mc = mmu_context_cache; - /* Check if we have old version of context. - If it's old, we need to get new context with new version. */ - if ((mm->context ^ mc) & MMU_CONTEXT_VERSION_MASK) - get_new_mmu_context(mm); - } -} - -/* * Initialize the context related info for a new mm_struct * instance. */ @@ -169,8 +168,6 @@ static __inline__ void switch_mm(struct if (likely(prev != next)) { unsigned long __pgdir = (unsigned long)next->pgd; - clear_bit(cpu, &prev->cpu_vm_mask); - set_bit(cpu, &next->cpu_vm_mask); __asm__ __volatile__("mov.l %0, %1" : /* no output */ : "r" (__pgdir), "m" (__m(MMU_TTB))); |