18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef _ASM_POWERPC_NOHASH_TLBFLUSH_H
38c2ecf20Sopenharmony_ci#define _ASM_POWERPC_NOHASH_TLBFLUSH_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci/*
68c2ecf20Sopenharmony_ci * TLB flushing:
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci *  - flush_tlb_mm(mm) flushes the specified mm context TLB's
98c2ecf20Sopenharmony_ci *  - flush_tlb_page(vma, vmaddr) flushes one page
108c2ecf20Sopenharmony_ci *  - local_flush_tlb_mm(mm, full) flushes the specified mm context on
118c2ecf20Sopenharmony_ci *                           the local processor
128c2ecf20Sopenharmony_ci *  - local_flush_tlb_page(vma, vmaddr) flushes one page on the local processor
138c2ecf20Sopenharmony_ci *  - flush_tlb_page_nohash(vma, vmaddr) flushes one page if SW loaded TLB
148c2ecf20Sopenharmony_ci *  - flush_tlb_range(vma, start, end) flushes a range of pages
158c2ecf20Sopenharmony_ci *  - flush_tlb_kernel_range(start, end) flushes a range of kernel pages
168c2ecf20Sopenharmony_ci *
178c2ecf20Sopenharmony_ci */
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci/*
208c2ecf20Sopenharmony_ci * TLB flushing for software loaded TLB chips
218c2ecf20Sopenharmony_ci *
228c2ecf20Sopenharmony_ci * TODO: (CONFIG_FSL_BOOKE) determine if flush_tlb_range &
238c2ecf20Sopenharmony_ci * flush_tlb_kernel_range are best implemented as tlbia vs
248c2ecf20Sopenharmony_ci * specific tlbie's
258c2ecf20Sopenharmony_ci */
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_cistruct vm_area_struct;
288c2ecf20Sopenharmony_cistruct mm_struct;
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci#define MMU_NO_CONTEXT      	((unsigned int)-1)
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ciextern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
338c2ecf20Sopenharmony_ci			    unsigned long end);
348c2ecf20Sopenharmony_ciextern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ciextern void local_flush_tlb_mm(struct mm_struct *mm);
378c2ecf20Sopenharmony_ciextern void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ciextern void __local_flush_tlb_page(struct mm_struct *mm, unsigned long vmaddr,
408c2ecf20Sopenharmony_ci				   int tsize, int ind);
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci#ifdef CONFIG_SMP
438c2ecf20Sopenharmony_ciextern void flush_tlb_mm(struct mm_struct *mm);
448c2ecf20Sopenharmony_ciextern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
458c2ecf20Sopenharmony_ciextern void __flush_tlb_page(struct mm_struct *mm, unsigned long vmaddr,
468c2ecf20Sopenharmony_ci			     int tsize, int ind);
478c2ecf20Sopenharmony_ci#else
488c2ecf20Sopenharmony_ci#define flush_tlb_mm(mm)		local_flush_tlb_mm(mm)
498c2ecf20Sopenharmony_ci#define flush_tlb_page(vma,addr)	local_flush_tlb_page(vma,addr)
508c2ecf20Sopenharmony_ci#define __flush_tlb_page(mm,addr,p,i)	__local_flush_tlb_page(mm,addr,p,i)
518c2ecf20Sopenharmony_ci#endif
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci#endif /* _ASM_POWERPC_NOHASH_TLBFLUSH_H */
54