浏览代码

MIPS: mm: Move UNIQUE_ENTRYHI macro to a header file

The UNIQUE_ENTRYHI definition was duplicated whenever there
was the need to flush the TLB entries. We move this common
definition to a header file.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/6129/
Markos Chandras 11 年之前
父节点
当前提交
c01905eeee
共有 3 个文件被更改,包括 3 次插入8 次删除
  1. 2 0
      arch/mips/include/asm/tlb.h
  2. 0 2
      arch/mips/mm/init.c
  3. 1 6
      arch/mips/mm/tlb-r4k.c

+ 2 - 0
arch/mips/include/asm/tlb.h

@@ -18,6 +18,8 @@
  */
  */
 #define tlb_flush(tlb) flush_tlb_mm((tlb)->mm)
 #define tlb_flush(tlb) flush_tlb_mm((tlb)->mm)
 
 
+#define UNIQUE_ENTRYHI(idx)	(CKSEG0 + ((idx) << (PAGE_SHIFT + 1)))
+
 #include <asm-generic/tlb.h>
 #include <asm-generic/tlb.h>
 
 
 #endif /* __ASM_TLB_H */
 #endif /* __ASM_TLB_H */

+ 0 - 2
arch/mips/mm/init.c

@@ -171,8 +171,6 @@ void *kmap_coherent(struct page *page, unsigned long addr)
 	return (void*) vaddr;
 	return (void*) vaddr;
 }
 }
 
 
-#define UNIQUE_ENTRYHI(idx) (CKSEG0 + ((idx) << (PAGE_SHIFT + 1)))
-
 void kunmap_coherent(void)
 void kunmap_coherent(void)
 {
 {
 #ifndef CONFIG_MIPS_MT_SMTC
 #ifndef CONFIG_MIPS_MT_SMTC

+ 1 - 6
arch/mips/mm/tlb-r4k.c

@@ -20,16 +20,11 @@
 #include <asm/bootinfo.h>
 #include <asm/bootinfo.h>
 #include <asm/mmu_context.h>
 #include <asm/mmu_context.h>
 #include <asm/pgtable.h>
 #include <asm/pgtable.h>
+#include <asm/tlb.h>
 #include <asm/tlbmisc.h>
 #include <asm/tlbmisc.h>
 
 
 extern void build_tlb_refill_handler(void);
 extern void build_tlb_refill_handler(void);
 
 
-/*
- * Make sure all entries differ.  If they're not different
- * MIPS32 will take revenge ...
- */
-#define UNIQUE_ENTRYHI(idx) (CKSEG0 + ((idx) << (PAGE_SHIFT + 1)))
-
 /* Atomicity and interruptability */
 /* Atomicity and interruptability */
 #ifdef CONFIG_MIPS_MT_SMTC
 #ifdef CONFIG_MIPS_MT_SMTC