^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) * Copyright (C) 2003 Microtronix Datacom Ltd.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Copyright (C) 2000-2002 Greg Ungerer <gerg@snapgear.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * This file is subject to the terms and conditions of the GNU General Public
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * License. See the file "COPYING" in the main directory of this archive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * for more details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #ifndef _ASM_NIOS2_CACHEFLUSH_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #define _ASM_NIOS2_CACHEFLUSH_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <linux/mm_types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * This flag is used to indicate that the page pointed to by a pte is clean
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * and does not require cleaning before returning it to the user.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #define PG_dcache_clean PG_arch_1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) struct mm_struct;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) extern void flush_cache_all(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) extern void flush_cache_mm(struct mm_struct *mm);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) extern void flush_cache_dup_mm(struct mm_struct *mm);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) extern void flush_cache_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_cache_page(struct vm_area_struct *vma, unsigned long vmaddr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) unsigned long pfn);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) extern void flush_dcache_page(struct page *page);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) extern void flush_icache_range(unsigned long start, unsigned long end);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) extern void flush_icache_page(struct vm_area_struct *vma, struct page *page);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) #define flush_cache_vmap(start, end) flush_dcache_range(start, end)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) #define flush_cache_vunmap(start, end) flush_dcache_range(start, end)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) extern void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) unsigned long user_vaddr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) void *dst, void *src, int len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) extern void copy_from_user_page(struct vm_area_struct *vma, struct page *page,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) unsigned long user_vaddr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) void *dst, void *src, int len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) extern void flush_dcache_range(unsigned long start, unsigned long end);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) extern void invalidate_dcache_range(unsigned long start, unsigned long end);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) #define flush_dcache_mmap_lock(mapping) xa_lock_irq(&mapping->i_pages)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) #define flush_dcache_mmap_unlock(mapping) xa_unlock_irq(&mapping->i_pages)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) #endif /* _ASM_NIOS2_CACHEFLUSH_H */