blob: 362d6da09d020e5a7a346ef2de280928cb066f4a [file] [log] [blame]
David Brazdil0f672f62019-12-10 10:32:29 +00001/* SPDX-License-Identifier: GPL-2.0-or-later */
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00002/*
3 * Copyright (C) 2010 Tobias Klauser <tklauser@distanz.ch>
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00004 */
5
6#ifndef _ASM_NIOS2_TLBFLUSH_H
7#define _ASM_NIOS2_TLBFLUSH_H
8
9struct mm_struct;
10
11/*
12 * TLB flushing:
13 *
14 * - flush_tlb_all() flushes all processes TLB entries
15 * - flush_tlb_mm(mm) flushes the specified mm context TLB entries
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000016 * - flush_tlb_range(vma, start, end) flushes a range of pages
David Brazdil0f672f62019-12-10 10:32:29 +000017 * - flush_tlb_page(vma, address) flushes a page
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000018 * - flush_tlb_kernel_range(start, end) flushes a range of kernel pages
David Brazdil0f672f62019-12-10 10:32:29 +000019 * - flush_tlb_kernel_page(address) flushes a kernel page
20 *
21 * - reload_tlb_page(vma, address, pte) flushes the TLB for address like
22 * flush_tlb_page, then replaces it with a TLB for pte.
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000023 */
24extern void flush_tlb_all(void);
25extern void flush_tlb_mm(struct mm_struct *mm);
26extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
27 unsigned long end);
28extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000029
30static inline void flush_tlb_page(struct vm_area_struct *vma,
David Brazdil0f672f62019-12-10 10:32:29 +000031 unsigned long address)
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000032{
David Brazdil0f672f62019-12-10 10:32:29 +000033 flush_tlb_range(vma, address, address + PAGE_SIZE);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000034}
35
David Brazdil0f672f62019-12-10 10:32:29 +000036static inline void flush_tlb_kernel_page(unsigned long address)
37{
38 flush_tlb_kernel_range(address, address + PAGE_SIZE);
39}
40
41extern void reload_tlb_page(struct vm_area_struct *vma, unsigned long addr,
42 pte_t pte);
43
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000044#endif /* _ASM_NIOS2_TLBFLUSH_H */