|
@@ -314,3 +314,53 @@ static inline void flush_anon_page(struct vm_area_struct *vma,
|
|
struct page *page, unsigned long vmaddr)
|
|
struct page *page, unsigned long vmaddr)
|
|
{
|
|
{
|
|
extern void __flush_anon_page(struct vm_area_struct *vma,
|
|
extern void __flush_anon_page(struct vm_area_struct *vma,
|
|
|
|
+ struct page *, unsigned long);
|
|
|
|
+ if (PageAnon(page))
|
|
|
|
+ __flush_anon_page(vma, page, vmaddr);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+#define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE
|
|
|
|
+static inline void flush_kernel_dcache_page(struct page *page)
|
|
|
|
+{
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+#define flush_dcache_mmap_lock(mapping) \
|
|
|
|
+ spin_lock_irq(&(mapping)->tree_lock)
|
|
|
|
+#define flush_dcache_mmap_unlock(mapping) \
|
|
|
|
+ spin_unlock_irq(&(mapping)->tree_lock)
|
|
|
|
+
|
|
|
|
+#define flush_icache_user_range(vma,page,addr,len) \
|
|
|
|
+ flush_dcache_page(page)
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * We don't appear to need to do anything here. In fact, if we did, we'd
|
|
|
|
+ * duplicate cache flushing elsewhere performed by flush_dcache_page().
|
|
|
|
+ */
|
|
|
|
+#define flush_icache_page(vma,page) do { } while (0)
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * flush_cache_vmap() is used when creating mappings (eg, via vmap,
|
|
|
|
+ * vmalloc, ioremap etc) in kernel space for pages. On non-VIPT
|
|
|
|
+ * caches, since the direct-mappings of these pages may contain cached
|
|
|
|
+ * data, we need to do a full cache flush to ensure that writebacks
|
|
|
|
+ * don't corrupt data placed into these pages via the new mappings.
|
|
|
|
+ */
|
|
|
|
+static inline void flush_cache_vmap(unsigned long start, unsigned long end)
|
|
|
|
+{
|
|
|
|
+ if (!cache_is_vipt_nonaliasing())
|
|
|
|
+ flush_cache_all();
|
|
|
|
+ else
|
|
|
|
+ /*
|
|
|
|
+ * set_pte_at() called from vmap_pte_range() does not
|
|
|
|
+ * have a DSB after cleaning the cache line.
|
|
|
|
+ */
|
|
|
|
+ dsb();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline void flush_cache_vunmap(unsigned long start, unsigned long end)
|
|
|
|
+{
|
|
|
|
+ if (!cache_is_vipt_nonaliasing())
|
|
|
|
+ flush_cache_all();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+#endif
|