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

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

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ 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.9 ] ~ [ 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 #include <linux/mm.h>
  6 
  7 /*
  8  * Cache flushing:
  9  *
 10  *  - flush_cache_all() flushes entire cache
 11  *  - flush_cache_mm(mm) flushes the specified mm context's cache lines
 12  *  - flush_cache_dup mm(mm) handles cache flushing when forking
 13  *  - flush_cache_page(mm, vmaddr, pfn) flushes a single page
 14  *  - flush_cache_range(vma, start, end) flushes a range of pages
 15  *
 16  *  - flush_dcache_folio(folio) flushes(wback&invalidates) a folio for dcache
 17  *  - flush_icache_range(start, end) flushes(invalidates) a range for icache
 18  *  - flush_icache_pages(vma, pg, nr) flushes(invalidates) pages for icache
 19  *  - flush_cache_sigtramp(vaddr) flushes the signal trampoline
 20  */
 21 extern void (*local_flush_cache_all)(void *args);
 22 extern void (*local_flush_cache_mm)(void *args);
 23 extern void (*local_flush_cache_dup_mm)(void *args);
 24 extern void (*local_flush_cache_page)(void *args);
 25 extern void (*local_flush_cache_range)(void *args);
 26 extern void (*local_flush_dcache_folio)(void *args);
 27 extern void (*local_flush_icache_range)(void *args);
 28 extern void (*local_flush_icache_folio)(void *args);
 29 extern void (*local_flush_cache_sigtramp)(void *args);
 30 
 31 static inline void cache_noop(void *args) { }
 32 
 33 extern void (*__flush_wback_region)(void *start, int size);
 34 extern void (*__flush_purge_region)(void *start, int size);
 35 extern void (*__flush_invalidate_region)(void *start, int size);
 36 
 37 extern void flush_cache_all(void);
 38 extern void flush_cache_mm(struct mm_struct *mm);
 39 extern void flush_cache_dup_mm(struct mm_struct *mm);
 40 extern void flush_cache_page(struct vm_area_struct *vma,
 41                                 unsigned long addr, unsigned long pfn);
 42 extern void flush_cache_range(struct vm_area_struct *vma,
 43                                  unsigned long start, unsigned long end);
 44 #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
 45 void flush_dcache_folio(struct folio *folio);
 46 #define flush_dcache_folio flush_dcache_folio
 47 static inline void flush_dcache_page(struct page *page)
 48 {
 49         flush_dcache_folio(page_folio(page));
 50 }
 51 
 52 extern void flush_icache_range(unsigned long start, unsigned long end);
 53 #define flush_icache_user_range flush_icache_range
 54 void flush_icache_pages(struct vm_area_struct *vma, struct page *page,
 55                 unsigned int nr);
 56 #define flush_icache_pages flush_icache_pages
 57 extern void flush_cache_sigtramp(unsigned long address);
 58 
 59 struct flusher_data {
 60         struct vm_area_struct *vma;
 61         unsigned long addr1, addr2;
 62 };
 63 
 64 #define ARCH_HAS_FLUSH_ANON_PAGE
 65 extern void __flush_anon_page(struct page *page, unsigned long);
 66 
 67 static inline void flush_anon_page(struct vm_area_struct *vma,
 68                                    struct page *page, unsigned long vmaddr)
 69 {
 70         if (boot_cpu_data.dcache.n_aliases && PageAnon(page))
 71                 __flush_anon_page(page, vmaddr);
 72 }
 73 
 74 #define ARCH_IMPLEMENTS_FLUSH_KERNEL_VMAP_RANGE 1
 75 static inline void flush_kernel_vmap_range(void *addr, int size)
 76 {
 77         __flush_wback_region(addr, size);
 78 }
 79 static inline void invalidate_kernel_vmap_range(void *addr, int size)
 80 {
 81         __flush_invalidate_region(addr, size);
 82 }
 83 
 84 extern void copy_to_user_page(struct vm_area_struct *vma,
 85         struct page *page, unsigned long vaddr, void *dst, const void *src,
 86         unsigned long len);
 87 
 88 extern void copy_from_user_page(struct vm_area_struct *vma,
 89         struct page *page, unsigned long vaddr, void *dst, const void *src,
 90         unsigned long len);
 91 
 92 #define flush_cache_vmap(start, end)            local_flush_cache_all(NULL)
 93 #define flush_cache_vmap_early(start, end)      do { } while (0)
 94 #define flush_cache_vunmap(start, end)          local_flush_cache_all(NULL)
 95 
 96 #define flush_dcache_mmap_lock(mapping)         do { } while (0)
 97 #define flush_dcache_mmap_unlock(mapping)       do { } while (0)
 98 
 99 void kmap_coherent_init(void);
100 void *kmap_coherent(struct page *page, unsigned long addr);
101 void kunmap_coherent(void *kvaddr);
102 
103 #define PG_dcache_clean PG_arch_1
104 
105 void cpu_cache_init(void);
106 
107 void __weak l2_cache_init(void);
108 
109 void __weak j2_cache_init(void);
110 void __weak sh2_cache_init(void);
111 void __weak sh2a_cache_init(void);
112 void __weak sh3_cache_init(void);
113 void __weak shx3_cache_init(void);
114 void __weak sh4_cache_init(void);
115 void __weak sh7705_cache_init(void);
116 
117 void __weak sh4__flush_region_init(void);
118 
119 static inline void *sh_cacheop_vaddr(void *vaddr)
120 {
121         if (__in_29bit_mode())
122                 vaddr = (void *)CAC_ADDR((unsigned long)vaddr);
123         return vaddr;
124 }
125 
126 #endif /* __ASM_SH_CACHEFLUSH_H */
127 

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php