blob: 3976412685f8c2b43280fffb926a78da9a00688f [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Russell King4baa9922008-08-02 10:55:55 +01002 * arch/arm/include/asm/proc-fns.h
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 *
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 Torvalds1da177e2005-04-16 15:20:36 -070016
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
27#ifdef CONFIG_CPU_32
28# ifdef CONFIG_CPU_ARM610
29# ifdef CPU_NAME
30# undef MULTI_CPU
31# define MULTI_CPU
32# else
33# define CPU_NAME cpu_arm6
34# endif
35# endif
Hyok S. Choi07e0da72006-09-26 17:37:36 +090036# ifdef CONFIG_CPU_ARM7TDMI
37# ifdef CPU_NAME
38# undef MULTI_CPU
39# define MULTI_CPU
40# else
41# define CPU_NAME cpu_arm7tdmi
42# endif
43# endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070044# ifdef CONFIG_CPU_ARM710
45# ifdef CPU_NAME
46# undef MULTI_CPU
47# define MULTI_CPU
48# else
49# define CPU_NAME cpu_arm7
50# endif
51# endif
52# ifdef CONFIG_CPU_ARM720T
53# ifdef CPU_NAME
54# undef MULTI_CPU
55# define MULTI_CPU
56# else
57# define CPU_NAME cpu_arm720
58# endif
59# endif
Hyok S. Choib731c312006-09-26 17:37:50 +090060# ifdef CONFIG_CPU_ARM740T
61# ifdef CPU_NAME
62# undef MULTI_CPU
63# define MULTI_CPU
64# else
65# define CPU_NAME cpu_arm740
66# endif
67# endif
Hyok S. Choi43f5f012006-09-26 17:38:05 +090068# ifdef CONFIG_CPU_ARM9TDMI
69# ifdef CPU_NAME
70# undef MULTI_CPU
71# define MULTI_CPU
72# else
73# define CPU_NAME cpu_arm9tdmi
74# endif
75# endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070076# ifdef CONFIG_CPU_ARM920T
77# ifdef CPU_NAME
78# undef MULTI_CPU
79# define MULTI_CPU
80# else
81# define CPU_NAME cpu_arm920
82# endif
83# endif
84# ifdef CONFIG_CPU_ARM922T
85# ifdef CPU_NAME
86# undef MULTI_CPU
87# define MULTI_CPU
88# else
89# define CPU_NAME cpu_arm922
90# endif
91# endif
Paulius Zaleckas28853ac2009-03-25 13:10:01 +020092# ifdef CONFIG_CPU_FA526
93# ifdef CPU_NAME
94# undef MULTI_CPU
95# define MULTI_CPU
96# else
97# define CPU_NAME cpu_fa526
98# endif
99# endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100# ifdef CONFIG_CPU_ARM925T
101# ifdef CPU_NAME
102# undef MULTI_CPU
103# define MULTI_CPU
104# else
105# define CPU_NAME cpu_arm925
106# endif
107# endif
108# ifdef CONFIG_CPU_ARM926T
109# ifdef CPU_NAME
110# undef MULTI_CPU
111# define MULTI_CPU
112# else
113# define CPU_NAME cpu_arm926
114# endif
115# endif
Hyok S. Choid60674e2006-09-26 17:38:18 +0900116# ifdef CONFIG_CPU_ARM940T
117# ifdef CPU_NAME
118# undef MULTI_CPU
119# define MULTI_CPU
120# else
121# define CPU_NAME cpu_arm940
122# endif
123# endif
Hyok S. Choif37f46e2006-09-26 17:38:32 +0900124# ifdef CONFIG_CPU_ARM946E
125# ifdef CPU_NAME
126# undef MULTI_CPU
127# define MULTI_CPU
128# else
129# define CPU_NAME cpu_arm946
130# endif
131# endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700132# ifdef CONFIG_CPU_SA110
133# ifdef CPU_NAME
134# undef MULTI_CPU
135# define MULTI_CPU
136# else
137# define CPU_NAME cpu_sa110
138# endif
139# endif
140# ifdef CONFIG_CPU_SA1100
141# ifdef CPU_NAME
142# undef MULTI_CPU
143# define MULTI_CPU
144# else
145# define CPU_NAME cpu_sa1100
146# endif
147# endif
148# ifdef CONFIG_CPU_ARM1020
149# ifdef CPU_NAME
150# undef MULTI_CPU
151# define MULTI_CPU
152# else
153# define CPU_NAME cpu_arm1020
154# endif
155# endif
156# ifdef CONFIG_CPU_ARM1020E
157# ifdef CPU_NAME
158# undef MULTI_CPU
159# define MULTI_CPU
160# else
161# define CPU_NAME cpu_arm1020e
162# endif
163# endif
164# ifdef CONFIG_CPU_ARM1022
165# ifdef CPU_NAME
166# undef MULTI_CPU
167# define MULTI_CPU
168# else
169# define CPU_NAME cpu_arm1022
170# endif
171# endif
172# ifdef CONFIG_CPU_ARM1026
173# ifdef CPU_NAME
174# undef MULTI_CPU
175# define MULTI_CPU
176# else
177# define CPU_NAME cpu_arm1026
178# endif
179# endif
180# ifdef CONFIG_CPU_XSCALE
181# ifdef CPU_NAME
182# undef MULTI_CPU
183# define MULTI_CPU
184# else
185# define CPU_NAME cpu_xscale
186# endif
187# endif
Lennert Buytenhek23bdf862006-03-28 21:00:40 +0100188# ifdef CONFIG_CPU_XSC3
189# ifdef CPU_NAME
190# undef MULTI_CPU
191# define MULTI_CPU
192# else
193# define CPU_NAME cpu_xsc3
194# endif
195# endif
Eric Miao49cbe782009-01-20 14:15:18 +0800196# ifdef CONFIG_CPU_MOHAWK
197# ifdef CPU_NAME
198# undef MULTI_CPU
199# define MULTI_CPU
200# else
201# define CPU_NAME cpu_mohawk
202# endif
203# endif
Assaf Hoffmane50d6402007-10-23 15:14:41 -0400204# ifdef CONFIG_CPU_FEROCEON
205# ifdef CPU_NAME
206# undef MULTI_CPU
207# define MULTI_CPU
208# else
209# define CPU_NAME cpu_feroceon
210# endif
211# endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700212# ifdef CONFIG_CPU_V6
213# ifdef CPU_NAME
214# undef MULTI_CPU
215# define MULTI_CPU
216# else
217# define CPU_NAME cpu_v6
218# endif
219# endif
Catalin Marinasbbe88882007-05-08 22:27:46 +0100220# ifdef CONFIG_CPU_V7
221# ifdef CPU_NAME
222# undef MULTI_CPU
223# define MULTI_CPU
224# else
225# define CPU_NAME cpu_v7
226# endif
227# endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700228#endif
229
230#ifndef __ASSEMBLY__
231
232#ifndef MULTI_CPU
Joe Perches10debfd2008-03-05 08:44:13 -0800233#include <asm/cpu-single.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -0700234#else
Joe Perches10debfd2008-03-05 08:44:13 -0800235#include <asm/cpu-multi32.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -0700236#endif
237
238#include <asm/memory.h>
239
Russell King002547b2006-06-20 20:46:52 +0100240#ifdef CONFIG_MMU
241
Linus Torvalds1da177e2005-04-16 15:20:36 -0700242#define cpu_switch_mm(pgd,mm) cpu_do_switch_mm(virt_to_phys(pgd),mm)
243
244#define cpu_get_pgd() \
245 ({ \
246 unsigned long pg; \
247 __asm__("mrc p15, 0, %0, c2, c0, 0" \
248 : "=r" (pg) : : "cc"); \
249 pg &= ~0x3fff; \
250 (pgd_t *)phys_to_virt(pg); \
251 })
252
Russell King002547b2006-06-20 20:46:52 +0100253#endif
254
Linus Torvalds1da177e2005-04-16 15:20:36 -0700255#endif /* __ASSEMBLY__ */
256#endif /* __KERNEL__ */
257#endif /* __ASM_PROCFNS_H */