|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. ! 3: * ! 4: * @APPLE_LICENSE_HEADER_START@ ! 5: * ! 6: * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights ! 7: * Reserved. This file contains Original Code and/or Modifications of ! 8: * Original Code as defined in and that are subject to the Apple Public ! 9: * Source License Version 1.1 (the "License"). You may not use this file ! 10: * except in compliance with the License. Please obtain a copy of the ! 11: * License at http://www.apple.com/publicsource and read it before using ! 12: * this file. ! 13: * ! 14: * The Original Code and all software distributed under the License are ! 15: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER ! 16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, ! 17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, ! 18: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the ! 19: * License for the specific language governing rights and limitations ! 20: * under the License. ! 21: * ! 22: * @APPLE_LICENSE_HEADER_END@ ! 23: */ ! 24: ! 25: /* ! 26: * Mach Operating System ! 27: * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University ! 28: * All Rights Reserved. ! 29: * ! 30: * Permission to use, copy, modify and distribute this software and its ! 31: * documentation is hereby granted, provided that both the copyright ! 32: * notice and this permission notice appear in all copies of the ! 33: * software, derivative works or modified versions, and any portions ! 34: * thereof, and that both notices appear in supporting documentation. ! 35: * ! 36: * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" ! 37: * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR ! 38: * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. ! 39: * ! 40: * Carnegie Mellon requests users of this software to return to ! 41: * ! 42: * Software Distribution Coordinator or [email protected] ! 43: * School of Computer Science ! 44: * Carnegie Mellon University ! 45: * Pittsburgh PA 15213-3890 ! 46: * ! 47: * any improvements or extensions that they make and grant Carnegie Mellon ! 48: * the rights to redistribute these changes. ! 49: */ ! 50: /* File: machine.h ! 51: * Author: Avadis Tevanian, Jr. ! 52: * Date: 1986 ! 53: * ! 54: * Machine independent machine abstraction. ! 55: */ ! 56: ! 57: #ifndef _MACH_MACHINE_H_ ! 58: #define _MACH_MACHINE_H_ ! 59: ! 60: #import <mach/machine/vm_types.h> ! 61: #import <mach/boolean.h> ! 62: ! 63: /* ! 64: * For each host, there is a maximum possible number of ! 65: * cpus that may be available in the system. This is the ! 66: * compile-time constant NCPUS, which is defined in cpus.h. ! 67: * ! 68: * In addition, there is a machine_slot specifier for each ! 69: * possible cpu in the system. ! 70: */ ! 71: ! 72: struct machine_info { ! 73: integer_t major_version; /* kernel major version id */ ! 74: integer_t minor_version; /* kernel minor version id */ ! 75: integer_t max_cpus; /* max number of cpus compiled */ ! 76: integer_t avail_cpus; /* number actually available */ ! 77: vm_size_t memory_size; /* size of memory in bytes */ ! 78: }; ! 79: ! 80: typedef struct machine_info *machine_info_t; ! 81: typedef struct machine_info machine_info_data_t; /* bogus */ ! 82: ! 83: typedef integer_t cpu_type_t; ! 84: typedef integer_t cpu_subtype_t; ! 85: ! 86: #define CPU_STATE_MAX 3 ! 87: ! 88: #define CPU_STATE_USER 0 ! 89: #define CPU_STATE_SYSTEM 1 ! 90: #define CPU_STATE_IDLE 2 ! 91: ! 92: struct machine_slot { ! 93: /*boolean_t*/integer_t is_cpu; /* is there a cpu in this slot? */ ! 94: cpu_type_t cpu_type; /* type of cpu */ ! 95: cpu_subtype_t cpu_subtype; /* subtype of cpu */ ! 96: /*boolean_t*/integer_t running; /* is cpu running */ ! 97: integer_t cpu_ticks[CPU_STATE_MAX]; ! 98: integer_t clock_freq; /* clock interrupt frequency */ ! 99: }; ! 100: ! 101: typedef struct machine_slot *machine_slot_t; ! 102: typedef struct machine_slot machine_slot_data_t; /* bogus */ ! 103: ! 104: #ifdef KERNEL ! 105: extern struct machine_info machine_info; ! 106: extern struct machine_slot machine_slot[]; ! 107: ! 108: extern vm_offset_t interrupt_stack[]; ! 109: #endif /* KERNEL */ ! 110: ! 111: /* ! 112: * Machine types known by all. ! 113: */ ! 114: ! 115: #define CPU_TYPE_ANY ((cpu_type_t) -1) ! 116: ! 117: #define CPU_TYPE_VAX ((cpu_type_t) 1) ! 118: /* skip ((cpu_type_t) 2) */ ! 119: /* skip ((cpu_type_t) 3) */ ! 120: /* skip ((cpu_type_t) 4) */ ! 121: /* skip ((cpu_type_t) 5) */ ! 122: #define CPU_TYPE_MC680x0 ((cpu_type_t) 6) ! 123: #define CPU_TYPE_I386 ((cpu_type_t) 7) ! 124: /* skip CPU_TYPE_MIPS ((cpu_type_t) 8) */ ! 125: /* skip ((cpu_type_t) 9) */ ! 126: #define CPU_TYPE_MC98000 ((cpu_type_t) 10) ! 127: #define CPU_TYPE_HPPA ((cpu_type_t) 11) ! 128: /* skip CPU_TYPE_ARM ((cpu_type_t) 12) */ ! 129: #define CPU_TYPE_MC88000 ((cpu_type_t) 13) ! 130: #define CPU_TYPE_SPARC ((cpu_type_t) 14) ! 131: #define CPU_TYPE_I860 ((cpu_type_t) 15) ! 132: /* skip CPU_TYPE_ALPHA ((cpu_type_t) 16) */ ! 133: /* skip ((cpu_type_t) 17) */ ! 134: #define CPU_TYPE_POWERPC ((cpu_type_t) 18) ! 135: ! 136: ! 137: /* ! 138: * Machine subtypes (these are defined here, instead of in a machine ! 139: * dependent directory, so that any program can get all definitions ! 140: * regardless of where is it compiled). ! 141: */ ! 142: ! 143: /* ! 144: * Object files that are hand-crafted to run on any ! 145: * implementation of an architecture are tagged with ! 146: * CPU_SUBTYPE_MULTIPLE. This functions essentially the same as ! 147: * the "ALL" subtype of an architecture except that it allows us ! 148: * to easily find object files that may need to be modified ! 149: * whenever a new implementation of an architecture comes out. ! 150: * ! 151: * It is the responsibility of the implementor to make sure the ! 152: * software handles unsupported implementations elegantly. ! 153: */ ! 154: #define CPU_SUBTYPE_MULTIPLE ((cpu_subtype_t) -1) ! 155: #define CPU_SUBTYPE_LITTLE_ENDIAN ((cpu_subtype_t) 0) ! 156: #define CPU_SUBTYPE_BIG_ENDIAN ((cpu_subtype_t) 1) ! 157: ! 158: /* ! 159: * VAX subtypes (these do *not* necessary conform to the actual cpu ! 160: * ID assigned by DEC available via the SID register). ! 161: */ ! 162: ! 163: #define CPU_SUBTYPE_VAX_ALL ((cpu_subtype_t) 0) ! 164: #define CPU_SUBTYPE_VAX780 ((cpu_subtype_t) 1) ! 165: #define CPU_SUBTYPE_VAX785 ((cpu_subtype_t) 2) ! 166: #define CPU_SUBTYPE_VAX750 ((cpu_subtype_t) 3) ! 167: #define CPU_SUBTYPE_VAX730 ((cpu_subtype_t) 4) ! 168: #define CPU_SUBTYPE_UVAXI ((cpu_subtype_t) 5) ! 169: #define CPU_SUBTYPE_UVAXII ((cpu_subtype_t) 6) ! 170: #define CPU_SUBTYPE_VAX8200 ((cpu_subtype_t) 7) ! 171: #define CPU_SUBTYPE_VAX8500 ((cpu_subtype_t) 8) ! 172: #define CPU_SUBTYPE_VAX8600 ((cpu_subtype_t) 9) ! 173: #define CPU_SUBTYPE_VAX8650 ((cpu_subtype_t) 10) ! 174: #define CPU_SUBTYPE_VAX8800 ((cpu_subtype_t) 11) ! 175: #define CPU_SUBTYPE_UVAXIII ((cpu_subtype_t) 12) ! 176: ! 177: /* ! 178: * 680x0 subtypes ! 179: * ! 180: * The subtype definitions here are unusual for historical reasons. ! 181: * NeXT used to consider 68030 code as generic 68000 code. For ! 182: * backwards compatability: ! 183: * ! 184: * CPU_SUBTYPE_MC68030 symbol has been preserved for source code ! 185: * compatability. ! 186: * ! 187: * CPU_SUBTYPE_MC680x0_ALL has been defined to be the same ! 188: * subtype as CPU_SUBTYPE_MC68030 for binary comatability. ! 189: * ! 190: * CPU_SUBTYPE_MC68030_ONLY has been added to allow new object ! 191: * files to be tagged as containing 68030-specific instructions. ! 192: */ ! 193: ! 194: #define CPU_SUBTYPE_MC680x0_ALL ((cpu_subtype_t) 1) ! 195: #define CPU_SUBTYPE_MC68030 ((cpu_subtype_t) 1) /* compat */ ! 196: #define CPU_SUBTYPE_MC68040 ((cpu_subtype_t) 2) ! 197: #define CPU_SUBTYPE_MC68030_ONLY ((cpu_subtype_t) 3) ! 198: ! 199: /* ! 200: * I386 subtypes. ! 201: */ ! 202: ! 203: #define CPU_SUBTYPE_I386_ALL ((cpu_subtype_t) 3) ! 204: #define CPU_SUBTYPE_386 ((cpu_subtype_t) 3) ! 205: #define CPU_SUBTYPE_486 ((cpu_subtype_t) 4) ! 206: #define CPU_SUBTYPE_486SX ((cpu_subtype_t) 4 + 128) ! 207: #define CPU_SUBTYPE_586 ((cpu_subtype_t) 5) ! 208: #define CPU_SUBTYPE_INTEL(f, m) ((cpu_subtype_t) (f) + ((m) << 4)) ! 209: #define CPU_SUBTYPE_PENT CPU_SUBTYPE_INTEL(5, 0) ! 210: #define CPU_SUBTYPE_PENTPRO CPU_SUBTYPE_INTEL(6, 1) ! 211: #define CPU_SUBTYPE_PENTII_M3 CPU_SUBTYPE_INTEL(6, 3) ! 212: #define CPU_SUBTYPE_PENTII_M5 CPU_SUBTYPE_INTEL(6, 5) ! 213: ! 214: #define CPU_SUBTYPE_INTEL_FAMILY(x) ((x) & 15) ! 215: #define CPU_SUBTYPE_INTEL_FAMILY_MAX 15 ! 216: ! 217: #define CPU_SUBTYPE_INTEL_MODEL(x) ((x) >> 4) ! 218: #define CPU_SUBTYPE_INTEL_MODEL_ALL 0 ! 219: ! 220: /* ! 221: * Mips subtypes. ! 222: */ ! 223: ! 224: #define CPU_SUBTYPE_MIPS_ALL ((cpu_subtype_t) 0) ! 225: #define CPU_SUBTYPE_MIPS_R2300 ((cpu_subtype_t) 1) ! 226: #define CPU_SUBTYPE_MIPS_R2600 ((cpu_subtype_t) 2) ! 227: #define CPU_SUBTYPE_MIPS_R2800 ((cpu_subtype_t) 3) ! 228: #define CPU_SUBTYPE_MIPS_R2000a ((cpu_subtype_t) 4) /* pmax */ ! 229: #define CPU_SUBTYPE_MIPS_R2000 ((cpu_subtype_t) 5) ! 230: #define CPU_SUBTYPE_MIPS_R3000a ((cpu_subtype_t) 6) /* 3max */ ! 231: #define CPU_SUBTYPE_MIPS_R3000 ((cpu_subtype_t) 7) ! 232: ! 233: /* ! 234: * MC98000 (PowerPC) subtypes ! 235: */ ! 236: #define CPU_SUBTYPE_MC98000_ALL ((cpu_subtype_t) 0) ! 237: #define CPU_SUBTYPE_MC98601 ((cpu_subtype_t) 1) ! 238: ! 239: /* ! 240: * HPPA subtypes for Hewlett-Packard HP-PA family of ! 241: * risc processors. Port by NeXT to 700 series. ! 242: */ ! 243: ! 244: #define CPU_SUBTYPE_HPPA_ALL ((cpu_subtype_t) 0) ! 245: #define CPU_SUBTYPE_HPPA_7100 ((cpu_subtype_t) 0) /* compat */ ! 246: #define CPU_SUBTYPE_HPPA_7100LC ((cpu_subtype_t) 1) ! 247: ! 248: /* ! 249: * MC88000 subtypes. ! 250: */ ! 251: #define CPU_SUBTYPE_MC88000_ALL ((cpu_subtype_t) 0) ! 252: #define CPU_SUBTYPE_MC88100 ((cpu_subtype_t) 1) ! 253: #define CPU_SUBTYPE_MC88110 ((cpu_subtype_t) 2) ! 254: ! 255: /* ! 256: * SPARC subtypes ! 257: */ ! 258: #define CPU_SUBTYPE_SPARC_ALL ((cpu_subtype_t) 0) ! 259: ! 260: /* ! 261: * I860 subtypes ! 262: */ ! 263: #define CPU_SUBTYPE_I860_ALL ((cpu_subtype_t) 0) ! 264: #define CPU_SUBTYPE_I860_860 ((cpu_subtype_t) 1) ! 265: ! 266: /* ! 267: * PowerPC subtypes ! 268: */ ! 269: #define CPU_SUBTYPE_POWERPC_ALL ((cpu_subtype_t) 0) ! 270: #define CPU_SUBTYPE_POWERPC_601 ((cpu_subtype_t) 1) ! 271: #define CPU_SUBTYPE_POWERPC_602 ((cpu_subtype_t) 2) ! 272: #define CPU_SUBTYPE_POWERPC_603 ((cpu_subtype_t) 3) ! 273: #define CPU_SUBTYPE_POWERPC_603e ((cpu_subtype_t) 4) ! 274: #define CPU_SUBTYPE_POWERPC_603ev ((cpu_subtype_t) 5) ! 275: #define CPU_SUBTYPE_POWERPC_604 ((cpu_subtype_t) 6) ! 276: #define CPU_SUBTYPE_POWERPC_604e ((cpu_subtype_t) 7) ! 277: #define CPU_SUBTYPE_POWERPC_620 ((cpu_subtype_t) 8) ! 278: #define CPU_SUBTYPE_POWERPC_750 ((cpu_subtype_t) 9) ! 279: ! 280: #endif /* _MACH_MACHINE_H_ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.