Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Russell King | 4baa992 | 2008-08-02 10:55:55 +0100 | [diff] [blame] | 2 | * arch/arm/include/asm/proc-fns.h |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | * |
4 | * Copyright (C) 1997-1999 Russell King | ||||
5 | * Copyright (C) 2000 Deep Blue Solutions Ltd | ||||
6 | * | ||||
7 | * This program is free software; you can redistribute it and/or modify | ||||
8 | * it under the terms of the GNU General Public License version 2 as | ||||
9 | * published by the Free Software Foundation. | ||||
10 | */ | ||||
11 | #ifndef __ASM_PROCFNS_H | ||||
12 | #define __ASM_PROCFNS_H | ||||
13 | |||||
14 | #ifdef __KERNEL__ | ||||
15 | |||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | |
17 | /* | ||||
18 | * Work out if we need multiple CPU support | ||||
19 | */ | ||||
20 | #undef MULTI_CPU | ||||
21 | #undef CPU_NAME | ||||
22 | |||||
23 | /* | ||||
24 | * CPU_NAME - the prefix for CPU related functions | ||||
25 | */ | ||||
26 | |||||
Russell King | 4da8b82 | 2009-12-18 16:06:32 +0000 | [diff] [blame] | 27 | #ifdef CONFIG_CPU_ARM610 |
28 | # ifdef CPU_NAME | ||||
29 | # undef MULTI_CPU | ||||
30 | # define MULTI_CPU | ||||
31 | # else | ||||
32 | # define CPU_NAME cpu_arm6 | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | # endif |
Russell King | 4da8b82 | 2009-12-18 16:06:32 +0000 | [diff] [blame] | 34 | #endif |
35 | |||||
36 | #ifdef CONFIG_CPU_ARM7TDMI | ||||
37 | # ifdef CPU_NAME | ||||
38 | # undef MULTI_CPU | ||||
39 | # define MULTI_CPU | ||||
40 | # else | ||||
41 | # define CPU_NAME cpu_arm7tdmi | ||||
Hyok S. Choi | 07e0da7 | 2006-09-26 17:37:36 +0900 | [diff] [blame] | 42 | # endif |
Russell King | 4da8b82 | 2009-12-18 16:06:32 +0000 | [diff] [blame] | 43 | #endif |
44 | |||||
45 | #ifdef CONFIG_CPU_ARM710 | ||||
46 | # ifdef CPU_NAME | ||||
47 | # undef MULTI_CPU | ||||
48 | # define MULTI_CPU | ||||
49 | # else | ||||
50 | # define CPU_NAME cpu_arm7 | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | # endif |
Russell King | 4da8b82 | 2009-12-18 16:06:32 +0000 | [diff] [blame] | 52 | #endif |
53 | |||||
54 | #ifdef CONFIG_CPU_ARM720T | ||||
55 | # ifdef CPU_NAME | ||||
56 | # undef MULTI_CPU | ||||
57 | # define MULTI_CPU | ||||
58 | # else | ||||
59 | # define CPU_NAME cpu_arm720 | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 60 | # endif |
Russell King | 4da8b82 | 2009-12-18 16:06:32 +0000 | [diff] [blame] | 61 | #endif |
62 | |||||
63 | #ifdef CONFIG_CPU_ARM740T | ||||
64 | # ifdef CPU_NAME | ||||
65 | # undef MULTI_CPU | ||||
66 | # define MULTI_CPU | ||||
67 | # else | ||||
68 | # define CPU_NAME cpu_arm740 | ||||
Hyok S. Choi | b731c31 | 2006-09-26 17:37:50 +0900 | [diff] [blame] | 69 | # endif |
Russell King | 4da8b82 | 2009-12-18 16:06:32 +0000 | [diff] [blame] | 70 | #endif |
71 | |||||
72 | #ifdef CONFIG_CPU_ARM9TDMI | ||||
73 | # ifdef CPU_NAME | ||||
74 | # undef MULTI_CPU | ||||
75 | # define MULTI_CPU | ||||
76 | # else | ||||
77 | # define CPU_NAME cpu_arm9tdmi | ||||
Hyok S. Choi | 43f5f01 | 2006-09-26 17:38:05 +0900 | [diff] [blame] | 78 | # endif |
Russell King | 4da8b82 | 2009-12-18 16:06:32 +0000 | [diff] [blame] | 79 | #endif |
80 | |||||
81 | #ifdef CONFIG_CPU_ARM920T | ||||
82 | # ifdef CPU_NAME | ||||
83 | # undef MULTI_CPU | ||||
84 | # define MULTI_CPU | ||||
85 | # else | ||||
86 | # define CPU_NAME cpu_arm920 | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 87 | # endif |
Russell King | 4da8b82 | 2009-12-18 16:06:32 +0000 | [diff] [blame] | 88 | #endif |
89 | |||||
90 | #ifdef CONFIG_CPU_ARM922T | ||||
91 | # ifdef CPU_NAME | ||||
92 | # undef MULTI_CPU | ||||
93 | # define MULTI_CPU | ||||
94 | # else | ||||
95 | # define CPU_NAME cpu_arm922 | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 96 | # endif |
Russell King | 4da8b82 | 2009-12-18 16:06:32 +0000 | [diff] [blame] | 97 | #endif |
98 | |||||
99 | #ifdef CONFIG_CPU_FA526 | ||||
100 | # ifdef CPU_NAME | ||||
101 | # undef MULTI_CPU | ||||
102 | # define MULTI_CPU | ||||
103 | # else | ||||
104 | # define CPU_NAME cpu_fa526 | ||||
Paulius Zaleckas | 28853ac | 2009-03-25 13:10:01 +0200 | [diff] [blame] | 105 | # endif |
Russell King | 4da8b82 | 2009-12-18 16:06:32 +0000 | [diff] [blame] | 106 | #endif |
107 | |||||
108 | #ifdef CONFIG_CPU_ARM925T | ||||
109 | # ifdef CPU_NAME | ||||
110 | # undef MULTI_CPU | ||||
111 | # define MULTI_CPU | ||||
112 | # else | ||||
113 | # define CPU_NAME cpu_arm925 | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 114 | # endif |
Russell King | 4da8b82 | 2009-12-18 16:06:32 +0000 | [diff] [blame] | 115 | #endif |
116 | |||||
117 | #ifdef CONFIG_CPU_ARM926T | ||||
118 | # ifdef CPU_NAME | ||||
119 | # undef MULTI_CPU | ||||
120 | # define MULTI_CPU | ||||
121 | # else | ||||
122 | # define CPU_NAME cpu_arm926 | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 123 | # endif |
Russell King | 4da8b82 | 2009-12-18 16:06:32 +0000 | [diff] [blame] | 124 | #endif |
125 | |||||
126 | #ifdef CONFIG_CPU_ARM940T | ||||
127 | # ifdef CPU_NAME | ||||
128 | # undef MULTI_CPU | ||||
129 | # define MULTI_CPU | ||||
130 | # else | ||||
131 | # define CPU_NAME cpu_arm940 | ||||
Hyok S. Choi | d60674e | 2006-09-26 17:38:18 +0900 | [diff] [blame] | 132 | # endif |
Russell King | 4da8b82 | 2009-12-18 16:06:32 +0000 | [diff] [blame] | 133 | #endif |
134 | |||||
135 | #ifdef CONFIG_CPU_ARM946E | ||||
136 | # ifdef CPU_NAME | ||||
137 | # undef MULTI_CPU | ||||
138 | # define MULTI_CPU | ||||
139 | # else | ||||
140 | # define CPU_NAME cpu_arm946 | ||||
Hyok S. Choi | f37f46e | 2006-09-26 17:38:32 +0900 | [diff] [blame] | 141 | # endif |
Russell King | 4da8b82 | 2009-12-18 16:06:32 +0000 | [diff] [blame] | 142 | #endif |
143 | |||||
144 | #ifdef CONFIG_CPU_SA110 | ||||
145 | # ifdef CPU_NAME | ||||
146 | # undef MULTI_CPU | ||||
147 | # define MULTI_CPU | ||||
148 | # else | ||||
149 | # define CPU_NAME cpu_sa110 | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 150 | # endif |
Russell King | 4da8b82 | 2009-12-18 16:06:32 +0000 | [diff] [blame] | 151 | #endif |
152 | |||||
153 | #ifdef CONFIG_CPU_SA1100 | ||||
154 | # ifdef CPU_NAME | ||||
155 | # undef MULTI_CPU | ||||
156 | # define MULTI_CPU | ||||
157 | # else | ||||
158 | # define CPU_NAME cpu_sa1100 | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 159 | # endif |
Russell King | 4da8b82 | 2009-12-18 16:06:32 +0000 | [diff] [blame] | 160 | #endif |
161 | |||||
162 | #ifdef CONFIG_CPU_ARM1020 | ||||
163 | # ifdef CPU_NAME | ||||
164 | # undef MULTI_CPU | ||||
165 | # define MULTI_CPU | ||||
166 | # else | ||||
167 | # define CPU_NAME cpu_arm1020 | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 168 | # endif |
Russell King | 4da8b82 | 2009-12-18 16:06:32 +0000 | [diff] [blame] | 169 | #endif |
170 | |||||
171 | #ifdef CONFIG_CPU_ARM1020E | ||||
172 | # ifdef CPU_NAME | ||||
173 | # undef MULTI_CPU | ||||
174 | # define MULTI_CPU | ||||
175 | # else | ||||
176 | # define CPU_NAME cpu_arm1020e | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 177 | # endif |
Russell King | 4da8b82 | 2009-12-18 16:06:32 +0000 | [diff] [blame] | 178 | #endif |
179 | |||||
180 | #ifdef CONFIG_CPU_ARM1022 | ||||
181 | # ifdef CPU_NAME | ||||
182 | # undef MULTI_CPU | ||||
183 | # define MULTI_CPU | ||||
184 | # else | ||||
185 | # define CPU_NAME cpu_arm1022 | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 186 | # endif |
Russell King | 4da8b82 | 2009-12-18 16:06:32 +0000 | [diff] [blame] | 187 | #endif |
188 | |||||
189 | #ifdef CONFIG_CPU_ARM1026 | ||||
190 | # ifdef CPU_NAME | ||||
191 | # undef MULTI_CPU | ||||
192 | # define MULTI_CPU | ||||
193 | # else | ||||
194 | # define CPU_NAME cpu_arm1026 | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 195 | # endif |
Russell King | 4da8b82 | 2009-12-18 16:06:32 +0000 | [diff] [blame] | 196 | #endif |
197 | |||||
198 | #ifdef CONFIG_CPU_XSCALE | ||||
199 | # ifdef CPU_NAME | ||||
200 | # undef MULTI_CPU | ||||
201 | # define MULTI_CPU | ||||
202 | # else | ||||
203 | # define CPU_NAME cpu_xscale | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 204 | # endif |
Russell King | 4da8b82 | 2009-12-18 16:06:32 +0000 | [diff] [blame] | 205 | #endif |
206 | |||||
207 | #ifdef CONFIG_CPU_XSC3 | ||||
208 | # ifdef CPU_NAME | ||||
209 | # undef MULTI_CPU | ||||
210 | # define MULTI_CPU | ||||
211 | # else | ||||
212 | # define CPU_NAME cpu_xsc3 | ||||
Lennert Buytenhek | 23bdf86 | 2006-03-28 21:00:40 +0100 | [diff] [blame] | 213 | # endif |
Russell King | 4da8b82 | 2009-12-18 16:06:32 +0000 | [diff] [blame] | 214 | #endif |
215 | |||||
216 | #ifdef CONFIG_CPU_MOHAWK | ||||
217 | # ifdef CPU_NAME | ||||
218 | # undef MULTI_CPU | ||||
219 | # define MULTI_CPU | ||||
220 | # else | ||||
221 | # define CPU_NAME cpu_mohawk | ||||
Eric Miao | 49cbe78 | 2009-01-20 14:15:18 +0800 | [diff] [blame] | 222 | # endif |
Russell King | 4da8b82 | 2009-12-18 16:06:32 +0000 | [diff] [blame] | 223 | #endif |
224 | |||||
225 | #ifdef CONFIG_CPU_FEROCEON | ||||
226 | # ifdef CPU_NAME | ||||
227 | # undef MULTI_CPU | ||||
228 | # define MULTI_CPU | ||||
229 | # else | ||||
230 | # define CPU_NAME cpu_feroceon | ||||
Assaf Hoffman | e50d640 | 2007-10-23 15:14:41 -0400 | [diff] [blame] | 231 | # endif |
Russell King | 4da8b82 | 2009-12-18 16:06:32 +0000 | [diff] [blame] | 232 | #endif |
233 | |||||
234 | #ifdef CONFIG_CPU_V6 | ||||
235 | # ifdef CPU_NAME | ||||
236 | # undef MULTI_CPU | ||||
237 | # define MULTI_CPU | ||||
238 | # else | ||||
239 | # define CPU_NAME cpu_v6 | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 240 | # endif |
Russell King | 4da8b82 | 2009-12-18 16:06:32 +0000 | [diff] [blame] | 241 | #endif |
242 | |||||
243 | #ifdef CONFIG_CPU_V7 | ||||
244 | # ifdef CPU_NAME | ||||
245 | # undef MULTI_CPU | ||||
246 | # define MULTI_CPU | ||||
247 | # else | ||||
248 | # define CPU_NAME cpu_v7 | ||||
Catalin Marinas | bbe8888 | 2007-05-08 22:27:46 +0100 | [diff] [blame] | 249 | # endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 250 | #endif |
251 | |||||
252 | #ifndef __ASSEMBLY__ | ||||
253 | |||||
254 | #ifndef MULTI_CPU | ||||
Joe Perches | 10debfd | 2008-03-05 08:44:13 -0800 | [diff] [blame] | 255 | #include <asm/cpu-single.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 256 | #else |
Joe Perches | 10debfd | 2008-03-05 08:44:13 -0800 | [diff] [blame] | 257 | #include <asm/cpu-multi32.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 258 | #endif |
259 | |||||
260 | #include <asm/memory.h> | ||||
261 | |||||
Russell King | 002547b | 2006-06-20 20:46:52 +0100 | [diff] [blame] | 262 | #ifdef CONFIG_MMU |
263 | |||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 264 | #define cpu_switch_mm(pgd,mm) cpu_do_switch_mm(virt_to_phys(pgd),mm) |
265 | |||||
266 | #define cpu_get_pgd() \ | ||||
267 | ({ \ | ||||
268 | unsigned long pg; \ | ||||
269 | __asm__("mrc p15, 0, %0, c2, c0, 0" \ | ||||
270 | : "=r" (pg) : : "cc"); \ | ||||
271 | pg &= ~0x3fff; \ | ||||
272 | (pgd_t *)phys_to_virt(pg); \ | ||||
273 | }) | ||||
274 | |||||
Russell King | 002547b | 2006-06-20 20:46:52 +0100 | [diff] [blame] | 275 | #endif |
276 | |||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 277 | #endif /* __ASSEMBLY__ */ |
278 | #endif /* __KERNEL__ */ | ||||
279 | #endif /* __ASM_PROCFNS_H */ |