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