1 #ifndef __ASM_METAG_TLBFLUSH_H
2 #define __ASM_METAG_TLBFLUSH_H
5 #include <linux/sched.h>
6 #include <asm/metag_mem.h>
7 #include <asm/pgalloc.h>
12 * - flush_tlb() flushes the current mm struct TLBs
13 * - flush_tlb_all() flushes all processes TLBs
14 * - flush_tlb_mm(mm) flushes the specified mm context TLB's
15 * - flush_tlb_page(vma, vmaddr) flushes one page
16 * - flush_tlb_range(mm, start, end) flushes a range of pages
17 * - flush_tlb_kernel_range(start, end) flushes a range of kernel pages
18 * - flush_tlb_pgtables(mm, start, end) flushes a range of page tables
20 * FIXME: Meta 2 can flush single TLB entries.
24 #if defined(CONFIG_METAG_META21) && !defined(CONFIG_SMP)
25 static inline void __flush_tlb(void)
27 /* flush TLB entries for just the current hardware thread */
28 int thread = hard_processor_id();
29 metag_out32(0, (LINSYSCFLUSH_TxMMCU_BASE +
30 LINSYSCFLUSH_TxMMCU_STRIDE * thread));
33 static inline void __flush_tlb(void)
35 /* flush TLB entries for all hardware threads */
36 metag_out32(0, LINSYSCFLUSH_MMCU);
38 #endif /* defined(CONFIG_METAG_META21) && !defined(CONFIG_SMP) */
40 #define flush_tlb() __flush_tlb()
42 #define flush_tlb_all() __flush_tlb()
44 #define local_flush_tlb_all() __flush_tlb()
46 static inline void flush_tlb_mm(struct mm_struct *mm)
48 if (mm == current->active_mm)
52 static inline void flush_tlb_page(struct vm_area_struct *vma,
55 flush_tlb_mm(vma->vm_mm);
58 static inline void flush_tlb_range(struct vm_area_struct *vma,
59 unsigned long start, unsigned long end)
61 flush_tlb_mm(vma->vm_mm);
64 static inline void flush_tlb_pgtables(struct mm_struct *mm,
65 unsigned long start, unsigned long end)
70 static inline void flush_tlb_kernel_range(unsigned long start,
76 #endif /* __ASM_METAG_TLBFLUSH_H */