0001
0002 #ifndef _ALPHA_CACHEFLUSH_H
0003 #define _ALPHA_CACHEFLUSH_H
0004
0005 #include <linux/mm.h>
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #ifndef CONFIG_SMP
0020 #define flush_icache_range(start, end) imb()
0021 #else
0022 #define flush_icache_range(start, end) smp_imb()
0023 extern void smp_imb(void);
0024 #endif
0025
0026
0027
0028
0029
0030
0031
0032
0033 #ifndef CONFIG_SMP
0034 #include <linux/sched.h>
0035
0036 extern void __load_new_mm_context(struct mm_struct *);
0037 static inline void
0038 flush_icache_user_page(struct vm_area_struct *vma, struct page *page,
0039 unsigned long addr, int len)
0040 {
0041 if (vma->vm_flags & VM_EXEC) {
0042 struct mm_struct *mm = vma->vm_mm;
0043 if (current->active_mm == mm)
0044 __load_new_mm_context(mm);
0045 else
0046 mm->context[smp_processor_id()] = 0;
0047 }
0048 }
0049 #define flush_icache_user_page flush_icache_user_page
0050 #else
0051 extern void flush_icache_user_page(struct vm_area_struct *vma,
0052 struct page *page, unsigned long addr, int len);
0053 #define flush_icache_user_page flush_icache_user_page
0054 #endif
0055
0056
0057 #define flush_icache_page(vma, page) \
0058 flush_icache_user_page((vma), (page), 0, 0)
0059
0060 #include <asm-generic/cacheflush.h>
0061
0062 #endif