http://downloads.netgear.com/files/GPL/GPL_Source_V361j_DM111PSP_series_consumer_rele...
[bcm963xx.git] / kernel / linux / arch / arm / mm / cache-v4.S
1 /*
2  *  linux/arch/arm/mm/cache-v4.S
3  *
4  *  Copyright (C) 1997-2002 Russell king
5  *
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.
9  */
10 #include <linux/linkage.h>
11 #include <linux/init.h>
12 #include <asm/hardware.h>
13 #include <asm/page.h>
14 #include "proc-macros.S"
15
16 /*
17  *      flush_user_cache_all()
18  *
19  *      Invalidate all cache entries in a particular address
20  *      space.
21  *
22  *      - mm    - mm_struct describing address space
23  */
24 ENTRY(v4_flush_user_cache_all)
25         /* FALLTHROUGH */
26 /*
27  *      flush_kern_cache_all()
28  *
29  *      Clean and invalidate the entire cache.
30  */
31 ENTRY(v4_flush_kern_cache_all)
32         mov     r0, #0
33         mcr     p15, 0, r0, c7, c7, 0           @ flush ID cache
34         mov     pc, lr
35
36 /*
37  *      flush_user_cache_range(start, end, flags)
38  *
39  *      Invalidate a range of cache entries in the specified
40  *      address space.
41  *
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
45  */
46 ENTRY(v4_flush_user_cache_range)
47         mov     ip, #0
48         mcreq   p15, 0, ip, c7, c7, 0           @ flush ID cache
49         mov     pc, lr
50
51 /*
52  *      coherent_kern_range(start, end)
53  *
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.
57  *
58  *      - start  - virtual start address
59  *      - end    - virtual end address
60  */
61 ENTRY(v4_coherent_kern_range)
62         mov     pc, lr
63
64 /*
65  *      flush_kern_dcache_page(void *page)
66  *
67  *      Ensure no D cache aliasing occurs, either with itself or
68  *      the I cache
69  *
70  *      - addr  - page aligned address
71  */
72 ENTRY(v4_flush_kern_dcache_page)
73         /* FALLTHROUGH */
74
75 /*
76  *      dma_inv_range(start, end)
77  *
78  *      Invalidate (discard) the specified virtual address range.
79  *      May not write back any entries.  If 'start' or 'end'
80  *      are not cache line aligned, those lines must be written
81  *      back.
82  *
83  *      - start  - virtual start address
84  *      - end    - virtual end address
85  */
86 ENTRY(v4_dma_inv_range)
87         /* FALLTHROUGH */
88
89 /*
90  *      dma_flush_range(start, end)
91  *
92  *      Clean and invalidate the specified virtual address range.
93  *
94  *      - start  - virtual start address
95  *      - end    - virtual end address
96  */
97 ENTRY(v4_dma_flush_range)
98         mov     r0, #0
99         mcr     p15, 0, r0, c7, c7, 0           @ flush ID cache
100         /* FALLTHROUGH */
101
102 /*
103  *      dma_clean_range(start, end)
104  *
105  *      Clean (write back) the specified virtual address range.
106  *
107  *      - start  - virtual start address
108  *      - end    - virtual end address
109  */
110 ENTRY(v4_dma_clean_range)
111         mov     pc, lr
112
113         __INITDATA
114
115         .type   v4_cache_fns, #object
116 ENTRY(v4_cache_fns)
117         .long   v4_flush_kern_cache_all
118         .long   v4_flush_user_cache_all
119         .long   v4_flush_user_cache_range
120         .long   v4_coherent_kern_range
121         .long   v4_flush_kern_dcache_page
122         .long   v4_dma_inv_range
123         .long   v4_dma_clean_range
124         .long   v4_dma_flush_range
125         .size   v4_cache_fns, . - v4_cache_fns