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/hardware.h>
14 #include "proc-macros.S"
17 * flush_user_cache_all()
19 * Invalidate all cache entries in a particular address
22 * - mm - mm_struct describing address space
24 ENTRY(v4_flush_user_cache_all)
27 * flush_kern_cache_all()
29 * Clean and invalidate the entire cache.
31 ENTRY(v4_flush_kern_cache_all)
33 mcr p15, 0, r0, c7, c7, 0 @ flush ID cache
37 * flush_user_cache_range(start, end, flags)
39 * Invalidate a range of cache entries in the specified
42 * - start - start address (may not be aligned)
43 * - end - end address (exclusive, may not be aligned)
44 * - flags - vma_area_struct flags describing address space
46 ENTRY(v4_flush_user_cache_range)
48 mcreq p15, 0, ip, c7, c7, 0 @ flush ID cache
52 * coherent_kern_range(start, end)
54 * Ensure coherency between the Icache and the Dcache in the
55 * region described by start. If you have non-snooping
56 * Harvard caches, you need to implement this function.
58 * - start - virtual start address
59 * - end - virtual end address
61 ENTRY(v4_coherent_kern_range)
65 * coherent_user_range(start, end)
67 * Ensure coherency between the Icache and the Dcache in the
68 * region described by start. If you have non-snooping
69 * Harvard caches, you need to implement this function.
71 * - start - virtual start address
72 * - end - virtual end address
74 ENTRY(v4_coherent_user_range)
78 * flush_kern_dcache_page(void *page)
80 * Ensure no D cache aliasing occurs, either with itself or
83 * - addr - page aligned address
85 ENTRY(v4_flush_kern_dcache_page)
89 * dma_inv_range(start, end)
91 * Invalidate (discard) the specified virtual address range.
92 * May not write back any entries. If 'start' or 'end'
93 * are not cache line aligned, those lines must be written
96 * - start - virtual start address
97 * - end - virtual end address
99 ENTRY(v4_dma_inv_range)
103 * dma_flush_range(start, end)
105 * Clean and invalidate the specified virtual address range.
107 * - start - virtual start address
108 * - end - virtual end address
110 ENTRY(v4_dma_flush_range)
112 mcr p15, 0, r0, c7, c7, 0 @ flush ID cache
116 * dma_clean_range(start, end)
118 * Clean (write back) the specified virtual address range.
120 * - start - virtual start address
121 * - end - virtual end address
123 ENTRY(v4_dma_clean_range)
128 .type v4_cache_fns, #object
130 .long v4_flush_kern_cache_all
131 .long v4_flush_user_cache_all
132 .long v4_flush_user_cache_range
133 .long v4_coherent_kern_range
134 .long v4_coherent_user_range
135 .long v4_flush_kern_dcache_page
136 .long v4_dma_inv_range
137 .long v4_dma_clean_range
138 .long v4_dma_flush_range
139 .size v4_cache_fns, . - v4_cache_fns