blob: dea1cfa2122bec28ea36a34bec543d2dc4747f9b [file] [log] [blame]
Sam Ravnborgf5e706a2008-07-17 21:55:51 -07001#ifndef _SPARC64_TLBFLUSH_H
2#define _SPARC64_TLBFLUSH_H
3
Sam Ravnborgf5e706a2008-07-17 21:55:51 -07004#include <asm/mmu_context.h>
5
6/* TSB flush operations. */
Peter Zijlstra90f08e32011-05-24 17:11:50 -07007
8#define TLB_BATCH_NR 192
9
10struct tlb_batch {
11 struct mm_struct *mm;
12 unsigned long tlb_nr;
David S. Millerf36391d2013-04-19 17:26:26 -040013 unsigned long active;
Peter Zijlstra90f08e32011-05-24 17:11:50 -070014 unsigned long vaddrs[TLB_BATCH_NR];
15};
16
Sam Ravnborgf05a6862014-05-16 23:25:50 +020017void flush_tsb_kernel_range(unsigned long start, unsigned long end);
18void flush_tsb_user(struct tlb_batch *tb);
19void flush_tsb_user_page(struct mm_struct *mm, unsigned long vaddr);
Sam Ravnborgf5e706a2008-07-17 21:55:51 -070020
21/* TLB flush operations. */
22
David S. Millerf36391d2013-04-19 17:26:26 -040023static inline void flush_tlb_mm(struct mm_struct *mm)
24{
25}
Sam Ravnborgf5e706a2008-07-17 21:55:51 -070026
David S. Millerf36391d2013-04-19 17:26:26 -040027static inline void flush_tlb_page(struct vm_area_struct *vma,
28 unsigned long vmaddr)
29{
30}
31
32static inline void flush_tlb_range(struct vm_area_struct *vma,
33 unsigned long start, unsigned long end)
34{
35}
36
David S. Miller4ca9a232014-08-04 20:07:37 -070037void flush_tlb_kernel_range(unsigned long start, unsigned long end);
38
David S. Millerf36391d2013-04-19 17:26:26 -040039#define __HAVE_ARCH_ENTER_LAZY_MMU_MODE
40
Sam Ravnborgf05a6862014-05-16 23:25:50 +020041void flush_tlb_pending(void);
42void arch_enter_lazy_mmu_mode(void);
43void arch_leave_lazy_mmu_mode(void);
David S. Millerf36391d2013-04-19 17:26:26 -040044#define arch_flush_lazy_mmu_mode() do {} while (0)
Sam Ravnborgf5e706a2008-07-17 21:55:51 -070045
46/* Local cpu only. */
Sam Ravnborgf05a6862014-05-16 23:25:50 +020047void __flush_tlb_all(void);
48void __flush_tlb_page(unsigned long context, unsigned long vaddr);
49void __flush_tlb_kernel_range(unsigned long start, unsigned long end);
Sam Ravnborgf5e706a2008-07-17 21:55:51 -070050
51#ifndef CONFIG_SMP
52
David S. Millerf36391d2013-04-19 17:26:26 -040053static inline void global_flush_tlb_page(struct mm_struct *mm, unsigned long vaddr)
54{
55 __flush_tlb_page(CTX_HWBITS(mm->context), vaddr);
56}
57
Sam Ravnborgf5e706a2008-07-17 21:55:51 -070058#else /* CONFIG_SMP */
59
Sam Ravnborgf05a6862014-05-16 23:25:50 +020060void smp_flush_tlb_kernel_range(unsigned long start, unsigned long end);
61void smp_flush_tlb_page(struct mm_struct *mm, unsigned long vaddr);
Sam Ravnborgf5e706a2008-07-17 21:55:51 -070062
David S. Millerf36391d2013-04-19 17:26:26 -040063#define global_flush_tlb_page(mm, vaddr) \
64 smp_flush_tlb_page(mm, vaddr)
65
Sam Ravnborgf5e706a2008-07-17 21:55:51 -070066#endif /* ! CONFIG_SMP */
67
68#endif /* _SPARC64_TLBFLUSH_H */