aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/cacheflush.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/include/asm/cacheflush.h')
-rw-r--r--arch/arm/include/asm/cacheflush.h37
1 files changed, 26 insertions, 11 deletions
diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h
index de6c59f814a1..6cbd8fdc9f1f 100644
--- a/arch/arm/include/asm/cacheflush.h
+++ b/arch/arm/include/asm/cacheflush.h
@@ -10,11 +10,11 @@
10#ifndef _ASMARM_CACHEFLUSH_H 10#ifndef _ASMARM_CACHEFLUSH_H
11#define _ASMARM_CACHEFLUSH_H 11#define _ASMARM_CACHEFLUSH_H
12 12
13#include <linux/sched.h>
14#include <linux/mm.h> 13#include <linux/mm.h>
15 14
16#include <asm/glue.h> 15#include <asm/glue.h>
17#include <asm/shmparam.h> 16#include <asm/shmparam.h>
17#include <asm/cachetype.h>
18 18
19#define CACHE_COLOUR(vaddr) ((vaddr & (SHMLBA - 1)) >> PAGE_SHIFT) 19#define CACHE_COLOUR(vaddr) ((vaddr & (SHMLBA - 1)) >> PAGE_SHIFT)
20 20
@@ -296,16 +296,6 @@ static inline void outer_flush_range(unsigned long start, unsigned long end)
296#endif 296#endif
297 297
298/* 298/*
299 * flush_cache_vmap() is used when creating mappings (eg, via vmap,
300 * vmalloc, ioremap etc) in kernel space for pages. Since the
301 * direct-mappings of these pages may contain cached data, we need
302 * to do a full cache flush to ensure that writebacks don't corrupt
303 * data placed into these pages via the new mappings.
304 */
305#define flush_cache_vmap(start, end) flush_cache_all()
306#define flush_cache_vunmap(start, end) flush_cache_all()
307
308/*
309 * Copy user data from/to a page which is mapped into a different 299 * Copy user data from/to a page which is mapped into a different
310 * processes address space. Really, we want to allow our "user 300 * processes address space. Really, we want to allow our "user
311 * space" model to handle this. 301 * space" model to handle this.
@@ -444,4 +434,29 @@ static inline void flush_ioremap_region(unsigned long phys, void __iomem *virt,
444 dmac_inv_range(start, start + size); 434 dmac_inv_range(start, start + size);
445} 435}
446 436
437/*
438 * flush_cache_vmap() is used when creating mappings (eg, via vmap,
439 * vmalloc, ioremap etc) in kernel space for pages. On non-VIPT
440 * caches, since the direct-mappings of these pages may contain cached
441 * data, we need to do a full cache flush to ensure that writebacks
442 * don't corrupt data placed into these pages via the new mappings.
443 */
444static inline void flush_cache_vmap(unsigned long start, unsigned long end)
445{
446 if (!cache_is_vipt_nonaliasing())
447 flush_cache_all();
448 else
449 /*
450 * set_pte_at() called from vmap_pte_range() does not
451 * have a DSB after cleaning the cache line.
452 */
453 dsb();
454}
455
456static inline void flush_cache_vunmap(unsigned long start, unsigned long end)
457{
458 if (!cache_is_vipt_nonaliasing())
459 flush_cache_all();
460}
461
447#endif 462#endif