1 diff --git a/arch/mips/include/asm/cacheflush.h b/arch/mips/include/asm/cacheflush.h
2 index 03b1d69..d32f12a 100644
3 --- a/arch/mips/include/asm/cacheflush.h
4 +++ b/arch/mips/include/asm/cacheflush.h
5 @@ -37,6 +37,7 @@ extern void (*flush_cache_range)(struct vm_area_struct *vma,
6 unsigned long start, unsigned long end);
7 extern void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page, unsigned long pfn);
8 extern void __flush_dcache_page(struct page *page);
9 +extern void __flush_icache_page(struct vm_area_struct *vma, struct page *page);
11 static inline void flush_dcache_page(struct page *page)
13 @@ -57,11 +58,6 @@ static inline void flush_anon_page(struct vm_area_struct *vma,
14 __flush_anon_page(page, vmaddr);
17 -static inline void flush_icache_page(struct vm_area_struct *vma,
22 extern void (*flush_icache_range)(unsigned long start, unsigned long end);
23 extern void (*local_flush_icache_range)(unsigned long start, unsigned long end);
25 @@ -94,6 +90,13 @@ extern void (*flush_icache_all)(void);
26 extern void (*local_flush_data_cache_page)(void * addr);
27 extern void (*flush_data_cache_page)(unsigned long addr);
29 +static inline void flush_icache_page(struct vm_area_struct *vma,
32 + __flush_icache_page(vma, page);
37 * This flag is used to indicate that the page pointed to by a pte
38 * is dirty and requires cleaning before returning it to the user.
39 diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c
40 index 694d51f..9214d6b 100644
41 --- a/arch/mips/mm/cache.c
42 +++ b/arch/mips/mm/cache.c
43 @@ -95,6 +95,14 @@ void __flush_dcache_page(struct page *page)
45 EXPORT_SYMBOL(__flush_dcache_page);
47 +void __flush_icache_page(struct vm_area_struct *vma, struct page *page)
49 + if (vma->vm_flags & VM_EXEC)
50 + flush_icache_range((unsigned long) page_address(page), PAGE_SIZE);
53 +EXPORT_SYMBOL(__flush_icache_page);
55 void __flush_anon_page(struct page *page, unsigned long vmaddr)
57 unsigned long addr = (unsigned long) page_address(page);