~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/sh/include/asm/cacheflush.h

Version: ~ [ linux-5.15-rc5 ] ~ [ linux-5.14.11 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.72 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.152 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.210 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.250 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.286 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.288 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef __ASM_SH_CACHEFLUSH_H
  3 #define __ASM_SH_CACHEFLUSH_H
  4 
  5 #ifdef __KERNEL__
  6 
  7 #include <linux/mm.h>
  8 
  9 /*
 10  * Cache flushing:
 11  *
 12  *  - flush_cache_all() flushes entire cache
 13  *  - flush_cache_mm(mm) flushes the specified mm context's cache lines
 14  *  - flush_cache_dup mm(mm) handles cache flushing when forking
 15  *  - flush_cache_page(mm, vmaddr, pfn) flushes a single page
 16  *  - flush_cache_range(vma, start, end) flushes a range of pages
 17  *
 18  *  - flush_dcache_page(pg) flushes(wback&invalidates) a page for dcache
 19  *  - flush_icache_range(start, end) flushes(invalidates) a range for icache
 20  *  - flush_icache_page(vma, pg) flushes(invalidates) a page for icache
 21  *  - flush_cache_sigtramp(vaddr) flushes the signal trampoline
 22  */
 23 extern void (*local_flush_cache_all)(void *args);
 24 extern void (*local_flush_cache_mm)(void *args);
 25 extern void (*local_flush_cache_dup_mm)(void *args);
 26 extern void (*local_flush_cache_page)(void *args);
 27 extern void (*local_flush_cache_range)(void *args);
 28 extern void (*local_flush_dcache_page)(void *args);
 29 extern void (*local_flush_icache_range)(void *args);
 30 extern void (*local_flush_icache_page)(void *args);
 31 extern void (*local_flush_cache_sigtramp)(void *args);
 32 
 33 static inline void cache_noop(void *args) { }
 34 
 35 extern void (*__flush_wback_region)(void *start, int size);
 36 extern void (*__flush_purge_region)(void *start, int size);
 37 extern void (*__flush_invalidate_region)(void *start, int size);
 38 
 39 extern void flush_cache_all(void);
 40 extern void flush_cache_mm(struct mm_struct *mm);
 41 extern void flush_cache_dup_mm(struct mm_struct *mm);
 42 extern void flush_cache_page(struct vm_area_struct *vma,
 43                                 unsigned long addr, unsigned long pfn);
 44 extern void flush_cache_range(struct vm_area_struct *vma,
 45                                  unsigned long start, unsigned long end);
 46 #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
 47 extern void flush_dcache_page(struct page *page);
 48 extern void flush_icache_range(unsigned long start, unsigned long end);
 49 extern void flush_icache_page(struct vm_area_struct *vma,
 50                                  struct page *page);
 51 extern void flush_cache_sigtramp(unsigned long address);
 52 
 53 struct flusher_data {
 54         struct vm_area_struct *vma;
 55         unsigned long addr1, addr2;
 56 };
 57 
 58 #define ARCH_HAS_FLUSH_ANON_PAGE
 59 extern void __flush_anon_page(struct page *page, unsigned long);
 60 
 61 static inline void flush_anon_page(struct vm_area_struct *vma,
 62                                    struct page *page, unsigned long vmaddr)
 63 {
 64         if (boot_cpu_data.dcache.n_aliases && PageAnon(page))
 65                 __flush_anon_page(page, vmaddr);
 66 }
 67 static inline void flush_kernel_vmap_range(void *addr, int size)
 68 {
 69         __flush_wback_region(addr, size);
 70 }
 71 static inline void invalidate_kernel_vmap_range(void *addr, int size)
 72 {
 73         __flush_invalidate_region(addr, size);
 74 }
 75 
 76 #define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE
 77 static inline void flush_kernel_dcache_page(struct page *page)
 78 {
 79         flush_dcache_page(page);
 80 }
 81 
 82 extern void copy_to_user_page(struct vm_area_struct *vma,
 83         struct page *page, unsigned long vaddr, void *dst, const void *src,
 84         unsigned long len);
 85 
 86 extern void copy_from_user_page(struct vm_area_struct *vma,
 87         struct page *page, unsigned long vaddr, void *dst, const void *src,
 88         unsigned long len);
 89 
 90 #define flush_cache_vmap(start, end)            local_flush_cache_all(NULL)
 91 #define flush_cache_vunmap(start, end)          local_flush_cache_all(NULL)
 92 
 93 #define flush_dcache_mmap_lock(mapping)         do { } while (0)
 94 #define flush_dcache_mmap_unlock(mapping)       do { } while (0)
 95 
 96 void kmap_coherent_init(void);
 97 void *kmap_coherent(struct page *page, unsigned long addr);
 98 void kunmap_coherent(void *kvaddr);
 99 
100 #define PG_dcache_clean PG_arch_1
101 
102 void cpu_cache_init(void);
103 
104 static inline void *sh_cacheop_vaddr(void *vaddr)
105 {
106         if (__in_29bit_mode())
107                 vaddr = (void *)CAC_ADDR((unsigned long)vaddr);
108         return vaddr;
109 }
110 
111 #endif /* __KERNEL__ */
112 #endif /* __ASM_SH_CACHEFLUSH_H */
113 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp