FreeBSD/Linux Kernel Cross Reference
sys/mach/machine.h
1 /*
2 * Mach Operating System
3 * Copyright (c) 1993,1992,1991,1990,1989,1988,1987 Carnegie Mellon University
4 * All Rights Reserved.
5 *
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the
9 * software, derivative works or modified versions, and any portions
10 * thereof, and that both notices appear in supporting documentation.
11 *
12 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 *
16 * Carnegie Mellon requests users of this software to return to
17 *
18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
22 *
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
25 */
26 /*
27 * HISTORY
28 * $Log: machine.h,v $
29 * Revision 2.18 93/11/17 17:42:03 dbg
30 * Moved kernel variables to kern/machine.h.
31 * [93/11/03 dbg]
32 *
33 * Revision 2.17 93/02/04 07:49:46 danner
34 * PS2 support.
35 * [93/01/18 prithvi]
36 *
37 * Revision 2.16 93/01/14 17:44:40 danner
38 * Cleanup.
39 * [92/06/10 pds]
40 * Added Alpha architecture, and some initial machine types.
41 * [92/06/06 af]
42 *
43 * Revision 2.15 92/08/03 17:18:04 jfriedl
44 * Added pc532.
45 * [92/05/15 jvh]
46 *
47 * Revision 2.14 92/02/19 15:08:38 elf
48 * Added more Sparc subtypes.
49 * [92/02/19 rpd]
50 *
51 * Revision 2.13 91/12/10 16:32:50 jsb
52 * Fixes from Intel
53 * [91/12/10 15:51:57 jsb]
54 *
55 * Revision 2.12 91/07/31 17:53:56 dbg
56 * Remove declaration of interrupt_stack - it is machine-dependent.
57 * Changed CPU_SUBTYPE_LUNA88K - there's already a (potential)
58 * mc88000 port.
59 * [91/07/26 dbg]
60 *
61 * Revision 2.11 91/07/09 23:22:06 danner
62 * Added CPU_SUBTYPE_LUNA88K
63 * [91/05/06 danner]
64 *
65 * Revision 2.10 91/05/14 16:55:24 mrt
66 * Correcting copyright
67 *
68 * Revision 2.9 91/05/08 12:49:54 dbg
69 * Add CPU_SUBTYPE_SYMMETRY.
70 * [91/04/26 14:44:44 dbg]
71 *
72 * Revision 2.8 91/02/05 17:33:48 mrt
73 * Changed to new Mach copyright
74 * [91/02/01 17:18:51 mrt]
75 *
76 * Revision 2.7 90/12/04 14:51:27 jsb
77 * Renamed CPU_SUBTYPE_iPSC2 as CPU_SUBTYPE_iPSC386.
78 * [90/12/03 22:22:25 jsb]
79 *
80 * Revision 2.6 90/11/25 17:48:28 jsb
81 * Added CPU_TYPE_I860 and CPU_SUBTYPE_iPSC860.
82 * [90/11/25 16:51:44 jsb]
83 *
84 * Revision 2.5 90/09/23 17:45:42 jsb
85 * Added CPU_SUBTYPE_iPSC2.
86 * [90/09/21 16:43:01 jsb]
87 *
88 * Revision 2.4 90/08/07 22:23:05 rpd
89 * Added new MIPS subtypes for R3000, fix old defs.
90 * [90/08/07 15:54:40 af]
91 *
92 * Revision 2.3 90/06/02 14:58:47 rpd
93 * Picked up new cpu types.
94 * [90/03/26 22:34:38 rpd]
95 *
96 * Revision 2.2 89/11/29 14:09:32 af
97 * Changes for MACH_KERNEL:
98 * . Removed should_exit.
99 *
100 * 17-May-1989 Randall W. Dean (rwd)
101 * changed machine/vm_types.h to mach/vm_param.h
102 * [89/05/23 dbg]
103 *
104 * Revision 2.1 89/08/03 16:02:33 rwd
105 * Created.
106 *
107 * Revision 2.11 89/04/18 16:43:32 mwyoung
108 * Use <machine/vm_types.h> rather than <vm/vm_param.h> to get
109 * VM types. Remove old history... none of it was insightful.
110 *
111 * The variable declarations should be moved elsewhere.
112 * [89/01/24 mwyoung]
113 *
114 */
115 /* File: machine.h
116 * Author: Avadis Tevanian, Jr.
117 * Date: 1986
118 *
119 * Machine independent machine abstraction.
120 */
121
122 #ifndef _MACH_MACHINE_H_
123 #define _MACH_MACHINE_H_
124
125 #include <mach/machine/vm_types.h>
126 #include <mach/boolean.h>
127
128 /*
129 * For each host, there is a maximum possible number of
130 * cpus that may be available in the system. This is the
131 * compile-time constant NCPUS, which is defined in cpus.h.
132 *
133 * In addition, there is a machine_slot specifier for each
134 * possible cpu in the system.
135 */
136
137 struct machine_info {
138 integer_t major_version; /* kernel major version id */
139 integer_t minor_version; /* kernel minor version id */
140 integer_t max_cpus; /* max number of cpus compiled */
141 integer_t avail_cpus; /* number actually available */
142 vm_size_t memory_size; /* size of memory in bytes */
143 };
144
145 typedef struct machine_info *machine_info_t;
146 typedef struct machine_info machine_info_data_t; /* bogus */
147
148 typedef integer_t cpu_type_t;
149 typedef integer_t cpu_subtype_t;
150
151 #define CPU_STATE_MAX 3
152
153 #define CPU_STATE_USER 0
154 #define CPU_STATE_SYSTEM 1
155 #define CPU_STATE_IDLE 2
156
157 struct machine_slot {
158 /*boolean_t*/integer_t is_cpu; /* is there a cpu in this slot? */
159 cpu_type_t cpu_type; /* type of cpu */
160 cpu_subtype_t cpu_subtype; /* subtype of cpu */
161 /*boolean_t*/integer_t running; /* is cpu running */
162 integer_t cpu_ticks[CPU_STATE_MAX];
163 integer_t clock_freq; /* clock interrupt frequency */
164 };
165
166 typedef struct machine_slot *machine_slot_t;
167 typedef struct machine_slot machine_slot_data_t; /* bogus */
168
169 /*
170 * Machine types known by all.
171 *
172 * When adding new types & subtypes, please also update slot_name.c
173 * in the libmach sources.
174 */
175
176 #define CPU_TYPE_VAX ((cpu_type_t) 1)
177 #define CPU_TYPE_ROMP ((cpu_type_t) 2)
178 #define CPU_TYPE_MC68020 ((cpu_type_t) 3)
179 #define CPU_TYPE_NS32032 ((cpu_type_t) 4)
180 #define CPU_TYPE_NS32332 ((cpu_type_t) 5)
181 #define CPU_TYPE_NS32532 ((cpu_type_t) 6)
182 #define CPU_TYPE_I386 ((cpu_type_t) 7)
183 #define CPU_TYPE_MIPS ((cpu_type_t) 8)
184 #define CPU_TYPE_MC68030 ((cpu_type_t) 9)
185 #define CPU_TYPE_MC68040 ((cpu_type_t) 10)
186 #define CPU_TYPE_HPPA ((cpu_type_t) 11)
187 #define CPU_TYPE_ARM ((cpu_type_t) 12)
188 #define CPU_TYPE_MC88000 ((cpu_type_t) 13)
189 #define CPU_TYPE_SPARC ((cpu_type_t) 14)
190 #define CPU_TYPE_I860 ((cpu_type_t) 15)
191 #define CPU_TYPE_ALPHA ((cpu_type_t) 16)
192
193 /*
194 * Machine subtypes (these are defined here, instead of in a machine
195 * dependent directory, so that any program can get all definitions
196 * regardless of where is it compiled).
197 */
198
199 /*
200 * VAX subtypes (these do *not* necessarily conform to the actual cpu
201 * ID assigned by DEC available via the SID register).
202 */
203
204 #define CPU_SUBTYPE_VAX780 ((cpu_subtype_t) 1)
205 #define CPU_SUBTYPE_VAX785 ((cpu_subtype_t) 2)
206 #define CPU_SUBTYPE_VAX750 ((cpu_subtype_t) 3)
207 #define CPU_SUBTYPE_VAX730 ((cpu_subtype_t) 4)
208 #define CPU_SUBTYPE_UVAXI ((cpu_subtype_t) 5)
209 #define CPU_SUBTYPE_UVAXII ((cpu_subtype_t) 6)
210 #define CPU_SUBTYPE_VAX8200 ((cpu_subtype_t) 7)
211 #define CPU_SUBTYPE_VAX8500 ((cpu_subtype_t) 8)
212 #define CPU_SUBTYPE_VAX8600 ((cpu_subtype_t) 9)
213 #define CPU_SUBTYPE_VAX8650 ((cpu_subtype_t) 10)
214 #define CPU_SUBTYPE_VAX8800 ((cpu_subtype_t) 11)
215 #define CPU_SUBTYPE_UVAXIII ((cpu_subtype_t) 12)
216
217 /*
218 * ROMP subtypes.
219 */
220
221 #define CPU_SUBTYPE_RT_PC ((cpu_subtype_t) 1)
222 #define CPU_SUBTYPE_RT_APC ((cpu_subtype_t) 2)
223 #define CPU_SUBTYPE_RT_135 ((cpu_subtype_t) 3)
224
225 /*
226 * 68020 subtypes.
227 */
228
229 #define CPU_SUBTYPE_SUN3_50 ((cpu_subtype_t) 1)
230 #define CPU_SUBTYPE_SUN3_160 ((cpu_subtype_t) 2)
231 #define CPU_SUBTYPE_SUN3_260 ((cpu_subtype_t) 3)
232 #define CPU_SUBTYPE_SUN3_110 ((cpu_subtype_t) 4)
233 #define CPU_SUBTYPE_SUN3_60 ((cpu_subtype_t) 5)
234
235 #define CPU_SUBTYPE_HP_320 ((cpu_subtype_t) 6)
236 /* 16.67 Mhz HP 300 series, custom MMU [HP 320] */
237 #define CPU_SUBTYPE_HP_330 ((cpu_subtype_t) 7)
238 /* 16.67 Mhz HP 300 series, MC68851 MMU [HP 318,319,330,349] */
239 #define CPU_SUBTYPE_HP_350 ((cpu_subtype_t) 8)
240 /* 25.00 Mhz HP 300 series, custom MMU [HP 350] */
241
242 /*
243 * 32032/32332/32532 subtypes.
244 */
245
246 #define CPU_SUBTYPE_MMAX_DPC ((cpu_subtype_t) 1) /* 032 CPU */
247 #define CPU_SUBTYPE_SQT ((cpu_subtype_t) 2)
248 #define CPU_SUBTYPE_MMAX_APC_FPU ((cpu_subtype_t) 3) /* 32081 FPU */
249 #define CPU_SUBTYPE_MMAX_APC_FPA ((cpu_subtype_t) 4) /* Weitek FPA */
250 #define CPU_SUBTYPE_MMAX_XPC ((cpu_subtype_t) 5) /* 532 CPU */
251 #define CPU_SUBTYPE_PC532 ((cpu_subtype_t) 6) /* pc532 board */
252
253 /*
254 * 80386/80486 subtypes.
255 */
256
257 #define CPU_SUBTYPE_AT386 ((cpu_subtype_t) 1)
258 #define CPU_SUBTYPE_EXL ((cpu_subtype_t) 2)
259 #define CPU_SUBTYPE_iPSC386 ((cpu_subtype_t) 3)
260 #define CPU_SUBTYPE_SYMMETRY ((cpu_subtype_t) 4)
261 #define CPU_SUBTYPE_PS2 ((cpu_subtype_t) 5) /* PS/2 w/ MCA */
262
263 /*
264 * Mips subtypes.
265 */
266
267 #define CPU_SUBTYPE_MIPS_R2300 ((cpu_subtype_t) 1)
268 #define CPU_SUBTYPE_MIPS_R2600 ((cpu_subtype_t) 2)
269 #define CPU_SUBTYPE_MIPS_R2800 ((cpu_subtype_t) 3)
270 #define CPU_SUBTYPE_MIPS_R2000a ((cpu_subtype_t) 4) /* pmax */
271 #define CPU_SUBTYPE_MIPS_R2000 ((cpu_subtype_t) 5)
272 #define CPU_SUBTYPE_MIPS_R3000a ((cpu_subtype_t) 6) /* 3max */
273 #define CPU_SUBTYPE_MIPS_R3000 ((cpu_subtype_t) 7)
274
275 /*
276 * MC68030 subtypes.
277 */
278
279 #define CPU_SUBTYPE_NeXT ((cpu_subtype_t) 1)
280 /* NeXt thinks MC68030 is 6 rather than 9 */
281 #define CPU_SUBTYPE_HP_340 ((cpu_subtype_t) 2)
282 /* 16.67 Mhz HP 300 series [HP 332,340] */
283 #define CPU_SUBTYPE_HP_360 ((cpu_subtype_t) 3)
284 /* 25.00 Mhz HP 300 series [HP 360] */
285 #define CPU_SUBTYPE_HP_370 ((cpu_subtype_t) 4)
286 /* 33.33 Mhz HP 300 series [HP 370] */
287
288 /*
289 * HPPA subtypes.
290 */
291
292 #define CPU_SUBTYPE_HPPA_825 ((cpu_subtype_t) 1)
293 #define CPU_SUBTYPE_HPPA_835 ((cpu_subtype_t) 2)
294 #define CPU_SUBTYPE_HPPA_840 ((cpu_subtype_t) 3)
295 #define CPU_SUBTYPE_HPPA_850 ((cpu_subtype_t) 4)
296 #define CPU_SUBTYPE_HPPA_855 ((cpu_subtype_t) 5)
297
298 /*
299 * ARM subtypes.
300 */
301
302 #define CPU_SUBTYPE_ARM_A500_ARCH ((cpu_subtype_t) 1)
303 #define CPU_SUBTYPE_ARM_A500 ((cpu_subtype_t) 2)
304 #define CPU_SUBTYPE_ARM_A440 ((cpu_subtype_t) 3)
305 #define CPU_SUBTYPE_ARM_M4 ((cpu_subtype_t) 4)
306 #define CPU_SUBTYPE_ARM_A680 ((cpu_subtype_t) 5)
307
308 /*
309 * MC88000 subtypes.
310 */
311
312 #define CPU_SUBTYPE_MMAX_JPC ((cpu_subtype_t) 1)
313 #define CPU_SUBTYPE_LUNA88K ((cpu_subtype_t) 2)
314
315 /*
316 * Sparc subtypes.
317 */
318
319 #define CPU_SUBTYPE_SUN4_260 ((cpu_subtype_t) 1)
320 #define CPU_SUBTYPE_SUN4_110 ((cpu_subtype_t) 2)
321 #define CPU_SUBTYPE_SUN4_330 ((cpu_subtype_t) 3)
322 #define CPU_SUBTYPE_SUN4C_60 ((cpu_subtype_t) 4)
323 #define CPU_SUBTYPE_SUN4C_65 ((cpu_subtype_t) 5)
324 #define CPU_SUBTYPE_SUN4C_20 ((cpu_subtype_t) 6)
325 #define CPU_SUBTYPE_SUN4C_30 ((cpu_subtype_t) 7)
326 #define CPU_SUBTYPE_SUN4C_40 ((cpu_subtype_t) 8)
327 #define CPU_SUBTYPE_SUN4C_50 ((cpu_subtype_t) 9)
328 #define CPU_SUBTYPE_SUN4C_75 ((cpu_subtype_t) 10)
329
330 /*
331 * i860 subtypes.
332 */
333
334 #define CPU_SUBTYPE_iPSC860 ((cpu_subtype_t) 1)
335 #define CPU_SUBTYPE_OKI860 ((cpu_subtype_t) 2)
336
337 /*
338 * Alpha subtypes.
339 */
340
341 #define CPU_SUBTYPE_ALPHA_EV3 ((cpu_subtype_t) 1)
342 #define CPU_SUBTYPE_ALPHA_EV4 ((cpu_subtype_t) 2)
343 #define CPU_SUBTYPE_ALPHA_ISP ((cpu_subtype_t) 3)
344 #define CPU_SUBTYPE_ALPHA_21064 ((cpu_subtype_t) 4)
345
346
347 #endif /* _MACH_MACHINE_H_ */
Cache object: adf15485b49230f7986c7db490b1d417
|