1
2#ifndef _ALPHA_CACHEFLUSH_H
3#define _ALPHA_CACHEFLUSH_H
4
5#include <linux/mm.h>
6
7
8#define flush_cache_all() do { } while (0)
9#define flush_cache_mm(mm) do { } while (0)
10#define flush_cache_dup_mm(mm) do { } while (0)
11#define flush_cache_range(vma, start, end) do { } while (0)
12#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
13#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
14#define flush_dcache_page(page) do { } while (0)
15#define flush_dcache_mmap_lock(mapping) do { } while (0)
16#define flush_dcache_mmap_unlock(mapping) do { } while (0)
17#define flush_cache_vmap(start, end) do { } while (0)
18#define flush_cache_vunmap(start, end) do { } while (0)
19
20
21
22
23
24
25
26
27
28
29
30
31
32#ifndef CONFIG_SMP
33#define flush_icache_range(start, end) imb()
34#else
35#define flush_icache_range(start, end) smp_imb()
36extern void smp_imb(void);
37#endif
38
39
40
41
42
43
44
45
46#ifndef CONFIG_SMP
47#include <linux/sched.h>
48
49extern void __load_new_mm_context(struct mm_struct *);
50static inline void
51flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
52 unsigned long addr, int len)
53{
54 if (vma->vm_flags & VM_EXEC) {
55 struct mm_struct *mm = vma->vm_mm;
56 if (current->active_mm == mm)
57 __load_new_mm_context(mm);
58 else
59 mm->context[smp_processor_id()] = 0;
60 }
61}
62#else
63extern void flush_icache_user_range(struct vm_area_struct *vma,
64 struct page *page, unsigned long addr, int len);
65#endif
66
67
68#define flush_icache_page(vma, page) \
69 flush_icache_user_range((vma), (page), 0, 0)
70
71#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
72do { memcpy(dst, src, len); \
73 flush_icache_user_range(vma, page, vaddr, len); \
74} while (0)
75#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
76 memcpy(dst, src, len)
77
78#endif
79