MIPS: mm: Move UNIQUE_ENTRYHI macro to a header file
authorMarkos Chandras <markos.chandras@imgtec.com>
Thu, 14 Nov 2013 16:12:22 +0000 (16:12 +0000)
committerRalf Baechle <ralf@linux-mips.org>
Wed, 22 Jan 2014 19:18:58 +0000 (20:18 +0100)
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/

arch/mips/include/asm/tlb.h
arch/mips/mm/init.c
arch/mips/mm/tlb-r4k.c

index c67842bc8ef3831c42c59ed42235f5bf999a8ead..235367cec4e63be3a3f5d347122ac5540f80c48c 100644 (file)
@@ -18,6 +18,8 @@
  */
 #define tlb_flush(tlb) flush_tlb_mm((tlb)->mm)
 
+#define UNIQUE_ENTRYHI(idx)    (CKSEG0 + ((idx) << (PAGE_SHIFT + 1)))
+
 #include <asm-generic/tlb.h>
 
 #endif /* __ASM_TLB_H */
index 12156176c7caa937ff5abcea16b249b95c748cb1..6b59617760c1933223337581dd0359feef084b37 100644 (file)
@@ -171,8 +171,6 @@ void *kmap_coherent(struct page *page, unsigned long addr)
        return (void*) vaddr;
 }
 
-#define UNIQUE_ENTRYHI(idx) (CKSEG0 + ((idx) << (PAGE_SHIFT + 1)))
-
 void kunmap_coherent(void)
 {
 #ifndef CONFIG_MIPS_MT_SMTC
index da3b0b9c9eae0a9800dfbbd20f6717709e72bfed..363aa0343bbe398357aeea21cfa9850fedc83987 100644 (file)
 #include <asm/bootinfo.h>
 #include <asm/mmu_context.h>
 #include <asm/pgtable.h>
+#include <asm/tlb.h>
 #include <asm/tlbmisc.h>
 
 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 */
 #ifdef CONFIG_MIPS_MT_SMTC