Merge with 2.3.99-pre1.
[linux-2.6/linux-mips.git] / include / asm-arm / system.h
bloba4311733067e8b67d3adea07015a2a60571db621
1 #ifndef __ASM_ARM_SYSTEM_H
2 #define __ASM_ARM_SYSTEM_H
4 #include <linux/kernel.h>
6 #ifdef __KERNEL__
8 #include <linux/config.h>
10 /* information about the system we're running on */
11 extern unsigned int system_rev;
12 extern unsigned int system_serial_low;
13 extern unsigned int system_serial_high;
15 /* The type of machine we're running on */
16 extern unsigned int __machine_arch_type;
18 /* see arch/arm/kernel/setup.c for a description of these */
19 #define MACH_TYPE_EBSA110 0
20 #define MACH_TYPE_RISCPC 1
21 #define MACH_TYPE_NEXUSPCI 3
22 #define MACH_TYPE_EBSA285 4
23 #define MACH_TYPE_NETWINDER 5
24 #define MACH_TYPE_CATS 6
25 #define MACH_TYPE_TBOX 7
26 #define MACH_TYPE_CO285 8
27 #define MACH_TYPE_CLPS7110 9
28 #define MACH_TYPE_ARCHIMEDES 10
29 #define MACH_TYPE_A5K 11
30 #define MACH_TYPE_ETOILE 12
31 #define MACH_TYPE_LACIE_NAS 13
32 #define MACH_TYPE_CLPS7500 14
33 #define MACH_TYPE_SHARK 15
34 #define MACH_TYPE_SA1100 16
35 #define MACH_TYPE_PERSONAL_SERVER 17
38 * Sort out a definition for machine_arch_type
39 * The rules are:
40 * 1. If one architecture is selected, then all machine_is_xxx()
41 * are constant.
42 * 2. If two or more architectures are selected, then the selected
43 * machine_is_xxx() are variable, and the unselected machine_is_xxx()
44 * are constant zero.
46 * In general, you should use machine_is_xxxx() in your code, not:
47 * - switch (machine_arch_type) { }
48 * - if (machine_arch_type = xxxx)
49 * - __machine_arch_type
51 #ifdef CONFIG_ARCH_EBSA110
52 # ifdef machine_arch_type
53 # undef machine_arch_type
54 # define machine_arch_type __machine_arch_type
55 # else
56 # define machine_arch_type MACH_TYPE_EBSA110
57 # endif
58 # define machine_is_ebsa110() (machine_arch_type == MACH_TYPE_EBSA110)
59 #else
60 # define machine_is_ebsa110() (0)
61 #endif
63 #ifdef CONFIG_ARCH_RPC
64 # ifdef machine_arch_type
65 # undef machine_arch_type
66 # define machine_arch_type __machine_arch_type
67 # else
68 # define machine_arch_type MACH_TYPE_RISCPC
69 # endif
70 # define machine_is_riscpc() (machine_arch_type == MACH_TYPE_RISCPC)
71 #else
72 # define machine_is_riscpc() (0)
73 #endif
75 #ifdef CONFIG_ARCH_EBSA285
76 # ifdef machine_arch_type
77 # undef machine_arch_type
78 # define machine_arch_type __machine_arch_type
79 # else
80 # define machine_arch_type MACH_TYPE_EBSA285
81 # endif
82 # define machine_is_ebsa285() (machine_arch_type == MACH_TYPE_EBSA285)
83 #else
84 # define machine_is_ebsa285() (0)
85 #endif
87 #ifdef CONFIG_ARCH_NETWINDER
88 # ifdef machine_arch_type
89 # undef machine_arch_type
90 # define machine_arch_type __machine_arch_type
91 # else
92 # define machine_arch_type MACH_TYPE_NETWINDER
93 # endif
94 # define machine_is_netwinder() (machine_arch_type == MACH_TYPE_NETWINDER)
95 #else
96 # define machine_is_netwinder() (0)
97 #endif
99 #ifdef CONFIG_CATS
100 # ifdef machine_arch_type
101 # undef machine_arch_type
102 # define machine_arch_type __machine_arch_type
103 # else
104 # define machine_arch_type MACH_TYPE_CATS
105 # endif
106 # define machine_is_cats() (machine_arch_type == MACH_TYPE_CATS)
107 #else
108 # define machine_is_cats() (0)
109 #endif
111 #ifdef CONFIG_ARCH_CO285
112 # ifdef machine_arch_type
113 # undef machine_arch_type
114 # define machine_arch_type __machine_arch_type
115 # else
116 # define machine_arch_type MACH_TYPE_CO285
117 # endif
118 # define machine_is_co285() (machine_arch_type == MACH_TYPE_CO285)
119 #else
120 # define machine_is_co285() (0)
121 #endif
123 #ifdef CONFIG_ARCH_ARC
124 # ifdef machine_arch_type
125 # undef machine_arch_type
126 # define machine_arch_type __machine_arch_type
127 # else
128 # define machine_arch_type MACH_TYPE_ARCHIMEDES
129 # endif
130 # define machine_is_arc() (machine_arch_type == MACH_TYPE_ARCHIMEDES)
131 #else
132 # define machine_is_arc() (0)
133 #endif
135 #ifdef CONFIG_ARCH_A5K
136 # ifdef machine_arch_type
137 # undef machine_arch_type
138 # define machine_arch_type __machine_arch_type
139 # else
140 # define machine_arch_type MACH_TYPE_A5K
141 # endif
142 # define machine_is_a5k() (machine_arch_type == MACH_TYPE_A5K)
143 #else
144 # define machine_is_a5k() (0)
145 #endif
147 #ifdef CONFIG_ARCH_CLPS7500
148 # ifdef machine_arch_type
149 # undef machine_arch_type
150 # define machine_arch_type __machine_arch_type
151 # else
152 # define machine_arch_type MACH_TYPE_CLPS7500
153 # endif
154 # define machine_is_clps7500() (machine_arch_type == MACH_TYPE_CLPS7500)
155 #else
156 # define machine_is_clps7500() (0)
157 #endif
159 #ifdef CONFIG_ARCH_SHARK
160 # ifdef machine_arch_type
161 # undef machine_arch_type
162 # define machine_arch_type __machine_arch_type
163 # else
164 # define machine_arch_type MACH_TYPE_SHARK
165 # endif
166 # define machine_is_shark() (machine_arch_type == MACH_TYPE_SHARK)
167 #else
168 # define machine_is_shark() (0)
169 #endif
171 #ifdef CONFIG_ARCH_SA1100
172 # ifdef machine_arch_type
173 # undef machine_arch_type
174 # define machine_arch_type __machine_arch_type
175 # else
176 # define machine_arch_type MACH_TYPE_SA1100
177 # endif
178 # define machine_is_sa1100() (machine_arch_type == MACH_TYPE_SA1100)
179 #else
180 # define machine_is_sa1100() (0)
181 #endif
183 #ifdef CONFIG_PERSONAL_SERVER
184 # ifdef machine_arch_type
185 # undef machine_arch_type
186 # define machine_arch_type __machine_arch_type
187 # else
188 # define machine_arch_type MACH_TYPE_PERSONAL_SERVER
189 # endif
190 # define machine_is_personal_server() (machine_arch_type == MACH_TYPE_PERSONAL_SERVER)
191 #else
192 # define machine_is_personal_server() (0)
193 #endif
195 #ifndef machine_arch_type
196 #define machine_arch_type __machine_arch_type
197 #endif
199 #include <asm/proc-fns.h>
201 #define xchg(ptr,x) \
202 ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
204 #define tas(ptr) (xchg((ptr),1))
206 extern void arm_malalignedptr(const char *, void *, volatile void *);
207 extern asmlinkage void __backtrace(void);
210 * Include processor dependent parts
212 #include <asm/proc/system.h>
214 #define mb() __asm__ __volatile__ ("" : : : "memory")
215 #define rmb() mb()
216 #define wmb() mb()
217 #define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t");
219 #define prepare_to_switch() do { } while(0)
222 * switch_to(prev, next) should switch from task `prev' to `next'
223 * `prev' will never be the same as `next'.
224 * The `mb' is to tell GCC not to cache `current' across this call.
226 extern struct task_struct *__switch_to(struct task_struct *prev, struct task_struct *next);
228 #define switch_to(prev,next,last) \
229 do { \
230 last = __switch_to(prev,next); \
231 mb(); \
232 } while (0)
234 #endif
236 #endif