18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef __ASM_SH_TLBFLUSH_H
38c2ecf20Sopenharmony_ci#define __ASM_SH_TLBFLUSH_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci/*
68c2ecf20Sopenharmony_ci * TLB flushing:
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci *  - flush_tlb_all() flushes all processes TLBs
98c2ecf20Sopenharmony_ci *  - flush_tlb_mm(mm) flushes the specified mm context TLB's
108c2ecf20Sopenharmony_ci *  - flush_tlb_page(vma, vmaddr) flushes one page
118c2ecf20Sopenharmony_ci *  - flush_tlb_range(vma, start, end) flushes a range of pages
128c2ecf20Sopenharmony_ci *  - flush_tlb_kernel_range(start, end) flushes a range of kernel pages
138c2ecf20Sopenharmony_ci */
148c2ecf20Sopenharmony_ciextern void local_flush_tlb_all(void);
158c2ecf20Sopenharmony_ciextern void local_flush_tlb_mm(struct mm_struct *mm);
168c2ecf20Sopenharmony_ciextern void local_flush_tlb_range(struct vm_area_struct *vma,
178c2ecf20Sopenharmony_ci				  unsigned long start,
188c2ecf20Sopenharmony_ci				  unsigned long end);
198c2ecf20Sopenharmony_ciextern void local_flush_tlb_page(struct vm_area_struct *vma,
208c2ecf20Sopenharmony_ci				 unsigned long page);
218c2ecf20Sopenharmony_ciextern void local_flush_tlb_kernel_range(unsigned long start,
228c2ecf20Sopenharmony_ci					 unsigned long end);
238c2ecf20Sopenharmony_ciextern void local_flush_tlb_one(unsigned long asid, unsigned long page);
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ciextern void __flush_tlb_global(void);
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci#ifdef CONFIG_SMP
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ciextern void flush_tlb_all(void);
308c2ecf20Sopenharmony_ciextern void flush_tlb_mm(struct mm_struct *mm);
318c2ecf20Sopenharmony_ciextern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
328c2ecf20Sopenharmony_ci			    unsigned long end);
338c2ecf20Sopenharmony_ciextern void flush_tlb_page(struct vm_area_struct *vma, unsigned long page);
348c2ecf20Sopenharmony_ciextern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
358c2ecf20Sopenharmony_ciextern void flush_tlb_one(unsigned long asid, unsigned long page);
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci#else
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci#define flush_tlb_all()			local_flush_tlb_all()
408c2ecf20Sopenharmony_ci#define flush_tlb_mm(mm)		local_flush_tlb_mm(mm)
418c2ecf20Sopenharmony_ci#define flush_tlb_page(vma, page)	local_flush_tlb_page(vma, page)
428c2ecf20Sopenharmony_ci#define flush_tlb_one(asid, page)	local_flush_tlb_one(asid, page)
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci#define flush_tlb_range(vma, start, end)	\
458c2ecf20Sopenharmony_ci	local_flush_tlb_range(vma, start, end)
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci#define flush_tlb_kernel_range(start, end)	\
488c2ecf20Sopenharmony_ci	local_flush_tlb_kernel_range(start, end)
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci#endif /* CONFIG_SMP */
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci#endif /* __ASM_SH_TLBFLUSH_H */
53