150acfb2bSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 2fab957c1SPalmer Dabbelt /* 3fab957c1SPalmer Dabbelt * Copyright (C) 2012 Regents of the University of California 4fab957c1SPalmer Dabbelt */ 5fab957c1SPalmer Dabbelt 6fab957c1SPalmer Dabbelt #ifndef _ASM_RISCV_TLB_H 7fab957c1SPalmer Dabbelt #define _ASM_RISCV_TLB_H 8fab957c1SPalmer Dabbelt 90ce5671cSWill Deacon struct mmu_gather; 100ce5671cSWill Deacon 110ce5671cSWill Deacon static void tlb_flush(struct mmu_gather *tlb); 120ce5671cSWill Deacon 1369be3fb1SJisheng Zhang #define tlb_flush tlb_flush 1469be3fb1SJisheng Zhang #include <asm-generic/tlb.h> 1569be3fb1SJisheng Zhang tlb_flush(struct mmu_gather * tlb)1669be3fb1SJisheng Zhangstatic inline void tlb_flush(struct mmu_gather *tlb) 1769be3fb1SJisheng Zhang { 1869be3fb1SJisheng Zhang #ifdef CONFIG_MMU 1969be3fb1SJisheng Zhang if (tlb->fullmm || tlb->need_flush_all || tlb->freed_tables) 2069be3fb1SJisheng Zhang flush_tlb_mm(tlb->mm); 2169be3fb1SJisheng Zhang else 2269be3fb1SJisheng Zhang flush_tlb_mm_range(tlb->mm, tlb->start, tlb->end, 2369be3fb1SJisheng Zhang tlb_get_unmap_size(tlb)); 2469be3fb1SJisheng Zhang #endif 2569be3fb1SJisheng Zhang } 2669be3fb1SJisheng Zhang 2769be3fb1SJisheng Zhang #endif /* _ASM_RISCV_TLB_H */ 2869be3fb1SJisheng Zhang