]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
92a73bd2 CH |
2 | #ifndef _ASM_GENERIC_CACHEFLUSH_H |
3 | #define _ASM_GENERIC_CACHEFLUSH_H | |
5c01b46b | 4 | |
8dbdd504 SR |
5 | struct mm_struct; |
6 | struct vm_area_struct; | |
7 | struct page; | |
8 | struct address_space; | |
9 | ||
5c01b46b AB |
10 | /* |
11 | * The cache doesn't need to be flushed when TLB entries change when | |
12 | * the cache is mapped to physical memory, not virtual memory | |
13 | */ | |
4f0bd808 | 14 | #ifndef flush_cache_all |
c296d4dc QC |
15 | static inline void flush_cache_all(void) |
16 | { | |
17 | } | |
4f0bd808 | 18 | #endif |
c296d4dc | 19 | |
4f0bd808 | 20 | #ifndef flush_cache_mm |
c296d4dc QC |
21 | static inline void flush_cache_mm(struct mm_struct *mm) |
22 | { | |
23 | } | |
4f0bd808 | 24 | #endif |
c296d4dc | 25 | |
4f0bd808 | 26 | #ifndef flush_cache_dup_mm |
c296d4dc QC |
27 | static inline void flush_cache_dup_mm(struct mm_struct *mm) |
28 | { | |
29 | } | |
4f0bd808 | 30 | #endif |
c296d4dc | 31 | |
4f0bd808 | 32 | #ifndef flush_cache_range |
c296d4dc QC |
33 | static inline void flush_cache_range(struct vm_area_struct *vma, |
34 | unsigned long start, | |
35 | unsigned long end) | |
36 | { | |
37 | } | |
4f0bd808 | 38 | #endif |
c296d4dc | 39 | |
4f0bd808 | 40 | #ifndef flush_cache_page |
c296d4dc QC |
41 | static inline void flush_cache_page(struct vm_area_struct *vma, |
42 | unsigned long vmaddr, | |
43 | unsigned long pfn) | |
44 | { | |
45 | } | |
4f0bd808 | 46 | #endif |
c296d4dc | 47 | |
76b3b58f | 48 | #ifndef ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE |
c296d4dc QC |
49 | static inline void flush_dcache_page(struct page *page) |
50 | { | |
51 | } | |
76b3b58f | 52 | #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0 |
4f0bd808 | 53 | #endif |
c296d4dc | 54 | |
76b3b58f | 55 | |
4f0bd808 | 56 | #ifndef flush_dcache_mmap_lock |
c296d4dc QC |
57 | static inline void flush_dcache_mmap_lock(struct address_space *mapping) |
58 | { | |
59 | } | |
4f0bd808 | 60 | #endif |
c296d4dc | 61 | |
4f0bd808 | 62 | #ifndef flush_dcache_mmap_unlock |
c296d4dc QC |
63 | static inline void flush_dcache_mmap_unlock(struct address_space *mapping) |
64 | { | |
65 | } | |
4f0bd808 | 66 | #endif |
c296d4dc | 67 | |
4f0bd808 | 68 | #ifndef flush_icache_range |
c296d4dc QC |
69 | static inline void flush_icache_range(unsigned long start, unsigned long end) |
70 | { | |
71 | } | |
4f0bd808 | 72 | #endif |
c296d4dc | 73 | |
1268c333 CH |
74 | #ifndef flush_icache_user_range |
75 | #define flush_icache_user_range flush_icache_range | |
76 | #endif | |
77 | ||
4f0bd808 | 78 | #ifndef flush_icache_page |
c296d4dc QC |
79 | static inline void flush_icache_page(struct vm_area_struct *vma, |
80 | struct page *page) | |
81 | { | |
82 | } | |
4f0bd808 | 83 | #endif |
c296d4dc | 84 | |
885f7f8e CH |
85 | #ifndef flush_icache_user_page |
86 | static inline void flush_icache_user_page(struct vm_area_struct *vma, | |
c296d4dc QC |
87 | struct page *page, |
88 | unsigned long addr, int len) | |
89 | { | |
90 | } | |
4f0bd808 | 91 | #endif |
c296d4dc | 92 | |
4f0bd808 | 93 | #ifndef flush_cache_vmap |
c296d4dc QC |
94 | static inline void flush_cache_vmap(unsigned long start, unsigned long end) |
95 | { | |
96 | } | |
4f0bd808 | 97 | #endif |
c296d4dc | 98 | |
4f0bd808 | 99 | #ifndef flush_cache_vunmap |
c296d4dc QC |
100 | static inline void flush_cache_vunmap(unsigned long start, unsigned long end) |
101 | { | |
102 | } | |
4f0bd808 | 103 | #endif |
5c01b46b | 104 | |
4f0bd808 MR |
105 | #ifndef copy_to_user_page |
106 | #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ | |
f68aa5b4 MF |
107 | do { \ |
108 | memcpy(dst, src, len); \ | |
885f7f8e | 109 | flush_icache_user_page(vma, page, vaddr, len); \ |
f68aa5b4 | 110 | } while (0) |
4f0bd808 MR |
111 | #endif |
112 | ||
113 | #ifndef copy_from_user_page | |
5c01b46b AB |
114 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ |
115 | memcpy(dst, src, len) | |
4f0bd808 | 116 | #endif |
5c01b46b | 117 | |
92a73bd2 | 118 | #endif /* _ASM_GENERIC_CACHEFLUSH_H */ |