Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef __ASM_SH_CACHEFLUSH_H |
| 2 | #define __ASM_SH_CACHEFLUSH_H |
Paul Mundt | e7bd34a | 2007-07-31 17:07:28 +0900 | [diff] [blame] | 3 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | #ifdef __KERNEL__ |
| 5 | |
Paul Mundt | 37443ef | 2009-08-15 12:29:49 +0900 | [diff] [blame^] | 6 | #include <linux/mm.h> |
Paul Mundt | f15cbe6 | 2008-07-29 08:09:44 +0900 | [diff] [blame] | 7 | #include <cpu/cacheflush.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | |
Paul Mundt | c0fe478 | 2009-08-04 16:02:43 +0900 | [diff] [blame] | 9 | #define ARCH_HAS_FLUSH_ANON_PAGE |
| 10 | extern void __flush_anon_page(struct page *page, unsigned long); |
| 11 | |
| 12 | static inline void flush_anon_page(struct vm_area_struct *vma, |
| 13 | struct page *page, unsigned long vmaddr) |
| 14 | { |
| 15 | if (boot_cpu_data.dcache.n_aliases && PageAnon(page)) |
| 16 | __flush_anon_page(page, vmaddr); |
| 17 | } |
Paul Mundt | c0fe478 | 2009-08-04 16:02:43 +0900 | [diff] [blame] | 18 | |
Carmelo Amoroso | 844b43a | 2008-01-07 13:50:18 +0900 | [diff] [blame] | 19 | #define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE |
| 20 | static inline void flush_kernel_dcache_page(struct page *page) |
| 21 | { |
| 22 | flush_dcache_page(page); |
| 23 | } |
| 24 | |
Paul Mundt | ba1789e | 2007-11-05 16:18:16 +0900 | [diff] [blame] | 25 | extern void copy_to_user_page(struct vm_area_struct *vma, |
| 26 | struct page *page, unsigned long vaddr, void *dst, const void *src, |
| 27 | unsigned long len); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | |
Paul Mundt | ba1789e | 2007-11-05 16:18:16 +0900 | [diff] [blame] | 29 | extern void copy_from_user_page(struct vm_area_struct *vma, |
| 30 | struct page *page, unsigned long vaddr, void *dst, const void *src, |
| 31 | unsigned long len); |
Paul Mundt | ba1789e | 2007-11-05 16:18:16 +0900 | [diff] [blame] | 32 | |
| 33 | #define flush_cache_vmap(start, end) flush_cache_all() |
| 34 | #define flush_cache_vunmap(start, end) flush_cache_all() |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | |
Paul Mundt | 7fbb2d3 | 2009-08-15 11:25:32 +0900 | [diff] [blame] | 36 | #define flush_dcache_mmap_lock(mapping) do { } while (0) |
| 37 | #define flush_dcache_mmap_unlock(mapping) do { } while (0) |
| 38 | |
Paul Mundt | 2739742 | 2009-08-15 09:19:19 +0900 | [diff] [blame] | 39 | void kmap_coherent_init(void); |
| 40 | void *kmap_coherent(struct page *page, unsigned long addr); |
| 41 | void kunmap_coherent(void); |
| 42 | |
Paul Mundt | dde5e3f | 2009-08-15 09:49:32 +0900 | [diff] [blame] | 43 | #define PG_dcache_dirty PG_arch_1 |
| 44 | |
Paul Mundt | ecba106 | 2009-08-15 11:05:42 +0900 | [diff] [blame] | 45 | void cpu_cache_init(void); |
| 46 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 47 | #endif /* __KERNEL__ */ |
| 48 | #endif /* __ASM_SH_CACHEFLUSH_H */ |