xref: /trueos/sys/sys/mach/machine.h (revision 9c1dde6c551c2fcfdb84a29c80e2a77eff789c59)
1 /*
2  * Copyright 1991-1998 by Open Software Foundation, Inc.
3  *              All Rights Reserved
4  *
5  * Permission to use, copy, modify, and distribute this software and
6  * its documentation for any purpose and without fee is hereby granted,
7  * provided that the above copyright notice appears in all copies and
8  * that both the copyright notice and this permission notice appear in
9  * supporting documentation.
10  *
11  * OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
12  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
13  * FOR A PARTICULAR PURPOSE.
14  *
15  * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
16  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17  * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
18  * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
19  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20  */
21 /*
22  * MkLinux
23  */
24 /* CMU_HIST */
25 /*
26  * Revision 2.13.5.4  92/09/15  17:23:42  jeffreyh
27  * 	New 860 names from Intel
28  * 	[92/09/10            jeffreyh]
29  *
30  * Revision 2.13.5.3  92/05/27  00:46:46  jeffreyh
31  * 	Initial Paragon support.
32  * 	[andyp@ssd.intel.com]
33  *
34  * Revision 2.13.5.2  92/03/28  10:11:11  jeffreyh
35  * 	Pick up changes from MK71
36  * 	[92/03/20  13:21:20  jeffreyh]
37  *
38  * Revision 2.14  92/02/19  15:08:38  elf
39  * 	Added more Sparc subtypes.
40  * 	[92/02/19            rpd]
41  *
42  * Revision 2.13.5.1  92/02/18  19:13:35  jeffreyh
43  * 	Added sub cpu type for Corollary MP
44  * 	[91/06/25            bernadat]
45  *
46  * Revision 2.13  91/12/10  16:32:50  jsb
47  * 	Fixes from Intel
48  * 	[91/12/10  15:51:57  jsb]
49  *
50  * Revision 2.12  91/07/31  17:53:56  dbg
51  * 	Remove declaration of interrupt_stack - it is machine-dependent.
52  * 	Changed CPU_SUBTYPE_LUNA88K - there's already a (potential)
53  * 	mc88000 port.
54  * 	[91/07/26            dbg]
55  *
56  * Revision 2.11  91/07/09  23:22:06  danner
57  * 	   Added CPU_SUBTYPE_LUNA88K
58  * 	[91/05/06            danner]
59  *
60  * Revision 2.10  91/05/14  16:55:24  mrt
61  * 	Correcting copyright
62  *
63  * Revision 2.9  91/05/08  12:49:54  dbg
64  * 	Add CPU_SUBTYPE_SYMMETRY.
65  * 	[91/04/26  14:44:44  dbg]
66  *
67  * Revision 2.8  91/02/05  17:33:48  mrt
68  * 	Changed to new Mach copyright
69  * 	[91/02/01  17:18:51  mrt]
70  *
71  * Revision 2.7  90/12/04  14:51:27  jsb
72  * 	Renamed CPU_SUBTYPE_iPSC2 as CPU_SUBTYPE_iPSC386.
73  * 	[90/12/03  22:22:25  jsb]
74  *
75  * Revision 2.6  90/11/25  17:48:28  jsb
76  * 	Added CPU_TYPE_I860 and CPU_SUBTYPE_iPSC860.
77  * 	[90/11/25  16:51:44  jsb]
78  *
79  * Revision 2.5  90/09/23  17:45:42  jsb
80  * 	Added CPU_SUBTYPE_iPSC2.
81  * 	[90/09/21  16:43:01  jsb]
82  *
83  * Revision 2.4  90/08/07  22:23:05  rpd
84  * 	Added new MIPS subtypes for R3000, fix old defs.
85  * 	[90/08/07  15:54:40  af]
86  *
87  * Revision 2.3  90/06/02  14:58:47  rpd
88  * 	Picked up new cpu types.
89  * 	[90/03/26  22:34:38  rpd]
90  *
91  * Revision 2.2  89/11/29  14:09:32  af
92  * 	Changes for MACH_KERNEL:
93  * 	. Removed should_exit.
94  *
95  * 	17-May-1989 Randall W. Dean (rwd)
96  * 	changed machine/vm_types.h to mach/vm_param.h
97  * 	[89/05/23            dbg]
98  *
99  * Revision 2.1  89/08/03  16:02:33  rwd
100  * Created.
101  *
102  * Revision 2.11  89/04/18  16:43:32  mwyoung
103  * 	Use <machine/vm_types.h> rather than <vm/vm_param.h> to get
104  * 	VM types.  Remove old history... none of it was insightful.
105  *
106  * 	The variable declarations should be moved elsewhere.
107  * 	[89/01/24            mwyoung]
108  *
109  * Revision 2.2.4.1  90/06/11  10:59:52  af
110  * 	Added new MIPS subtypes for R3000, fix old defs.
111  *
112  */
113 /* CMU_ENDHIST */
114 /*
115  * Mach Operating System
116  * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
117  * All Rights Reserved.
118  *
119  * Permission to use, copy, modify and distribute this software and its
120  * documentation is hereby granted, provided that both the copyright
121  * notice and this permission notice appear in all copies of the
122  * software, derivative works or modified versions, and any portions
123  * thereof, and that both notices appear in supporting documentation.
124  *
125  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
126  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
127  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
128  *
129  * Carnegie Mellon requests users of this software to return to
130  *
131  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
132  *  School of Computer Science
133  *  Carnegie Mellon University
134  *  Pittsburgh PA 15213-3890
135  *
136  * any improvements or extensions that they make and grant Carnegie Mellon
137  * the rights to redistribute these changes.
138  */
139 /*
140  */
141 /*	File:	machine.h
142  *	Author:	Avadis Tevanian, Jr.
143  *	Date:	1986
144  *
145  *	Machine independent machine abstraction.
146  */
147 
148 #ifndef	_MACH_MACHINE_H_
149 #define _MACH_MACHINE_H_
150 
151 #ifdef	MACH_KERNEL
152 #include <cpus.h>
153 #endif	/* MACH_KERNEL */
154 
155 #include <sys/mach/vm_types.h>
156 
157 /*
158  *	For each host, there is a maximum possible number of
159  *	cpus that may be available in the system.  This is the
160  *	compile-time constant NCPUS, which is defined in cpus.h.
161  *
162  *	In addition, there is a machine_slot specifier for each
163  *	possible cpu in the system.
164  */
165 
166 struct machine_info {
167 	integer_t	major_version;	/* kernel major version id */
168 	integer_t	minor_version;	/* kernel minor version id */
169 	int		max_cpus;	/* max number of cpus compiled */
170 	int		avail_cpus;	/* number actually available */
171 	vm_size_t	memory_size;	/* size of memory in bytes */
172 };
173 
174 typedef struct machine_info	*machine_info_t;
175 typedef struct machine_info	machine_info_data_t;	/* bogus */
176 
177 typedef integer_t	cpu_type_t;
178 typedef integer_t	cpu_subtype_t;
179 
180 #define CPU_STATE_MAX		4
181 
182 #define CPU_STATE_USER		0
183 #define CPU_STATE_NICE		1
184 #define CPU_STATE_SYSTEM	2
185 #define CPU_STATE_IDLE		3
186 
187 struct machine_slot {
188 	boolean_t	is_cpu;		/* is there a cpu in this slot? */
189 	cpu_type_t	cpu_type;	/* type of cpu */
190 	cpu_subtype_t	cpu_subtype;	/* subtype of cpu */
191 	integer_t	running;	/* is cpu running */
192 	integer_t	cpu_ticks[CPU_STATE_MAX];
193 	integer_t	clock_freq;	/* clock interrupt frequency */
194 };
195 
196 typedef struct machine_slot	*machine_slot_t;
197 typedef struct machine_slot	machine_slot_data_t;	/* bogus */
198 
199 #ifdef	MACH_KERNEL
200 extern struct machine_info	machine_info;
201 extern struct machine_slot	machine_slot[NCPUS];
202 #endif	/* MACH_KERNEL */
203 
204 /*
205  *	Machine types known by all.
206  *
207  *	When adding new types & subtypes, please also update slot_name.c
208  *	in the libmach sources.
209  */
210 
211 #define CPU_TYPE_VAX		((cpu_type_t) 1)
212 #define CPU_TYPE_ROMP		((cpu_type_t) 2)
213 #define CPU_TYPE_MC68020	((cpu_type_t) 3)
214 #define CPU_TYPE_NS32032	((cpu_type_t) 4)
215 #define CPU_TYPE_NS32332        ((cpu_type_t) 5)
216 #define CPU_TYPE_NS32532        ((cpu_type_t) 6)
217 #define CPU_TYPE_I386		((cpu_type_t) 7)
218 #define CPU_TYPE_MIPS		((cpu_type_t) 8)
219 #define	CPU_TYPE_MC68030	((cpu_type_t) 9)
220 #define CPU_TYPE_MC68040	((cpu_type_t) 10)
221 #define CPU_TYPE_HPPA           ((cpu_type_t) 11)
222 #define CPU_TYPE_ARM		((cpu_type_t) 12)
223 #define CPU_TYPE_MC88000	((cpu_type_t) 13)
224 #define CPU_TYPE_SPARC		((cpu_type_t) 14)
225 #define CPU_TYPE_I860		((cpu_type_t) 15)
226 #define CPU_TYPE_ALPHA		((cpu_type_t) 16)
227 #define	CPU_TYPE_I486		((cpu_type_t) 17)
228 #define	CPU_TYPE_PENTIUM	((cpu_type_t) 18)
229 #define	CPU_TYPE_PENTIUMPRO	((cpu_type_t) 19)
230 #define CPU_TYPE_POWERPC	((cpu_type_t) 20)
231 
232 /*
233  *	Machine subtypes (these are defined here, instead of in a machine
234  *	dependent directory, so that any program can get all definitions
235  *	regardless of where is it compiled).
236  */
237 
238 /*
239  *	VAX subtypes (these do *not* necessarily conform to the actual cpu
240  *	ID assigned by DEC available via the SID register).
241  */
242 
243 #define CPU_SUBTYPE_VAX780	((cpu_subtype_t) 1)
244 #define CPU_SUBTYPE_VAX785	((cpu_subtype_t) 2)
245 #define CPU_SUBTYPE_VAX750	((cpu_subtype_t) 3)
246 #define CPU_SUBTYPE_VAX730	((cpu_subtype_t) 4)
247 #define CPU_SUBTYPE_UVAXI	((cpu_subtype_t) 5)
248 #define CPU_SUBTYPE_UVAXII	((cpu_subtype_t) 6)
249 #define CPU_SUBTYPE_VAX8200	((cpu_subtype_t) 7)
250 #define CPU_SUBTYPE_VAX8500	((cpu_subtype_t) 8)
251 #define CPU_SUBTYPE_VAX8600	((cpu_subtype_t) 9)
252 #define CPU_SUBTYPE_VAX8650	((cpu_subtype_t) 10)
253 #define CPU_SUBTYPE_VAX8800	((cpu_subtype_t) 11)
254 #define CPU_SUBTYPE_UVAXIII	((cpu_subtype_t) 12)
255 
256 /*
257  *	Alpha subtypes (these do *not* necessary conform to the actual cpu
258  *	ID assigned by DEC available via the SID register).
259  */
260 
261 #define CPU_SUBTYPE_ALPHA_ADU		((cpu_subtype_t) 1)
262 #define CPU_SUBTYPE_DEC_4000		((cpu_subtype_t) 2)
263 #define CPU_SUBTYPE_DEC_7000		((cpu_subtype_t) 3)
264 #define CPU_SUBTYPE_DEC_3000_500	((cpu_subtype_t) 4)
265 #define CPU_SUBTYPE_DEC_3000_400	((cpu_subtype_t) 5)
266 #define CPU_SUBTYPE_DEC_10000		((cpu_subtype_t) 6)
267 #define CPU_SUBTYPE_DEC_3000_300        ((cpu_subtype_t) 7)
268 #define CPU_SUBTYPE_DEC_2000_300        ((cpu_subtype_t) 8)
269 #define CPU_SUBTYPE_DEC_2100_A500	((cpu_subtype_t) 9)
270 #define CPU_SUBTYPE_DEC_MORGAN		((cpu_subtype_t) 11)
271 #define CPU_SUBTYPE_DEC_AVANTI          ((cpu_subtype_t) 13)
272 #define CPU_SUBTYPE_DEC_MUSTANG         ((cpu_subtype_t) 14)
273 
274 /*
275  *	ROMP subtypes.
276  */
277 
278 #define CPU_SUBTYPE_RT_PC	((cpu_subtype_t) 1)
279 #define CPU_SUBTYPE_RT_APC	((cpu_subtype_t) 2)
280 #define CPU_SUBTYPE_RT_135	((cpu_subtype_t) 3)
281 
282 /*
283  *	68020 subtypes.
284  */
285 
286 #define CPU_SUBTYPE_SUN3_50	((cpu_subtype_t) 1)
287 #define CPU_SUBTYPE_SUN3_160	((cpu_subtype_t) 2)
288 #define CPU_SUBTYPE_SUN3_260	((cpu_subtype_t) 3)
289 #define CPU_SUBTYPE_SUN3_110	((cpu_subtype_t) 4)
290 #define CPU_SUBTYPE_SUN3_60	((cpu_subtype_t) 5)
291 
292 #define CPU_SUBTYPE_HP_320	((cpu_subtype_t) 6)
293 	/* 16.67 Mhz HP 300 series, custom MMU [HP 320] */
294 #define CPU_SUBTYPE_HP_330	((cpu_subtype_t) 7)
295 	/* 16.67 Mhz HP 300 series, MC68851 MMU [HP 318,319,330,349] */
296 #define CPU_SUBTYPE_HP_350	((cpu_subtype_t) 8)
297 	/* 25.00 Mhz HP 300 series, custom MMU [HP 350] */
298 
299 /*
300  *	32032/32332/32532 subtypes.
301  */
302 
303 #define CPU_SUBTYPE_MMAX_DPC	    ((cpu_subtype_t) 1)	/* 032 CPU */
304 #define CPU_SUBTYPE_SQT		    ((cpu_subtype_t) 2) /* Symmetry */
305 #define CPU_SUBTYPE_MMAX_APC_FPU    ((cpu_subtype_t) 3)	/* 32081 FPU */
306 #define CPU_SUBTYPE_MMAX_APC_FPA    ((cpu_subtype_t) 4)	/* Weitek FPA */
307 #define CPU_SUBTYPE_MMAX_XPC	    ((cpu_subtype_t) 5)	/* 532 CPU */
308 #define CPU_SUBTYPE_SQT86	    ((cpu_subtype_t) 6) /* ?? */
309 
310 /*
311  *	80386/80486/Pentium subtypes.
312  */
313 
314 #define CPU_SUBTYPE_AT386	((cpu_subtype_t) 1)
315 #define CPU_SUBTYPE_EXL		((cpu_subtype_t) 2)
316 #define CPU_SUBTYPE_iPSC386	((cpu_subtype_t) 3)
317 #define	CPU_SUBTYPE_SYMMETRY	((cpu_subtype_t) 4)	/* Sequent */
318 #define	CPU_SUBTYPE_CBUS	((cpu_subtype_t) 5)	/* Cbus (Compaq) */
319 #define	CPU_SUBTYPE_MBUS	((cpu_subtype_t) 6)	/* Mbus (Corollary) */
320 #define	CPU_SUBTYPE_MPS		((cpu_subtype_t) 7)	/* Intel MP Spec. */
321 
322 /*
323  *	Mips subtypes.
324  */
325 
326 #define CPU_SUBTYPE_MIPS_R2300	((cpu_subtype_t) 1)
327 #define CPU_SUBTYPE_MIPS_R2600	((cpu_subtype_t) 2)
328 #define CPU_SUBTYPE_MIPS_R2800	((cpu_subtype_t) 3)
329 #define CPU_SUBTYPE_MIPS_R2000a	((cpu_subtype_t) 4)	/* pmax */
330 #define CPU_SUBTYPE_MIPS_R2000	((cpu_subtype_t) 5)
331 #define CPU_SUBTYPE_MIPS_R3000a	((cpu_subtype_t) 6)	/* 3max */
332 #define CPU_SUBTYPE_MIPS_R3000	((cpu_subtype_t) 7)
333 
334 /*
335  * 	MC68030 subtypes.
336  */
337 
338 #define CPU_SUBTYPE_NeXT	((cpu_subtype_t) 1)
339 	/* NeXt thinks MC68030 is 6 rather than 9 */
340 #define CPU_SUBTYPE_HP_340	((cpu_subtype_t) 2)
341 	/* 16.67 Mhz HP 300 series [HP 332,340] */
342 #define CPU_SUBTYPE_HP_360	((cpu_subtype_t) 3)
343 	/* 25.00 Mhz HP 300 series [HP 360] */
344 #define CPU_SUBTYPE_HP_370	((cpu_subtype_t) 4)
345 	/* 33.33 Mhz HP 300 series [HP 370] */
346 
347 /*
348  *	HPPA subtypes.
349  */
350 
351 #define CPU_SUBTYPE_HPPA_825		((cpu_subtype_t) 1)
352 #define CPU_SUBTYPE_HPPA_835		((cpu_subtype_t) 2)
353 #define CPU_SUBTYPE_HPPA_840		((cpu_subtype_t) 3)
354 #define CPU_SUBTYPE_HPPA_850		((cpu_subtype_t) 4)
355 #define CPU_SUBTYPE_HPPA_855		((cpu_subtype_t) 5)
356 #define	CPU_SUBTYPE_HPPA_705		((cpu_subtype_t) 6)
357 #define	CPU_SUBTYPE_HPPA_710		((cpu_subtype_t) 7)
358 #define	CPU_SUBTYPE_HPPA_720		((cpu_subtype_t) 8)
359 #define	CPU_SUBTYPE_HPPA_725		((cpu_subtype_t) 9)
360 #define	CPU_SUBTYPE_HPPA_730       	((cpu_subtype_t)10)
361 #define	CPU_SUBTYPE_HPPA_750		((cpu_subtype_t)11)
362 #define	CPU_SUBTYPE_HPPA_770		((cpu_subtype_t)12)
363 #define	CPU_SUBTYPE_HPPA_777		((cpu_subtype_t)13)
364 #define	CPU_SUBTYPE_HPPA_712		((cpu_subtype_t)14)
365 #define	CPU_SUBTYPE_HPPA_715		((cpu_subtype_t)15)
366 
367 /*
368  * 	ARM subtypes.
369  */
370 
371 #define CPU_SUBTYPE_ARM_A500_ARCH	((cpu_subtype_t) 1)
372 #define CPU_SUBTYPE_ARM_A500		((cpu_subtype_t) 2)
373 #define CPU_SUBTYPE_ARM_A440		((cpu_subtype_t) 3)
374 #define CPU_SUBTYPE_ARM_M4		((cpu_subtype_t) 4)
375 #define CPU_SUBTYPE_ARM_A680		((cpu_subtype_t) 5)
376 
377 /*
378  *	MC88000 subtypes.
379  */
380 
381 #define CPU_SUBTYPE_MMAX_JPC		((cpu_subtype_t) 1)
382 #define CPU_SUBTYPE_LUNA88K             ((cpu_subtype_t) 2)
383 
384 /*
385  *	Sparc subtypes.
386  */
387 
388 #define CPU_SUBTYPE_SUN4_260		((cpu_subtype_t) 1)
389 #define CPU_SUBTYPE_SUN4_110		((cpu_subtype_t) 2)
390 #define CPU_SUBTYPE_SUN4_330		((cpu_subtype_t) 3)
391 #define CPU_SUBTYPE_SUN4C_60		((cpu_subtype_t) 4)
392 #define CPU_SUBTYPE_SUN4C_65		((cpu_subtype_t) 5)
393 #define CPU_SUBTYPE_SUN4C_20		((cpu_subtype_t) 6)
394 #define CPU_SUBTYPE_SUN4C_30		((cpu_subtype_t) 7)
395 #define CPU_SUBTYPE_SUN4C_40		((cpu_subtype_t) 8)
396 #define CPU_SUBTYPE_SUN4C_50		((cpu_subtype_t) 9)
397 #define CPU_SUBTYPE_SUN4C_75		((cpu_subtype_t) 10)
398 
399 /*
400  *	i860 subtypes.
401  */
402 
403 #define CPU_SUBTYPE_iPSC860		((cpu_subtype_t) 1)
404 #define CPU_SUBTYPE_PARAGON860		((cpu_subtype_t) 2)
405 #define CPU_SUBTYPE_PARAGON860_MP	((cpu_subtype_t) 3)
406 #define CPU_SUBTYPE_OKI860		((cpu_subtype_t) 4)
407 
408 /*
409  *	Alpha subtypes.
410  */
411 
412 #define CPU_SUBTYPE_ALPHA_EV3		((cpu_subtype_t) 1)
413 #define CPU_SUBTYPE_ALPHA_EV4		((cpu_subtype_t) 2)
414 #define CPU_SUBTYPE_ALPHA_ISP		((cpu_subtype_t) 3)
415 #define CPU_SUBTYPE_ALPHA_21064		((cpu_subtype_t) 4)
416 
417 /*
418  *	PowerPc subtypes. These are defined as the values in the upper
419  *	16 bits of the PVR register of the CPU in question.
420  */
421 
422 #define CPU_SUBTYPE_PPC601		((cpu_subtype_t) 1)
423 #define CPU_SUBTYPE_PPC603		((cpu_subtype_t) 3)
424 #define CPU_SUBTYPE_PPC604		((cpu_subtype_t) 4)
425 #define CPU_SUBTYPE_PPC602		((cpu_subtype_t) 5)
426 #define CPU_SUBTYPE_PPC603e		((cpu_subtype_t) 6)
427 #define CPU_SUBTYPE_PPC603ev		((cpu_subtype_t) 7)
428 #define CPU_SUBTYPE_PPC604e		((cpu_subtype_t) 9)
429 #define CPU_SUBTYPE_PPC620		((cpu_subtype_t) 20)
430 
431 #endif	/* _MACH_MACHINE_H_ */
432