|
|
1.1 root 1: /*
2: * Mach Operating System
3: * Copyright (c) 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 [email protected]
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: /* File: machine.h
27: * Author: Avadis Tevanian, Jr.
28: * Date: 1986
29: *
30: * Machine independent machine abstraction.
31: */
32:
33: #ifndef _MACH_MACHINE_H_
34: #define _MACH_MACHINE_H_
35:
36: #include <mach/machine/vm_types.h>
37: #include <mach/boolean.h>
38:
39: /*
40: * For each host, there is a maximum possible number of
41: * cpus that may be available in the system. This is the
42: * compile-time constant NCPUS, which is defined in cpus.h.
43: *
44: * In addition, there is a machine_slot specifier for each
45: * possible cpu in the system.
46: */
47:
48: struct machine_info {
49: integer_t major_version; /* kernel major version id */
50: integer_t minor_version; /* kernel minor version id */
51: integer_t max_cpus; /* max number of cpus compiled */
52: integer_t avail_cpus; /* number actually available */
53: vm_size_t memory_size; /* size of memory in bytes */
54: };
55:
56: typedef struct machine_info *machine_info_t;
57: typedef struct machine_info machine_info_data_t; /* bogus */
58:
59: typedef integer_t cpu_type_t;
60: typedef integer_t cpu_subtype_t;
61:
62: #define CPU_STATE_MAX 3
63:
64: #define CPU_STATE_USER 0
65: #define CPU_STATE_SYSTEM 1
66: #define CPU_STATE_IDLE 2
67:
68: struct machine_slot {
69: /*boolean_t*/integer_t is_cpu; /* is there a cpu in this slot? */
70: cpu_type_t cpu_type; /* type of cpu */
71: cpu_subtype_t cpu_subtype; /* subtype of cpu */
72: /*boolean_t*/integer_t running; /* is cpu running */
73: integer_t cpu_ticks[CPU_STATE_MAX];
74: integer_t clock_freq; /* clock interrupt frequency */
75: };
76:
77: typedef struct machine_slot *machine_slot_t;
78: typedef struct machine_slot machine_slot_data_t; /* bogus */
79:
80: #ifdef MACH_KERNEL
81: extern struct machine_info machine_info;
82: extern struct machine_slot machine_slot[NCPUS];
83: #endif /* MACH_KERNEL */
84:
85: /*
86: * Machine types known by all.
87: *
88: * When adding new types & subtypes, please also update slot_name.c
89: * in the libmach sources.
90: */
91:
92: #define CPU_TYPE_VAX ((cpu_type_t) 1)
93: #define CPU_TYPE_ROMP ((cpu_type_t) 2)
94: #define CPU_TYPE_MC68020 ((cpu_type_t) 3)
95: #define CPU_TYPE_NS32032 ((cpu_type_t) 4)
96: #define CPU_TYPE_NS32332 ((cpu_type_t) 5)
97: #define CPU_TYPE_NS32532 ((cpu_type_t) 6)
98: #define CPU_TYPE_I386 ((cpu_type_t) 7)
99: #define CPU_TYPE_MIPS ((cpu_type_t) 8)
100: #define CPU_TYPE_MC68030 ((cpu_type_t) 9)
101: #define CPU_TYPE_MC68040 ((cpu_type_t) 10)
102: #define CPU_TYPE_HPPA ((cpu_type_t) 11)
103: #define CPU_TYPE_ARM ((cpu_type_t) 12)
104: #define CPU_TYPE_MC88000 ((cpu_type_t) 13)
105: #define CPU_TYPE_SPARC ((cpu_type_t) 14)
106: #define CPU_TYPE_I860 ((cpu_type_t) 15)
107: #define CPU_TYPE_ALPHA ((cpu_type_t) 16)
1.1.1.2 root 108: #define CPU_TYPE_I486 ((cpu_type_t) 17)
109: #define CPU_TYPE_PENTIUM ((cpu_type_t) 18)
110: #define CPU_TYPE_PENTIUMPRO ((cpu_type_t) 19)
111: #define CPU_TYPE_POWERPC ((cpu_type_t) 20)
1.1 root 112:
113: /*
114: * Machine subtypes (these are defined here, instead of in a machine
115: * dependent directory, so that any program can get all definitions
116: * regardless of where is it compiled).
117: */
118:
119: /*
120: * VAX subtypes (these do *not* necessarily conform to the actual cpu
121: * ID assigned by DEC available via the SID register).
122: */
123:
124: #define CPU_SUBTYPE_VAX780 ((cpu_subtype_t) 1)
125: #define CPU_SUBTYPE_VAX785 ((cpu_subtype_t) 2)
126: #define CPU_SUBTYPE_VAX750 ((cpu_subtype_t) 3)
127: #define CPU_SUBTYPE_VAX730 ((cpu_subtype_t) 4)
128: #define CPU_SUBTYPE_UVAXI ((cpu_subtype_t) 5)
129: #define CPU_SUBTYPE_UVAXII ((cpu_subtype_t) 6)
130: #define CPU_SUBTYPE_VAX8200 ((cpu_subtype_t) 7)
131: #define CPU_SUBTYPE_VAX8500 ((cpu_subtype_t) 8)
132: #define CPU_SUBTYPE_VAX8600 ((cpu_subtype_t) 9)
133: #define CPU_SUBTYPE_VAX8650 ((cpu_subtype_t) 10)
134: #define CPU_SUBTYPE_VAX8800 ((cpu_subtype_t) 11)
135: #define CPU_SUBTYPE_UVAXIII ((cpu_subtype_t) 12)
136:
137: /*
138: * ROMP subtypes.
139: */
140:
141: #define CPU_SUBTYPE_RT_PC ((cpu_subtype_t) 1)
142: #define CPU_SUBTYPE_RT_APC ((cpu_subtype_t) 2)
143: #define CPU_SUBTYPE_RT_135 ((cpu_subtype_t) 3)
144:
145: /*
146: * 68020 subtypes.
147: */
148:
149: #define CPU_SUBTYPE_SUN3_50 ((cpu_subtype_t) 1)
150: #define CPU_SUBTYPE_SUN3_160 ((cpu_subtype_t) 2)
151: #define CPU_SUBTYPE_SUN3_260 ((cpu_subtype_t) 3)
152: #define CPU_SUBTYPE_SUN3_110 ((cpu_subtype_t) 4)
153: #define CPU_SUBTYPE_SUN3_60 ((cpu_subtype_t) 5)
154:
155: #define CPU_SUBTYPE_HP_320 ((cpu_subtype_t) 6)
156: /* 16.67 Mhz HP 300 series, custom MMU [HP 320] */
157: #define CPU_SUBTYPE_HP_330 ((cpu_subtype_t) 7)
158: /* 16.67 Mhz HP 300 series, MC68851 MMU [HP 318,319,330,349] */
159: #define CPU_SUBTYPE_HP_350 ((cpu_subtype_t) 8)
160: /* 25.00 Mhz HP 300 series, custom MMU [HP 350] */
161:
162: /*
163: * 32032/32332/32532 subtypes.
164: */
165:
166: #define CPU_SUBTYPE_MMAX_DPC ((cpu_subtype_t) 1) /* 032 CPU */
167: #define CPU_SUBTYPE_SQT ((cpu_subtype_t) 2)
168: #define CPU_SUBTYPE_MMAX_APC_FPU ((cpu_subtype_t) 3) /* 32081 FPU */
169: #define CPU_SUBTYPE_MMAX_APC_FPA ((cpu_subtype_t) 4) /* Weitek FPA */
170: #define CPU_SUBTYPE_MMAX_XPC ((cpu_subtype_t) 5) /* 532 CPU */
171: #define CPU_SUBTYPE_PC532 ((cpu_subtype_t) 6) /* pc532 board */
172:
173: /*
174: * 80386/80486 subtypes.
175: */
176:
177: #define CPU_SUBTYPE_AT386 ((cpu_subtype_t) 1)
178: #define CPU_SUBTYPE_EXL ((cpu_subtype_t) 2)
179: #define CPU_SUBTYPE_iPSC386 ((cpu_subtype_t) 3)
180: #define CPU_SUBTYPE_SYMMETRY ((cpu_subtype_t) 4)
181: #define CPU_SUBTYPE_PS2 ((cpu_subtype_t) 5) /* PS/2 w/ MCA */
182:
183: /*
184: * Mips subtypes.
185: */
186:
187: #define CPU_SUBTYPE_MIPS_R2300 ((cpu_subtype_t) 1)
188: #define CPU_SUBTYPE_MIPS_R2600 ((cpu_subtype_t) 2)
189: #define CPU_SUBTYPE_MIPS_R2800 ((cpu_subtype_t) 3)
190: #define CPU_SUBTYPE_MIPS_R2000a ((cpu_subtype_t) 4) /* pmax */
191: #define CPU_SUBTYPE_MIPS_R2000 ((cpu_subtype_t) 5)
192: #define CPU_SUBTYPE_MIPS_R3000a ((cpu_subtype_t) 6) /* 3max */
193: #define CPU_SUBTYPE_MIPS_R3000 ((cpu_subtype_t) 7)
194:
195: /*
196: * MC68030 subtypes.
197: */
198:
199: #define CPU_SUBTYPE_NeXT ((cpu_subtype_t) 1)
200: /* NeXt thinks MC68030 is 6 rather than 9 */
201: #define CPU_SUBTYPE_HP_340 ((cpu_subtype_t) 2)
202: /* 16.67 Mhz HP 300 series [HP 332,340] */
203: #define CPU_SUBTYPE_HP_360 ((cpu_subtype_t) 3)
204: /* 25.00 Mhz HP 300 series [HP 360] */
205: #define CPU_SUBTYPE_HP_370 ((cpu_subtype_t) 4)
206: /* 33.33 Mhz HP 300 series [HP 370] */
207:
208: /*
209: * HPPA subtypes.
210: */
211:
212: #define CPU_SUBTYPE_HPPA_825 ((cpu_subtype_t) 1)
213: #define CPU_SUBTYPE_HPPA_835 ((cpu_subtype_t) 2)
214: #define CPU_SUBTYPE_HPPA_840 ((cpu_subtype_t) 3)
215: #define CPU_SUBTYPE_HPPA_850 ((cpu_subtype_t) 4)
216: #define CPU_SUBTYPE_HPPA_855 ((cpu_subtype_t) 5)
217:
218: /*
219: * ARM subtypes.
220: */
221:
222: #define CPU_SUBTYPE_ARM_A500_ARCH ((cpu_subtype_t) 1)
223: #define CPU_SUBTYPE_ARM_A500 ((cpu_subtype_t) 2)
224: #define CPU_SUBTYPE_ARM_A440 ((cpu_subtype_t) 3)
225: #define CPU_SUBTYPE_ARM_M4 ((cpu_subtype_t) 4)
226: #define CPU_SUBTYPE_ARM_A680 ((cpu_subtype_t) 5)
227:
228: /*
229: * MC88000 subtypes.
230: */
231:
232: #define CPU_SUBTYPE_MMAX_JPC ((cpu_subtype_t) 1)
233: #define CPU_SUBTYPE_LUNA88K ((cpu_subtype_t) 2)
234:
235: /*
236: * Sparc subtypes.
237: */
238:
239: #define CPU_SUBTYPE_SUN4_260 ((cpu_subtype_t) 1)
240: #define CPU_SUBTYPE_SUN4_110 ((cpu_subtype_t) 2)
241: #define CPU_SUBTYPE_SUN4_330 ((cpu_subtype_t) 3)
242: #define CPU_SUBTYPE_SUN4C_60 ((cpu_subtype_t) 4)
243: #define CPU_SUBTYPE_SUN4C_65 ((cpu_subtype_t) 5)
244: #define CPU_SUBTYPE_SUN4C_20 ((cpu_subtype_t) 6)
245: #define CPU_SUBTYPE_SUN4C_30 ((cpu_subtype_t) 7)
246: #define CPU_SUBTYPE_SUN4C_40 ((cpu_subtype_t) 8)
247: #define CPU_SUBTYPE_SUN4C_50 ((cpu_subtype_t) 9)
248: #define CPU_SUBTYPE_SUN4C_75 ((cpu_subtype_t) 10)
249:
250: /*
251: * i860 subtypes.
252: */
253:
254: #define CPU_SUBTYPE_iPSC860 ((cpu_subtype_t) 1)
255: #define CPU_SUBTYPE_OKI860 ((cpu_subtype_t) 2)
256:
257: /*
258: * Alpha subtypes.
259: */
260:
261: #define CPU_SUBTYPE_ALPHA_EV3 ((cpu_subtype_t) 1)
262: #define CPU_SUBTYPE_ALPHA_EV4 ((cpu_subtype_t) 2)
263: #define CPU_SUBTYPE_ALPHA_ISP ((cpu_subtype_t) 3)
264: #define CPU_SUBTYPE_ALPHA_21064 ((cpu_subtype_t) 4)
265:
266:
267: #endif /* _MACH_MACHINE_H_ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.