1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #ifndef _ASM_POWERPC_TLBFLUSH_RADIX_H 3 #define _ASM_POWERPC_TLBFLUSH_RADIX_H 4 5 struct vm_area_struct; 6 struct mm_struct; 7 struct mmu_gather; 8 9 static inline int mmu_get_ap(int psize) 10 { 11 return mmu_psize_defs[psize].ap; 12 } 13 14 #ifdef CONFIG_PPC_RADIX_MMU 15 extern void radix__tlbiel_all(unsigned int action); 16 #else 17 static inline void radix__tlbiel_all(unsigned int action) { WARN_ON(1); }; 18 #endif 19 20 extern void radix__flush_hugetlb_tlb_range(struct vm_area_struct *vma, 21 unsigned long start, unsigned long end); 22 extern void radix__flush_tlb_range_psize(struct mm_struct *mm, unsigned long start, 23 unsigned long end, int psize); 24 extern void radix__flush_pmd_tlb_range(struct vm_area_struct *vma, 25 unsigned long start, unsigned long end); 26 extern void radix__flush_tlb_range(struct vm_area_struct *vma, unsigned long start, 27 unsigned long end); 28 extern void radix__flush_tlb_kernel_range(unsigned long start, unsigned long end); 29 30 extern void radix__local_flush_tlb_mm(struct mm_struct *mm); 31 extern void radix__local_flush_all_mm(struct mm_struct *mm); 32 extern void radix__local_flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr); 33 extern void radix__local_flush_tlb_page_psize(struct mm_struct *mm, unsigned long vmaddr, 34 int psize); 35 extern void radix__tlb_flush(struct mmu_gather *tlb); 36 #ifdef CONFIG_SMP 37 extern void radix__flush_tlb_mm(struct mm_struct *mm); 38 extern void radix__flush_all_mm(struct mm_struct *mm); 39 extern void radix__flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr); 40 extern void radix__flush_tlb_page_psize(struct mm_struct *mm, unsigned long vmaddr, 41 int psize); 42 #else 43 #define radix__flush_tlb_mm(mm) radix__local_flush_tlb_mm(mm) 44 #define radix__flush_all_mm(mm) radix__local_flush_all_mm(mm) 45 #define radix__flush_tlb_page(vma,addr) radix__local_flush_tlb_page(vma,addr) 46 #define radix__flush_tlb_page_psize(mm,addr,p) radix__local_flush_tlb_page_psize(mm,addr,p) 47 #endif 48 extern void radix__flush_tlb_pwc(struct mmu_gather *tlb, unsigned long addr); 49 extern void radix__flush_tlb_collapsed_pmd(struct mm_struct *mm, unsigned long addr); 50 extern void radix__flush_tlb_all(void); 51 52 extern void radix__flush_tlb_lpid_page(unsigned int lpid, 53 unsigned long addr, 54 unsigned long page_size); 55 extern void radix__flush_pwc_lpid(unsigned int lpid); 56 extern void radix__flush_tlb_lpid(unsigned int lpid); 57 extern void radix__local_flush_tlb_lpid(unsigned int lpid); 58 extern void radix__local_flush_tlb_lpid_guest(unsigned int lpid); 59 60 #endif 61