xref: /openbmc/linux/arch/sh/include/asm/tlbflush.h (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2f15cbe6fSPaul Mundt #ifndef __ASM_SH_TLBFLUSH_H
3f15cbe6fSPaul Mundt #define __ASM_SH_TLBFLUSH_H
4f15cbe6fSPaul Mundt 
5f15cbe6fSPaul Mundt /*
6f15cbe6fSPaul Mundt  * TLB flushing:
7f15cbe6fSPaul Mundt  *
8f15cbe6fSPaul Mundt  *  - flush_tlb_all() flushes all processes TLBs
9f15cbe6fSPaul Mundt  *  - flush_tlb_mm(mm) flushes the specified mm context TLB's
10f15cbe6fSPaul Mundt  *  - flush_tlb_page(vma, vmaddr) flushes one page
11f15cbe6fSPaul Mundt  *  - flush_tlb_range(vma, start, end) flushes a range of pages
12f15cbe6fSPaul Mundt  *  - flush_tlb_kernel_range(start, end) flushes a range of kernel pages
13f15cbe6fSPaul Mundt  */
14f15cbe6fSPaul Mundt extern void local_flush_tlb_all(void);
15f15cbe6fSPaul Mundt extern void local_flush_tlb_mm(struct mm_struct *mm);
16f15cbe6fSPaul Mundt extern void local_flush_tlb_range(struct vm_area_struct *vma,
17f15cbe6fSPaul Mundt 				  unsigned long start,
18f15cbe6fSPaul Mundt 				  unsigned long end);
19f15cbe6fSPaul Mundt extern void local_flush_tlb_page(struct vm_area_struct *vma,
20f15cbe6fSPaul Mundt 				 unsigned long page);
21f15cbe6fSPaul Mundt extern void local_flush_tlb_kernel_range(unsigned long start,
22f15cbe6fSPaul Mundt 					 unsigned long end);
23f15cbe6fSPaul Mundt extern void local_flush_tlb_one(unsigned long asid, unsigned long page);
24f15cbe6fSPaul Mundt 
2559615ecdSPaul Mundt extern void __flush_tlb_global(void);
2659615ecdSPaul Mundt 
27f15cbe6fSPaul Mundt #ifdef CONFIG_SMP
28f15cbe6fSPaul Mundt 
29f15cbe6fSPaul Mundt extern void flush_tlb_all(void);
30f15cbe6fSPaul Mundt extern void flush_tlb_mm(struct mm_struct *mm);
31f15cbe6fSPaul Mundt extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
32f15cbe6fSPaul Mundt 			    unsigned long end);
33f15cbe6fSPaul Mundt extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long page);
34f15cbe6fSPaul Mundt extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
35f15cbe6fSPaul Mundt extern void flush_tlb_one(unsigned long asid, unsigned long page);
36f15cbe6fSPaul Mundt 
37f15cbe6fSPaul Mundt #else
38f15cbe6fSPaul Mundt 
39f15cbe6fSPaul Mundt #define flush_tlb_all()			local_flush_tlb_all()
40f15cbe6fSPaul Mundt #define flush_tlb_mm(mm)		local_flush_tlb_mm(mm)
41f15cbe6fSPaul Mundt #define flush_tlb_page(vma, page)	local_flush_tlb_page(vma, page)
42f15cbe6fSPaul Mundt #define flush_tlb_one(asid, page)	local_flush_tlb_one(asid, page)
43f15cbe6fSPaul Mundt 
44f15cbe6fSPaul Mundt #define flush_tlb_range(vma, start, end)	\
45f15cbe6fSPaul Mundt 	local_flush_tlb_range(vma, start, end)
46f15cbe6fSPaul Mundt 
47f15cbe6fSPaul Mundt #define flush_tlb_kernel_range(start, end)	\
48f15cbe6fSPaul Mundt 	local_flush_tlb_kernel_range(start, end)
49f15cbe6fSPaul Mundt 
50f15cbe6fSPaul Mundt #endif /* CONFIG_SMP */
51f15cbe6fSPaul Mundt 
52f15cbe6fSPaul Mundt #endif /* __ASM_SH_TLBFLUSH_H */
53