2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
33 * x86 CPU identification
37 #ifndef _MACHINE_CPUID_H_
38 #define _MACHINE_CPUID_H_
40 #include <sys/appleapiopts.h>
42 #ifdef __APPLE_API_PRIVATE
44 #define CPUID_VID_SIZE 12
45 #define CPUID_VID_INTEL "GenuineIntel"
46 #define CPUID_VID_UMC "UMC UMC UMC "
47 #define CPUID_VID_AMD "AuthenticAMD"
48 #define CPUID_VID_CYRIX "CyrixInstead"
49 #define CPUID_VID_NEXGEN "NexGenDriven"
50 #define CPUID_VID_CENTAUR "CentaurHauls"
51 #define CPUID_VID_RISE "RiseRiseRise"
52 #define CPUID_VID_SIS "SiS SiS SiS "
53 #define CPUID_VID_TRANSMETA "GenuineTMx86"
54 #define CPUID_VID_NSC "Geode by NSC"
56 #define CPUID_STRING_UNKNOWN "Unknown CPU Typ"
58 #define _Bit(n) (1ULL << n)
59 #define _HBit(n) (1ULL << ((n)+32))
62 * The CPUID_FEATURE_XXX values define 64-bit values
63 * returned in %ecx:%edx to a CPUID request with %eax of 1:
65 #define CPUID_FEATURE_FPU _Bit(0) /* Floating point unit on-chip */
66 #define CPUID_FEATURE_VME _Bit(1) /* Virtual Mode Extension */
67 #define CPUID_FEATURE_DE _Bit(2) /* Debugging Extension */
68 #define CPUID_FEATURE_PSE _Bit(3) /* Page Size Extension */
69 #define CPUID_FEATURE_TSC _Bit(4) /* Time Stamp Counter */
70 #define CPUID_FEATURE_MSR _Bit(5) /* Model Specific Registers */
71 #define CPUID_FEATURE_PAE _Bit(6) /* Physical Address Extension */
72 #define CPUID_FEATURE_MCE _Bit(7) /* Machine Check Exception */
73 #define CPUID_FEATURE_CX8 _Bit(8) /* CMPXCHG8B */
74 #define CPUID_FEATURE_APIC _Bit(9) /* On-chip APIC */
75 #define CPUID_FEATURE_SEP _Bit(11) /* Fast System Call */
76 #define CPUID_FEATURE_MTRR _Bit(12) /* Memory Type Range Register */
77 #define CPUID_FEATURE_PGE _Bit(13) /* Page Global Enable */
78 #define CPUID_FEATURE_MCA _Bit(14) /* Machine Check Architecture */
79 #define CPUID_FEATURE_CMOV _Bit(15) /* Conditional Move Instruction */
80 #define CPUID_FEATURE_PAT _Bit(16) /* Page Attribute Table */
81 #define CPUID_FEATURE_PSE36 _Bit(17) /* 36-bit Page Size Extension */
82 #define CPUID_FEATURE_PSN _Bit(18) /* Processor Serial Number */
83 #define CPUID_FEATURE_CLFSH _Bit(19) /* CLFLUSH Instruction supported */
84 #define CPUID_FEATURE_DS _Bit(21) /* Debug Store */
85 #define CPUID_FEATURE_ACPI _Bit(22) /* Thermal monitor and Clock Ctrl */
86 #define CPUID_FEATURE_MMX _Bit(23) /* MMX supported */
87 #define CPUID_FEATURE_FXSR _Bit(24) /* Fast floating pt save/restore */
88 #define CPUID_FEATURE_SSE _Bit(25) /* Streaming SIMD extensions */
89 #define CPUID_FEATURE_SSE2 _Bit(26) /* Streaming SIMD extensions 2 */
90 #define CPUID_FEATURE_SS _Bit(27) /* Self-Snoop */
91 #define CPUID_FEATURE_HTT _Bit(28) /* Hyper-Threading Technology */
92 #define CPUID_FEATURE_TM _Bit(29) /* Thermal Monitor (TM1) */
93 #define CPUID_FEATURE_PBE _Bit(31) /* Pend Break Enable */
95 #define CPUID_FEATURE_SSE3 _HBit(0) /* Prescott New Inst. */
96 #define CPUID_FEATURE_MONITOR _HBit(3) /* Monitor/mwait */
97 #define CPUID_FEATURE_DSCPL _HBit(4) /* Debug Store CPL */
98 #define CPUID_FEATURE_VMX _HBit(5) /* VMX */
99 #define CPUID_FEATURE_SMX _HBit(6) /* SMX */
100 #define CPUID_FEATURE_EST _HBit(7) /* Enhanced SpeedsTep (GV3) */
101 #define CPUID_FEATURE_TM2 _HBit(8) /* Thermal Monitor 2 */
102 #define CPUID_FEATURE_SSSE3 _HBit(9) /* Supplemental SSE3 instructions */
103 #define CPUID_FEATURE_MNI CPUID_FEATURE_SSSE3
104 #define CPUID_FEATURE_CID _HBit(10) /* L1 Context ID */
105 #define CPUID_FEATURE_CX16 _HBit(13) /* CmpXchg16b instruction */
106 #define CPUID_FEATURE_xTPR _HBit(14) /* Send Task PRiority msgs */
109 * The CPUID_EXTFEATURE_XXX values define 64-bit values
110 * returned in %ecx:%edx to a CPUID request with %eax of 0x80000001:
112 #define CPUID_EXTFEATURE_SYSCALL _Bit(11) /* SYSCALL/sysret */
113 #define CPUID_EXTFEATURE_XD _Bit(20) /* eXecute Disable */
114 #define CPUID_EXTFEATURE_EM64T _Bit(29) /* Extended Mem 64 Technology */
116 #define CPUID_EXTFEATURE_LAHF _HBit(20) /* LAFH/SAHF instructions */
119 #define CPUID_TYPE_OEM 0x0 /* Original processor */
120 #define CPUID_TYPE_OVERDRIVE 0x1 /* Overdrive processor */
121 #define CPUID_TYPE_DUAL 0x2 /* Can be used as dual processor */
122 #define CPUID_TYPE_RESERVED 0x3 /* Reserved */
124 #define CPUID_FAMILY_386 0x3 /* Intel 386 (not part of CPUID) */
126 #define CPUID_MODEL_I386_DX 0x0 /* Intel 386 (not part of CPUID) */
128 #define CPUID_FAMILY_486 0x4 /* Intel 486 */
130 #define CPUID_MODEL_I486_DX 0x0 /* Intel 486DX */
131 #define CPUID_MODEL_I486_DX_S 0x1 /* Intel 486DX-S */
132 #define CPUID_MODEL_I486_SX 0x2 /* Intel 486SX */
133 #define CPUID_MODEL_I486_DX2 0x3 /* Intel 486DX2 */
134 #define CPUID_MODEL_I486_SL 0x4 /* Intel 486SL */
135 #define CPUID_MODEL_I486_SX2 0x5 /* Intel 486SX2 */
136 #define CPUID_MODEL_I486_DX2WB 0x7 /* Intel 486DX2WB */
137 #define CPUID_MODEL_I486_DX4 0x8 /* Intel 486DX4 */
138 #define CPUID_MODEL_I486_DX4WB 0x9 /* Intel 486DX4WB */
140 #define CPUID_MODEL_AM486_DX 0x1 /* AMD 486DX */
141 #define CPUID_MODEL_AM486_DX2 0x3 /* AMD 486DX2 */
142 #define CPUID_MODEL_AM486_DX2WB 0x7 /* AMD 486DX2WB */
143 #define CPUID_MODEL_AM486_DX4 0x8 /* AMD 486DX4 */
144 #define CPUID_MODEL_AM486_DX4WB 0x9 /* AMD 486DX4WB */
145 #define CPUID_MODEL_AM486_5X86 0xE /* AMD 5x86 */
146 #define CPUID_MODEL_AM486_5X86WB 0xF /* AMD 5x86WB */
148 #define CPUID_MODEL_MEDIAGX 0x4 /* Cyrix MediaGX */
149 #define CPUID_MODEL_CYRIX5X86 0x9 /* CYRIX 5X86 */
151 #define CPUID_FAMILY_586 0x5 /* Intel Pentium, AMD K5/K6*/
153 #define CPUID_MODEL_UMC5D 0x1 /* UMC U5D */
154 #define CPUID_MODEL_UMC5S 0x2 /* UMC U5S */
155 #define CPUID_MODEL_UMC486_DX2 0x3 /* UMC U486_DX2 */
156 #define CPUID_MODEL_UMC486_SX2 0x5 /* UMC U486_SX2 */
158 #define CPUID_MODEL_P5A 0x0 /* Intel P5 60/66 Step A */
159 #define CPUID_MODEL_P5 0x1 /* Intel P5 60/66 */
160 #define CPUID_MODEL_P54 0x2 /* Intel P5 75/80/100/120/133/166 */
161 #define CPUID_MODEL_P24T 0x3 /* Intel P5 Overdrive 63/83 */
163 #define CPUID_MODEL_K5M0 0x0 /* AMD-K5 Model 0 */
164 #define CPUID_MODEL_K5M1 0x1 /* AMD-K5 Model 1 */
165 #define CPUID_MODEL_K5M2 0x2 /* AMD-K5 Model 2 */
166 #define CPUID_MODEL_K5M3 0x3 /* AMD-K5 Model 3 */
167 #define CPUID_MODEL_K6M6 0x6 /* AMD-K6 Model 6 */
168 #define CPUID_MODEL_K6M7 0x7 /* AMD-K6 Model 7 */
169 #define CPUID_MODEL_K6_2 0x8 /* AMD-K6-2 Model 8 */
170 #define CPUID_MODEL_K6_III 0x9 /* AMD-K6-III Model 9 */
172 #define CPUID_MODEL_CYRIX_M1 0x2 /* Cyrix M1 */
173 #define CPUID_MODEL_MEDIAGX_MMX 0x4 /* Cyrix MediaGX MMX Enhanced */
175 #define CPUID_FAMILY_686 0x6 /* Intel Pentium Pro, II, III; AMD Athlon */
177 #define CPUID_MODEL_P6 0x1 /* Intel P6 */
178 #define CPUID_MODEL_PII 0x3 /* Intel PII */
179 #define CPUID_MODEL_P65 0x5 /* Intel PII/Xeon/Celeron model 5 */
180 #define CPUID_MODEL_P66 0x6 /* Intel Celeron model 6 */
181 #define CPUID_MODEL_P67 0x7 /* Intel PIII/Xeon model 7 */
182 #define CPUID_MODEL_P68 0x8 /* Intel PIII/Xeon/Celeron model 8 */
183 #define CPUID_MODEL_PM9 0x9 /* Intel Pentium M model 9 */
184 #define CPUID_MODEL_P6A 0xA /* Intel PIII Xeon model A */
185 #define CPUID_MODEL_P6B 0xB /* Intel PIII model B */
186 #define CPUID_MODEL_PMD 0xD /* Intel Pentium M model D */
187 #define CPUID_MODEL_CORE 0xE /* Intel Core Solo & Duo */
188 #define CPUID_MODEL_CORE2 0xF /* Intel Core2 Duo */
190 #define CPUID_MODEL_ATHLON_M1 0x1 /* AMD Athlon Model 1 */
191 #define CPUID_MODEL_ATHLON_M2 0x2 /* AMD Athlon Model 2 */
192 #define CPUID_MODEL_DURON_M3 0x3 /* AMD Duron Model 3 */
193 #define CPUID_MODEL_ATHLON_M4 0x4 /* AMD Athlon Model 4 */
194 #define CPUID_MODEL_ATHLON_M6 0x6 /* (Mobile) AMD Athlon/Duron MP/XP/4 Model 6 */
195 #define CPUID_MODEL_DURON_M7 0x7 /* (Mobile) AMD Duron Model 7 */
196 #define CPUID_MODEL_ATHLON_M8 0x8 /* (Mobile) Athlon XP/MP/XP-M Model 8 */
197 #define CPUID_MODEL_ATHLON_M10 0xA /* (Mobile) AMD Athlon XP/MP/XP-M/XP-M(LV) Model 10 */
199 #define CPUID_MODEL_CYRIX_M2 0x0 /* Cyrix M2 */
200 #define CPUID_MODEL_CYRIX_MII 0x2 /* VIA Cyrix MII (6x86MX) */
201 #define CPUID_MODEL_VIA_CYRIX_M2 0x5 /* VIA C3 Cyrix M2 */
202 #define CPUID_MODEL_WINCHIP_C5A 0x6 /* VIA C3 WinChip C5A */
203 #define CPUID_MODEL_WINCHIP_C5BC 0x7 /* VIA C3 WinChip C5B/C5C */
204 #define CPUID_MODEL_WINCHIP_C5N 0x8 /* VIA C3 WinChip C5N */
205 #define CPUID_MODEL_WINCHIP_C5XLP 0x9 /* VIA C3 WinChip C5P */
207 #define CPUID_MODEL_NX586 0x0 /* NexGen Nx586 */
209 #define CPUID_MODEL_RISE_MP6_0 0x0 /* Rise mP6 */
210 #define CPUID_MODEL_RISE_MP6_2 0x2 /* Rise mP6 */
212 #define CPUID_MODEL_SIS_55X 0x0 /* SIS 55x */
214 #define CPUID_MODEL_TM_CRUSOE 0x4 /* Transmeta Crusoe TM3x00 and TM5x00 */
216 #define CPUID_MODEL_CENTAUR_C6 0x4 /* Centaur C6 */
217 #define CPUID_MODEL_CENTAUR_C2 0x8 /* Centaur C2 */
218 #define CPUID_MODEL_CENTAUR_C3 0x9 /* Centaur C3 */
220 #define CPUID_MODEL_GX1 0x4 /* AMD Geode GX1 */
221 #define CPUID_MODEL_GX2 0x5 /* AMD Geode GX */
223 #define CPUID_FAMILY_ITANIUM 0x7 /* Intel Intanium */
224 #define CPUID_FAMILY_EXTENDED 0xF /* Intel Pentium 4, Itanium II */
226 #define CPUID_EXTFAMILY_PENTIUM4 0x0 /* Intel Pentium 4 */
227 #define CPUID_EXTFAMILY_ITANIUM2 0x1 /* Intel Itanium 2 */
229 #define CPUID_MODEL_ATHLON64 0x4 /* AMD Athlon 64 Model 4 */
230 #define CPUID_MODEL_OPTERON 0x5 /* AMD Opteron Model 4 */
232 #define CPUID_BRAND_UNSUPPORTED 0x00
233 #define CPUID_BRAND_CELERON_1 0x01 /* Intel Celeron */
234 #define CPUID_BRAND_PENTIUM_III_2 0x02 /* Intel Pentium III */
235 #define CPUID_BRAND_PIII_XEON 0x03 /* Intel Pentium III Xeon / Celeron */
236 #define CPUID_BRAND_PENTIUM_III_4 0x04 /* Intel Pentium III */
237 #define CPUID_BRAND_PENTIUM_III_M 0x05 /* Mobile Intel Pentium III-M */
238 #define CPUID_BRAND_M_CELERON_7 0x07 /* Mobile Intel Celeron */
239 #define CPUID_BRAND_PENTIUM4_8 0x08 /* Intel Pentium 4 */
240 #define CPUID_BRAND_PENTIUM4_9 0x09 /* Intel Pentium 4 */
241 #define CPUID_BRAND_CELERON_A 0x0A /* Intel Celeron */
242 #define CPUID_BRAND_XEON 0x0B /* Intel Xeon (MP) */
243 #define CPUID_BRAND_XEON_MP 0x0C /* Intel Xeon MP */
244 #define CPUID_BRAND_PENTIUM4_M 0x0E /* Mobile Intel Pentium 4-M / Xeon */
245 #define CPUID_BRAND_M_CELERON_F 0x0F /* Mobile Intel Celeron */
246 #define CPUID_BRAND_MOBILE_17 0x11 /* Mobile Genuine Intel */
247 #define CPUID_BRAND_CELERON_M 0x12 /* Intel Celeron M */
248 #define CPUID_BRAND_M_CELERON_13 0x13 /* Mobile Intel Celeron */
249 #define CPUID_BRAND_CELERON_14 0x14 /* Intel Celeron */
250 #define CPUID_BRAND_MOBILE_15 0x15 /* Mobile Genuine Intel */
251 #define CPUID_BRAND_PENTIUM_M 0x16 /* Intel Pentium M */
252 #define CPUID_BRAND_M_CELERON_17 0x17 /* Mobile Intel Celeron */
254 #define CPUID_CACHE_SIZE 16 /* Number of descriptor vales */
256 #define CPUID_CACHE_NULL 0x00 /* NULL */
257 #define CPUID_CACHE_ITLB_4K 0x01 /* Instruction TLB, 4K pages */
258 #define CPUID_CACHE_ITLB_4M 0x02 /* Instruction TLB, 4M pages */
259 #define CPUID_CACHE_DTLB_4K 0x03 /* Data TLB, 4K pages */
260 #define CPUID_CACHE_DTLB_4M 0x04 /* Data TLB, 4M pages */
261 #define CPUID_CACHE_ICACHE_8K 0x06 /* Instruction cache, 8K */
262 #define CPUID_CACHE_ICACHE_16K 0x08 /* Instruction cache, 16K */
263 #define CPUID_CACHE_DCACHE_8K 0x0A /* Data cache, 8K */
264 #define CPUID_CACHE_DCACHE_16K 0x0C /* Data cache, 16K */
265 #define CPUID_CACHE_L3CACHE_512K 0x22 /* 3rd-level cache, 512K */
266 #define CPUID_CACHE_L3CACHE_1M 0x23 /* 3rd-level cache, 1M */
267 #define CPUID_CACHE_L3CACHE_2M 0x25 /* 3rd-level cache, 2M */
268 #define CPUID_CACHE_L3CACHE_4M 0x29 /* 3rd-level cache, 4M */
269 #define CPUID_CACHE_DCACHE_32K 0x2C /* Data cache, 32K, 8-way */
270 #define CPUID_CACHE_ICACHE_32K 0x30 /* Instruction cache, 32K, 8-way */
271 #define CPUID_CACHE_UCACHE_128K_S4 0x39 /* 2nd-level cache, 128K, 4-way, sectored */
272 #define CPUID_CACHE_UCACHE_128K_S2 0x3B /* 2nd-level cache, 128K, 2-way, sectored */
273 #define CPUID_CACHE_UCACHE_256K_S4 0x3C /* 2nd-level cache, 256K, 4-way, sectored */
274 #define CPUID_CACHE_NOCACHE 0x40 /* No 2nd level or 3rd-level cache */
275 #define CPUID_CACHE_UCACHE_128K 0x41 /* 2nd-level cache, 128K */
276 #define CPUID_CACHE_UCACHE_256K 0x42 /* 2nd-level cache, 256K */
277 #define CPUID_CACHE_UCACHE_512K 0x43 /* 2nd-level cache, 512K */
278 #define CPUID_CACHE_UCACHE_1M 0x44 /* 2nd-level cache, 1M */
279 #define CPUID_CACHE_UCACHE_2M 0x45 /* 2nd-level cache, 2M */
280 #define CPUID_CACHE_UCACHE_4M 0x49 /* 2nd-level cache, 4M */
281 #define CPUID_CACHE_ITLB_64 0x50 /* Instruction TLB, 64 entries */
282 #define CPUID_CACHE_ITLB_128 0x51 /* Instruction TLB, 128 entries */
283 #define CPUID_CACHE_ITLB_256 0x52 /* Instruction TLB, 256 entries */
284 #define CPUID_CACHE_DTLB_64 0x5B /* Data TLB, 64 entries */
285 #define CPUID_CACHE_DTLB_128 0x5C /* Data TLB, 128 entries */
286 #define CPUID_CACHE_DTLB_256 0x5D /* Data TLB, 256 entries */
287 #define CPUID_CACHE_DCACHE_16K_8 0x60 /* Data cache, 8K, 64 byte line size, 8-way */
288 #define CPUID_CACHE_DCACHE_8K_64 0x66 /* Data cache, 8K, 64 byte line size */
289 #define CPUID_CACHE_DCACHE_16K_64 0x67 /* Data cache, 16K, 64 byte line size */
290 #define CPUID_CACHE_DCACHE_32K_64 0x68 /* Data cache, 32K, 64 byte line size */
291 #define CPUID_CACHE_TRACE_12K 0x70 /* Trace cache 12K-uop, 8-way */
292 #define CPUID_CACHE_TRACE_16K 0x71 /* Trace cache 16K-uop, 8-way */
293 #define CPUID_CACHE_TRACE_32K 0x72 /* Trace cache 32K-uop, 8-way */
294 #define CPUID_CACHE_UCACHE_1M_64_4 0x78 /* 2nd-level, 1M, 4-way, 64 bytes */
295 #define CPUID_CACHE_UCACHE_128K_64 0x79 /* 2nd-level, 128K, 8-way, 64 bytes */
296 #define CPUID_CACHE_UCACHE_256K_64 0x7A /* 2nd-level, 256K, 8-way, 64 bytes */
297 #define CPUID_CACHE_UCACHE_512K_64 0x7B /* 2nd-level, 512K, 8-way, 64 bytes */
298 #define CPUID_CACHE_UCACHE_1M_64 0x7C /* 2nd-level, 1M, 8-way, 64 bytes */
299 #define CPUID_CACHE_UCACHE_2M_64 0x7D /* 2nd-level, 2M, 8-way, 64 bytes */
300 #define CPUID_CACHE_UCACHE_512K_64_2 0x7F /* 2nd-level, 512K, 2-way, 64 bytes */
301 #define CPUID_CACHE_UCACHE_256K_32 0x82 /* 2nd-level, 256K, 8-way, 32 bytes */
302 #define CPUID_CACHE_UCACHE_512K_32 0x83 /* 2nd-level, 512K, 8-way, 32 bytes */
303 #define CPUID_CACHE_UCACHE_1M_32 0x84 /* 2nd-level, 1M, 8-way, 32 bytes */
304 #define CPUID_CACHE_UCACHE_2M_32 0x85 /* 2nd-level, 2M, 8-way, 32 bytes */
305 #define CPUID_CACHE_UCACHE_512K_64_4 0x86 /* 2nd-level, 512K, 4-way, 64 bytes */
306 #define CPUID_CACHE_UCACHE_1M_64_8 0x87 /* 2nd-level, 1M, 8-way, 64 bytes */
307 #define CPUID_CACHE_ITLB_128_4 0xB0 /* Instruction TLB, 4-way, 128 entries */
308 #define CPUID_CACHE_DTLB_128_4 0xB3 /* Data TLB, 4-way, 128 entries */
309 #define CPUID_CACHE_PREFETCH_64 0xF0 /* 64-Byte Prefetching */
310 #define CPUID_CACHE_PREFETCH_128 0xF1 /* 128-Byte Prefetching */
314 #include <mach/mach_types.h>
315 #include <kern/kern_types.h>
316 #include <mach/machine.h>
319 typedef enum { eax
, ebx
, ecx
, edx
} cpuid_register_t
;
321 cpuid(uint32_t *data
)
334 do_cpuid(uint32_t selector
, uint32_t *data
)
345 * Cache ID descriptor structure.
346 * Note: description string absent in kernel.
348 typedef enum { Lnone
, L1I
, L1D
, L2U
, L3U
, LCACHE_MAX
} cache_type_t
;
350 unsigned char value
; /* Descriptor value */
351 cache_type_t type
; /* Cache type */
352 unsigned int size
; /* Cache size */
353 unsigned int linesize
; /* Cache line size */
355 const char *description
; /* Cache description */
357 } cpuid_cache_desc_t
;
360 #define CACHE_DESC(value,type,size,linesize,text) \
361 { value, type, size, linesize, text }
363 #define CACHE_DESC(value,type,size,linesize,text) \
364 { value, type, size, linesize }
367 /* Physical CPU info - this is exported out of the kernel (kexts), so be wary of changes */
369 char cpuid_vendor
[16];
370 char cpuid_brand_string
[48];
371 const char *cpuid_model_string
;
373 cpu_type_t cpuid_type
; /* this is *not* a cpu_type_t in our <mach/machine.h> */
374 uint8_t cpuid_family
;
376 uint8_t cpuid_extmodel
;
377 uint8_t cpuid_extfamily
;
378 uint8_t cpuid_stepping
;
379 uint64_t cpuid_features
;
380 uint64_t cpuid_extfeatures
;
381 uint32_t cpuid_signature
;
384 uint32_t cache_size
[LCACHE_MAX
];
385 uint32_t cache_linesize
;
387 uint8_t cache_info
[64]; /* list of cache descriptors */
389 uint32_t cpuid_cores_per_package
;
390 uint32_t cpuid_logical_per_package
;
391 uint32_t cache_sharing
[LCACHE_MAX
];
393 cpu_type_t cpuid_cpu_type
; /* <mach/machine.h> */
394 cpu_subtype_t cpuid_cpu_subtype
; /* <mach/machine.h> */
402 * External declarations
404 extern cpu_type_t
cpuid_cputype(void);
405 extern cpu_subtype_t
cpuid_cpusubtype(void);
406 extern void cpuid_cpu_display(const char *);
407 extern void cpuid_feature_display(const char *);
408 extern void cpuid_extfeature_display(const char *);
409 extern char * cpuid_get_feature_names(uint64_t, char *, unsigned);
410 extern char * cpuid_get_extfeature_names(uint64_t, char *, unsigned);
412 extern uint64_t cpuid_features(void);
413 extern uint64_t cpuid_extfeatures(void);
414 extern uint32_t cpuid_family(void);
416 extern void cpuid_get_info(i386_cpu_info_t
*info_p
);
417 extern i386_cpu_info_t
*cpuid_info(void);
419 extern void cpuid_set_info(void);
425 #endif /* ASSEMBLER */
427 #endif /* __APPLE_API_PRIVATE */
428 #endif /* _MACHINE_CPUID_H_ */