1 /* SPDX-License-Identifier: GPL-2.0-or-later */
5 * Linux architectural port borrowing liberally from similar works of
6 * others. All original copyrights apply as per the original source
9 * OpenRISC implementation:
10 * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com>
11 * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
15 #ifndef __ASM_OPENRISC_TLBFLUSH_H
16 #define __ASM_OPENRISC_TLBFLUSH_H
19 #include <asm/processor.h>
20 #include <asm/pgalloc.h>
21 #include <asm/current.h>
22 #include <linux/sched.h>
25 * - flush_tlb() flushes the current mm struct TLBs
26 * - flush_tlb_all() flushes all processes TLBs
27 * - flush_tlb_mm(mm) flushes the specified mm context TLB's
28 * - flush_tlb_page(vma, vmaddr) flushes one page
29 * - flush_tlb_range(mm, start, end) flushes a range of pages
31 extern void local_flush_tlb_all(void);
32 extern void local_flush_tlb_mm(struct mm_struct *mm);
33 extern void local_flush_tlb_page(struct vm_area_struct *vma,
35 extern void local_flush_tlb_range(struct vm_area_struct *vma,
40 #define flush_tlb_all local_flush_tlb_all
41 #define flush_tlb_mm local_flush_tlb_mm
42 #define flush_tlb_page local_flush_tlb_page
43 #define flush_tlb_range local_flush_tlb_range
45 extern void flush_tlb_all(void);
46 extern void flush_tlb_mm(struct mm_struct *mm);
47 extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr);
48 extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
52 static inline void flush_tlb(void)
54 flush_tlb_mm(current->mm);
57 static inline void flush_tlb_kernel_range(unsigned long start,
60 flush_tlb_range(NULL, start, end);
63 #endif /* __ASM_OPENRISC_TLBFLUSH_H */