^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-or-later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Copyright (C) 2010 Tobias Klauser <tklauser@distanz.ch>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #ifndef _ASM_NIOS2_TLBFLUSH_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #define _ASM_NIOS2_TLBFLUSH_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) struct mm_struct;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * TLB flushing:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * - flush_tlb_all() flushes all processes TLB entries
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) * - flush_tlb_mm(mm) flushes the specified mm context TLB entries
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * - flush_tlb_range(vma, start, end) flushes a range of pages
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * - flush_tlb_page(vma, address) flushes a page
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * - flush_tlb_kernel_range(start, end) flushes a range of kernel pages
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * - flush_tlb_kernel_page(address) flushes a kernel page
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) * - reload_tlb_page(vma, address, pte) flushes the TLB for address like
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * flush_tlb_page, then replaces it with a TLB for pte.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) extern void flush_tlb_all(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) extern void flush_tlb_mm(struct mm_struct *mm);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) unsigned long end);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) static inline void flush_tlb_page(struct vm_area_struct *vma,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) unsigned long address)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) flush_tlb_range(vma, address, address + PAGE_SIZE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) static inline void flush_tlb_kernel_page(unsigned long address)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) flush_tlb_kernel_range(address, address + PAGE_SIZE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) extern void reload_tlb_page(struct vm_area_struct *vma, unsigned long addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) pte_t pte);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) #endif /* _ASM_NIOS2_TLBFLUSH_H */