Commit | Line | Data |
---|---|---|
50acfb2b | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
fab957c1 PD |
2 | /* |
3 | * Copyright (C) 2012 Regents of the University of California | |
fab957c1 PD |
4 | */ |
5 | ||
6 | #ifndef _ASM_RISCV_TLB_H | |
7 | #define _ASM_RISCV_TLB_H | |
8 | ||
0ce5671c WD |
9 | struct mmu_gather; |
10 | ||
11 | static void tlb_flush(struct mmu_gather *tlb); | |
12 | ||
5f307be1 | 13 | #define tlb_flush tlb_flush |
fab957c1 PD |
14 | #include <asm-generic/tlb.h> |
15 | ||
16 | static inline void tlb_flush(struct mmu_gather *tlb) | |
17 | { | |
c5e9b2c2 | 18 | #ifdef CONFIG_MMU |
97cf301f | 19 | if (tlb->fullmm || tlb->need_flush_all || tlb->freed_tables) |
c5e9b2c2 AG |
20 | flush_tlb_mm(tlb->mm); |
21 | else | |
22 | flush_tlb_mm_range(tlb->mm, tlb->start, tlb->end, | |
23 | tlb_get_unmap_size(tlb)); | |
24 | #endif | |
fab957c1 PD |
25 | } |
26 | ||
27 | #endif /* _ASM_RISCV_TLB_H */ |