blob: 25b7f46494de55a9644214e0db40c43acdf374ad [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef __ASM_SH_CACHEFLUSH_H
2#define __ASM_SH_CACHEFLUSH_H
Paul Mundte7bd34a2007-07-31 17:07:28 +09003
Linus Torvalds1da177e2005-04-16 15:20:36 -07004#ifdef __KERNEL__
5
Paul Mundt37443ef2009-08-15 12:29:49 +09006#include <linux/mm.h>
Paul Mundtf15cbe62008-07-29 08:09:44 +09007#include <cpu/cacheflush.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07008
Paul Mundtc0fe4782009-08-04 16:02:43 +09009#define ARCH_HAS_FLUSH_ANON_PAGE
10extern void __flush_anon_page(struct page *page, unsigned long);
11
12static 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 Mundtc0fe4782009-08-04 16:02:43 +090018
Carmelo Amoroso844b43a2008-01-07 13:50:18 +090019#define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE
20static inline void flush_kernel_dcache_page(struct page *page)
21{
22 flush_dcache_page(page);
23}
24
Paul Mundtba1789e2007-11-05 16:18:16 +090025extern 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 Torvalds1da177e2005-04-16 15:20:36 -070028
Paul Mundtba1789e2007-11-05 16:18:16 +090029extern 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 Mundtba1789e2007-11-05 16:18:16 +090032
33#define flush_cache_vmap(start, end) flush_cache_all()
34#define flush_cache_vunmap(start, end) flush_cache_all()
Linus Torvalds1da177e2005-04-16 15:20:36 -070035
Paul Mundt7fbb2d32009-08-15 11:25:32 +090036#define flush_dcache_mmap_lock(mapping) do { } while (0)
37#define flush_dcache_mmap_unlock(mapping) do { } while (0)
38
Paul Mundt27397422009-08-15 09:19:19 +090039void kmap_coherent_init(void);
40void *kmap_coherent(struct page *page, unsigned long addr);
41void kunmap_coherent(void);
42
Paul Mundtdde5e3f2009-08-15 09:49:32 +090043#define PG_dcache_dirty PG_arch_1
44
Paul Mundtecba1062009-08-15 11:05:42 +090045void cpu_cache_init(void);
46
Linus Torvalds1da177e2005-04-16 15:20:36 -070047#endif /* __KERNEL__ */
48#endif /* __ASM_SH_CACHEFLUSH_H */