1
2#ifndef _ALPHA_CACHEFLUSH_H
3#define _ALPHA_CACHEFLUSH_H
4
5#include <linux/mm.h>
6
7
8
9
10
11
12
13
14
15
16
17
18
19#ifndef CONFIG_SMP
20#define flush_icache_range(start, end) imb()
21#else
22#define flush_icache_range(start, end) smp_imb()
23extern void smp_imb(void);
24#endif
25
26
27
28
29
30
31
32
33#ifndef CONFIG_SMP
34#include <linux/sched.h>
35
36extern void __load_new_mm_context(struct mm_struct *);
37static inline void
38flush_icache_user_page(struct vm_area_struct *vma, struct page *page,
39 unsigned long addr, int len)
40{
41 if (vma->vm_flags & VM_EXEC) {
42 struct mm_struct *mm = vma->vm_mm;
43 if (current->active_mm == mm)
44 __load_new_mm_context(mm);
45 else
46 mm->context[smp_processor_id()] = 0;
47 }
48}
49#define flush_icache_user_page flush_icache_user_page
50#else
51extern void flush_icache_user_page(struct vm_area_struct *vma,
52 struct page *page, unsigned long addr, int len);
53#define flush_icache_user_page flush_icache_user_page
54#endif
55
56
57#define flush_icache_page(vma, page) \
58 flush_icache_user_page((vma), (page), 0, 0)
59
60#include <asm-generic/cacheflush.h>
61
62#endif
63