2 * linux/arch/arm/mm/cache-v4.S
4 * Copyright (C) 1997-2002 Russell king
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 #include <linux/linkage.h>
11 #include <linux/init.h>
12 #include <asm/assembler.h>
14 #include "proc-macros.S"
19 * Unconditionally clean and invalidate the entire icache.
21 ENTRY(v4_flush_icache_all)
23 ENDPROC(v4_flush_icache_all)
26 * flush_user_cache_all()
28 * Invalidate all cache entries in a particular address
31 * - mm - mm_struct describing address space
33 ENTRY(v4_flush_user_cache_all)
36 * flush_kern_cache_all()
38 * Clean and invalidate the entire cache.
40 ENTRY(v4_flush_kern_cache_all)
41 #ifdef CONFIG_CPU_CP15
43 mcr p15, 0, r0, c7, c7, 0 @ flush ID cache
50 * flush_user_cache_range(start, end, flags)
52 * Invalidate a range of cache entries in the specified
55 * - start - start address (may not be aligned)
56 * - end - end address (exclusive, may not be aligned)
57 * - flags - vma_area_struct flags describing address space
59 ENTRY(v4_flush_user_cache_range)
60 #ifdef CONFIG_CPU_CP15
62 mcr p15, 0, ip, c7, c7, 0 @ flush ID cache
69 * coherent_kern_range(start, end)
71 * Ensure coherency between the Icache and the Dcache in the
72 * region described by start. If you have non-snooping
73 * Harvard caches, you need to implement this function.
75 * - start - virtual start address
76 * - end - virtual end address
78 ENTRY(v4_coherent_kern_range)
82 * coherent_user_range(start, end)
84 * Ensure coherency between the Icache and the Dcache in the
85 * region described by start. If you have non-snooping
86 * Harvard caches, you need to implement this function.
88 * - start - virtual start address
89 * - end - virtual end address
91 ENTRY(v4_coherent_user_range)
96 * flush_kern_dcache_area(void *addr, size_t size)
98 * Ensure no D cache aliasing occurs, either with itself or
101 * - addr - kernel address
102 * - size - region size
104 ENTRY(v4_flush_kern_dcache_area)
108 * dma_flush_range(start, end)
110 * Clean and invalidate the specified virtual address range.
112 * - start - virtual start address
113 * - end - virtual end address
115 ENTRY(v4_dma_flush_range)
116 #ifdef CONFIG_CPU_CP15
118 mcr p15, 0, r0, c7, c7, 0 @ flush ID cache
123 * dma_unmap_area(start, size, dir)
124 * - start - kernel virtual start address
125 * - size - size of region
126 * - dir - DMA direction
128 ENTRY(v4_dma_unmap_area)
129 teq r2, #DMA_TO_DEVICE
130 bne v4_dma_flush_range
134 * dma_map_area(start, size, dir)
135 * - start - kernel virtual start address
136 * - size - size of region
137 * - dir - DMA direction
139 ENTRY(v4_dma_map_area)
141 ENDPROC(v4_dma_unmap_area)
142 ENDPROC(v4_dma_map_area)
144 .globl v4_flush_kern_cache_louis
145 .equ v4_flush_kern_cache_louis, v4_flush_kern_cache_all
149 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
150 define_cache_functions v4