1 /+ sed -e 's///g' -e 's///g' -e 's///g' +/ 2 module tango.sys.darwin.consts.machine; 3 alias int cpu_type_t; 4 alias int cpu_subtype_t; 5 alias int cpu_threadtype_t; 6 enum{ 7 CPU_STATE_MAX = 4, 8 CPU_STATE_USER = 0 , 9 CPU_STATE_SYSTEM = 1, 10 CPU_STATE_IDLE = 2 , 11 CPU_STATE_NICE = 3 , 12 /* 13 * Capability bits used in the definition of cpu_type. 14 */ 15 CPU_ARCH_MASK = 0xff000000 , /* mask for architecture bits */ 16 CPU_ARCH_ABI64 = 0x01000000, /* 64 bit ABI */ 17 /* 18 * Machine types known by all. 19 */ 20 CPU_TYPE_ANY = ( -1), 21 CPU_TYPE_VAX = ( 1) , 22 CPU_TYPE_MC680x0 = ( 6) , 23 CPU_TYPE_X86 = ( 7) , 24 CPU_TYPE_I386 = ( 7) , /* compatibility */ 25 CPU_TYPE_X86_64 = (( 7) | 0x01000000) , 26 /* skip CPU_TYPE_MIPS ( 8) */ 27 CPU_TYPE_MC98000 = ( 10), 28 CPU_TYPE_HPPA = ( 11) , 29 CPU_TYPE_ARM = ( 12) , 30 CPU_TYPE_MC88000 = ( 13), 31 CPU_TYPE_SPARC = ( 14) , 32 CPU_TYPE_I860 = ( 15) , 33 /* skip CPU_TYPE_ALPHA ( 16) */ 34 CPU_TYPE_POWERPC = ( 18) , 35 CPU_TYPE_POWERPC64 = (( 18) | 0x01000000) , 36 /* 37 * Machine subtypes (these are defined here, instead of in a machine 38 * dependent directory, so that any program can get all definitions 39 * regardless of where is it compiled). 40 */ 41 /* 42 * Capability bits used in the definition of cpu_subtype. 43 */ 44 CPU_SUBTYPE_MASK = 0xff000000 , /* mask for feature flags */ 45 CPU_SUBTYPE_LIB64 = 0x80000000, /* 64 bit libraries */ 46 /* 47 * Object files that are hand-crafted to run on any 48 * implementation of an architecture are tagged with 49 * CPU_SUBTYPE_MULTIPLE. This functions essentially the same as 50 * the "ALL" subtype of an architecture except that it allows us 51 * to easily find object files that may need to be modified 52 * whenever a new implementation of an architecture comes out. 53 * 54 * It is the responsibility of the implementor to make sure the 55 * software handles unsupported implementations elegantly. 56 */ 57 CPU_SUBTYPE_MULTIPLE = ( -1) , 58 CPU_SUBTYPE_LITTLE_ENDIAN = ( 0) , 59 CPU_SUBTYPE_BIG_ENDIAN = ( 1) , 60 /* 61 * Machine threadtypes. 62 * This is none - not defined - for most machine types/subtypes. 63 */ 64 CPU_THREADTYPE_NONE = ( 0), 65 /* 66 * VAX subtypes (these do *not* necessary conform to the actual cpu 67 * ID assigned by DEC available via the SID register). 68 */ 69 CPU_SUBTYPE_VAX_ALL = ( 0) , 70 CPU_SUBTYPE_VAX780 = ( 1) , 71 CPU_SUBTYPE_VAX785 = ( 2) , 72 CPU_SUBTYPE_VAX750 = ( 3) , 73 CPU_SUBTYPE_VAX730 = ( 4) , 74 CPU_SUBTYPE_UVAXI = ( 5) , 75 CPU_SUBTYPE_UVAXII = ( 6) , 76 CPU_SUBTYPE_VAX8200 = ( 7) , 77 CPU_SUBTYPE_VAX8500 = ( 8) , 78 CPU_SUBTYPE_VAX8600 = ( 9) , 79 CPU_SUBTYPE_VAX8650 = ( 10) , 80 CPU_SUBTYPE_VAX8800 = ( 11) , 81 CPU_SUBTYPE_UVAXIII = ( 12) , 82 /* 83 * 680x0 subtypes 84 * 85 * The subtype definitions here are unusual for historical reasons. 86 * NeXT used to consider 68030 code as generic 68000 code. For 87 * backwards compatability: 88 * 89 * CPU_SUBTYPE_MC68030 symbol has been preserved for source code 90 * compatability. 91 * 92 * CPU_SUBTYPE_MC680x0_ALL has been defined to be the same 93 * subtype as CPU_SUBTYPE_MC68030 for binary comatability. 94 * 95 * CPU_SUBTYPE_MC68030_ONLY has been added to allow new object 96 * files to be tagged as containing 68030-specific instructions. 97 */ 98 CPU_SUBTYPE_MC680x0_ALL = ( 1) , 99 CPU_SUBTYPE_MC68030 = ( 1) ,/* compat */ 100 CPU_SUBTYPE_MC68040 = ( 2) , 101 CPU_SUBTYPE_MC68030_ONLY = ( 3) , 102 /* 103 * I386 subtypes 104 */ 105 CPU_SUBTYPE_I386_ALL = ( (3) + ((0) << 4)) , 106 CPU_SUBTYPE_386 = ( (3) + ((0) << 4)) , 107 CPU_SUBTYPE_486 = ( (4) + ((0) << 4)) , 108 CPU_SUBTYPE_486SX = ( (4) + ((8) << 4)) , 109 CPU_SUBTYPE_586 = ( (5) + ((0) << 4)) , 110 CPU_SUBTYPE_PENT = ( (5) + ((0) << 4)) , 111 CPU_SUBTYPE_PENTPRO = ( (6) + ((1) << 4)) , 112 CPU_SUBTYPE_PENTII_M3 = ( (6) + ((3) << 4)) , 113 CPU_SUBTYPE_PENTII_M5 = ( (6) + ((5) << 4)) , 114 CPU_SUBTYPE_CELERON = ( (7) + ((6) << 4)) , 115 CPU_SUBTYPE_CELERON_MOBILE = ( (7) + ((7) << 4)) , 116 CPU_SUBTYPE_PENTIUM_3 = ( (8) + ((0) << 4)) , 117 CPU_SUBTYPE_PENTIUM_3_M = ( (8) + ((1) << 4)) , 118 CPU_SUBTYPE_PENTIUM_3_XEON = ( (8) + ((2) << 4)) , 119 CPU_SUBTYPE_PENTIUM_M = ( (9) + ((0) << 4)) , 120 CPU_SUBTYPE_PENTIUM_4 = ( (10) + ((0) << 4)) , 121 CPU_SUBTYPE_PENTIUM_4_M = ( (10) + ((1) << 4)) , 122 CPU_SUBTYPE_ITANIUM = ( (11) + ((0) << 4)) , 123 CPU_SUBTYPE_ITANIUM_2 = ( (11) + ((1) << 4)) , 124 CPU_SUBTYPE_XEON = ( (12) + ((0) << 4)) , 125 CPU_SUBTYPE_XEON_MP = ( (12) + ((1) << 4)) , 126 } 127 uint extractSubtypeFamily(uint x){ 128 return ((x) & 15); 129 } 130 uint extractCpuSubtypeModel(uint x){ 131 return ((x) >> 4); 132 } 133 enum{ 134 CPU_SUBTYPE_INTEL_FAMILY_MAX = 15, 135 CPU_SUBTYPE_INTEL_MODEL_ALL = 0, 136 /* 137 * X86 subtypes. 138 */ 139 CPU_SUBTYPE_X86_ALL = (3) , 140 CPU_SUBTYPE_X86_64_ALL = (3) , 141 CPU_SUBTYPE_X86_ARCH1 = (4) , 142 CPU_THREADTYPE_INTEL_HTT = ( 1) , 143 /* 144 * Mips subtypes. 145 */ 146 CPU_SUBTYPE_MIPS_ALL = ( 0) , 147 CPU_SUBTYPE_MIPS_R2300 = ( 1) , 148 CPU_SUBTYPE_MIPS_R2600 = ( 2) , 149 CPU_SUBTYPE_MIPS_R2800 = ( 3) , 150 CPU_SUBTYPE_MIPS_R2000a = ( 4) , /* pmax */ 151 CPU_SUBTYPE_MIPS_R2000 = ( 5) , 152 CPU_SUBTYPE_MIPS_R3000a = ( 6) , /* 3max */ 153 CPU_SUBTYPE_MIPS_R3000 = ( 7) , 154 /* 155 * MC98000 (PowerPC) subtypes 156 */ 157 CPU_SUBTYPE_MC98000_ALL = ( 0) , 158 CPU_SUBTYPE_MC98601 = ( 1) , 159 /* 160 * HPPA subtypes for Hewlett-Packard HP-PA family of 161 * risc processors. Port by NeXT to 700 series. 162 */ 163 CPU_SUBTYPE_HPPA_ALL = ( 0) , 164 CPU_SUBTYPE_HPPA_7100 = ( 0) , /* compat */ 165 CPU_SUBTYPE_HPPA_7100LC = ( 1), 166 /* 167 * MC88000 subtypes. 168 */ 169 CPU_SUBTYPE_MC88000_ALL = ( 0) , 170 CPU_SUBTYPE_MC88100 = ( 1) , 171 CPU_SUBTYPE_MC88110 = ( 2) , 172 /* 173 * SPARC subtypes 174 */ 175 CPU_SUBTYPE_SPARC_ALL = ( 0) , 176 /* 177 * I860 subtypes 178 */ 179 CPU_SUBTYPE_I860_ALL = ( 0), 180 CPU_SUBTYPE_I860_860 = ( 1), 181 /* 182 * PowerPC subtypes 183 */ 184 CPU_SUBTYPE_POWERPC_ALL = ( 0) , 185 CPU_SUBTYPE_POWERPC_601 = ( 1) , 186 CPU_SUBTYPE_POWERPC_602 = ( 2) , 187 CPU_SUBTYPE_POWERPC_603 = ( 3) , 188 CPU_SUBTYPE_POWERPC_603e = ( 4) , 189 CPU_SUBTYPE_POWERPC_603ev = ( 5) , 190 CPU_SUBTYPE_POWERPC_604 = ( 6) , 191 CPU_SUBTYPE_POWERPC_604e = ( 7) , 192 CPU_SUBTYPE_POWERPC_620 = ( 8) , 193 CPU_SUBTYPE_POWERPC_750 = ( 9) , 194 CPU_SUBTYPE_POWERPC_7400 = ( 10) , 195 CPU_SUBTYPE_POWERPC_7450 = ( 11) , 196 CPU_SUBTYPE_POWERPC_970 = ( 100) , 197 /* 198 * ARM subtypes 199 */ 200 CPU_SUBTYPE_ARM_ALL = ( 0), 201 CPU_SUBTYPE_ARM_V4T = ( 5), 202 CPU_SUBTYPE_ARM_V6 = ( 6) , 203 /* 204 * CPU families (sysctl hw.cpufamily) 205 * 206 * These are meant to identify the CPU's marketing name - an 207 * application can map these to (possibly) localized strings. 208 * NB: the encodings of the CPU families are intentionally arbitrary. 209 * There is no ordering, and you should never try to deduce whether 210 * or not some feature is available based on the family. 211 * Use feature flags (eg, hw.optional.altivec) to test for optional 212 * functionality. 213 */ 214 CPUFAMILY_UNKNOWN = 0 , 215 CPUFAMILY_POWERPC_G3 = 0xcee41549 , 216 CPUFAMILY_POWERPC_G4 = 0x77c184ae , 217 CPUFAMILY_POWERPC_G5 = 0xed76d8aa , 218 CPUFAMILY_INTEL_6_13 = 0xaa33392b , 219 CPUFAMILY_INTEL_6_14 = 0x73d67300 ,/* " Core Solo" and " Core Duo" (32-bit Pentium-M with SSE3) */ 220 CPUFAMILY_INTEL_6_15 = 0x426f69ef ,/* " Core 2 Duo" */ 221 CPUFAMILY_INTEL_6_23 = 0x78ea4fbc ,/* Penryn */ 222 CPUFAMILY_INTEL_6_26 = 0x6b5a4cd2 ,/* Nehalem */ 223 CPUFAMILY_ARM_9 = 0xe73283ae , 224 CPUFAMILY_ARM_11 = 0x8ff620d8 , 225 CPUFAMILY_INTEL_YONAH = 0x73d67300 , 226 CPUFAMILY_INTEL_MEROM = 0x426f69ef , 227 CPUFAMILY_INTEL_PENRYN = 0x78ea4fbc , 228 CPUFAMILY_INTEL_NEHALEM = 0x6b5a4cd2 , 229 CPUFAMILY_INTEL_CORE = 0x73d67300 , 230 CPUFAMILY_INTEL_CORE2 = 0x426f69ef , 231 }