OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
AppleIntelCpuInfo.h
Go to the documentation of this file.
1
13#ifndef APPLE_INTEL_CPU_INFO_H
14#define APPLE_INTEL_CPU_INFO_H
15
21
22/*
23 * CPU families (sysctl hw.cpufamily)
24 *
25 * These are meant to identify the CPU's marketing name - an
26 * application can map these to (possibly) localized strings.
27 * Note: the encodings of the CPU families are intentionally arbitrary.
28 * There is no ordering, and you should never try to deduce whether
29 * or not some feature is available based on the family.
30 * Use feature flags (eg, hw.optional.altivec) to test for optional
31 * functionality.
32 */
33#define CPUFAMILY_UNKNOWN 0
34#define CPUFAMILY_INTEL_6_13 0xaa33392b
35#define CPUFAMILY_INTEL_PENRYN 0x78ea4fbc
36#define CPUFAMILY_INTEL_NEHALEM 0x6b5a4cd2
37#define CPUFAMILY_INTEL_WESTMERE 0x573b5eec
38#define CPUFAMILY_INTEL_SANDYBRIDGE 0x5490b78c
39#define CPUFAMILY_INTEL_IVYBRIDGE 0x1f65e835
40#define CPUFAMILY_INTEL_HASWELL 0x10b282dc
41#define CPUFAMILY_INTEL_BROADWELL 0x582ed09c
42#define CPUFAMILY_INTEL_SKYLAKE 0x37fc219f
43#define CPUFAMILY_INTEL_KABYLAKE 0x0f817246
44#define CPUFAMILY_INTEL_ICELAKE 0x38435547
45
46/* CPU type, integer_t */
47typedef INT32 cpu_type_t;
48typedef INT32 cpu_subtype_t;
49
50/*
51 * Cache ID descriptor structure, used to parse CPUID leaf 2.
52 * Note: not used in kernel.
53 */
58
59typedef struct {
60 UINT8 value; /* Descriptor value */
61 cache_type_t type; /* Cache type */
62 UINT32 size; /* Cache size */
63 UINT32 linesize; /* Cache line size */
64 CONST CHAR8 *description; /* Cache description */
66
67/* Monitor/mwait Leaf: */
68typedef struct {
71 UINT32 extensions;
74
75/* Thermal and Power Management Leaf: */
88
89/* XSAVE Feature Leaf: */
90typedef struct {
91 UINT32 extended_state[4]; /* eax .. edx */
93
94/* Architectural Performance Monitoring Leaf: */
95typedef struct {
96 UINT8 version;
97 UINT8 number;
98 UINT8 width;
100 UINT32 events;
104
105/* The TSC to Core Crystal (RefCLK) Clock Information leaf */
106typedef struct {
107 UINT32 numerator;
110
111/* Physical CPU info - this is exported out of the kernel (kexts), so be wary of changes */
112typedef struct {
113 CHAR8 cpuid_vendor[16];
114 CHAR8 cpuid_brand_string[48];
115 CONST CHAR8 *cpuid_model_string;
116
117 cpu_type_t cpuid_type; /* this is *not* a cpu_type_t in our <mach/machine.h> */
128
129 UINT32 cache_size[LCACHE_MAX];
131
132 UINT8 cache_info[64]; /* list of cache descriptors */
133
136 UINT32 cache_sharing[LCACHE_MAX];
137 UINT32 cache_partitions[LCACHE_MAX];
138
139 cpu_type_t cpuid_cpu_type; /* <mach/machine.h> */
140 cpu_subtype_t cpuid_cpu_subtype; /* <mach/machine.h> */
141
142 /* Per-vendor info */
144 #define cpuid_mwait_linesize_max cpuid_mwait_leaf.linesize_max
145 #define cpuid_mwait_linesize_min cpuid_mwait_leaf.linesize_min
146 #define cpuid_mwait_extensions cpuid_mwait_leaf.extensions
147 #define cpuid_mwait_sub_Cstates cpuid_mwait_leaf.sub_Cstates
150 UINT32 unused[4]; /* cpuid_xsave_leaf */
151
152 /* Cache details: */
156
157 /* Virtual and physical address aize: */
160
162
163 /* Numbers of tlbs per processor [i|d, small|large, level0|level1] */
164 UINT32 cpuid_tlb[2][2][2];
165 #define TLB_INST 0
166 #define TLB_DATA 1
167 #define TLB_SMALL 0
168 #define TLB_LARGE 1
170
173
174 /* Max leaf ids available from CPUID */
177
178 /* Family-specific info links */
186 cpuid_xsave_leaf_t cpuid_xsave_leaf[2];
188
190
191#endif // APPLE_INTEL_CPU_INFO_H
cache_type_t
@ Lnone
@ LCACHE_MAX
cache_type_t APPLE_INTEL_CPU_CACHE_TYPE
INT32 cpu_type_t
i386_cpu_info_t APPLE_INTEL_CPU_INFO
INT32 cpu_subtype_t
CONST CHAR8 * description
cpuid_mwait_leaf_t * cpuid_mwait_leafp
CONST CHAR8 * cpuid_model_string
UINT32 cpuid_address_bits_virtual
cpuid_arch_perf_leaf_t * cpuid_arch_perf_leafp
cpuid_tsc_leaf_t cpuid_tsc_leaf
cpuid_thermal_leaf_t cpuid_thermal_leaf
UINT32 cpuid_address_bits_physical
cpuid_thermal_leaf_t * cpuid_thermal_leafp
cpuid_arch_perf_leaf_t cpuid_arch_perf_leaf
UINT32 cpuid_cache_L2_associativity
cpu_subtype_t cpuid_cpu_subtype
cpuid_mwait_leaf_t cpuid_mwait_leaf
cpuid_xsave_leaf_t * cpuid_xsave_leafp
cpu_type_t cpuid_cpu_type