This source file includes following definitions.
- flush_cache_mm
- flush_cache_range
- flush_cache_page
- flush_ptrace_access
- copy_to_user_page
- __flush_dcache_page
- flush_dcache_page
1
2
3
4
5
6
7
8
9 #include <linux/module.h>
10 #include <linux/mm.h>
11 #include <linux/pagemap.h>
12
13 #include <asm/cacheflush.h>
14 #include <asm/tlbflush.h>
15
16 void flush_cache_mm(struct mm_struct *mm)
17 {
18 }
19
20 void flush_cache_range(struct vm_area_struct *vma, unsigned long start,
21 unsigned long end)
22 {
23 if (vma->vm_flags & VM_EXEC)
24 __flush_icache_all();
25 }
26
27 void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr,
28 unsigned long pfn)
29 {
30 }
31
32 static void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
33 unsigned long uaddr, void *kaddr, unsigned long len)
34 {
35
36 if (vma->vm_flags & VM_EXEC) {
37 unsigned long addr = (unsigned long)kaddr;
38
39 __cpuc_coherent_kern_range(addr, addr + len);
40 }
41 }
42
43
44
45
46
47
48
49
50 void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
51 unsigned long uaddr, void *dst, const void *src,
52 unsigned long len)
53 {
54 memcpy(dst, src, len);
55 flush_ptrace_access(vma, page, uaddr, dst, len);
56 }
57
58 void __flush_dcache_page(struct address_space *mapping, struct page *page)
59 {
60
61
62
63
64
65 __cpuc_flush_kern_dcache_area(page_address(page), PAGE_SIZE);
66 }
67
68
69
70
71
72 void flush_dcache_page(struct page *page)
73 {
74 struct address_space *mapping;
75
76
77
78
79
80 if (page == ZERO_PAGE(0))
81 return;
82
83 mapping = page_mapping_file(page);
84
85 if (mapping && !mapping_mapped(mapping))
86 clear_bit(PG_dcache_clean, &page->flags);
87 else {
88 __flush_dcache_page(mapping, page);
89 if (mapping)
90 __flush_icache_all();
91 set_bit(PG_dcache_clean, &page->flags);
92 }
93 }
94 EXPORT_SYMBOL(flush_dcache_page);