#define CPUID_MODEL_MEROM 15
#define CPUID_MODEL_PENRYN 23
#define CPUID_MODEL_NEHALEM 26
+#define CPUID_MODEL_ATOM 28
+#define CPUID_MODEL_FIELDS 30 /* Lynnfield, Clarksfield, Jasper */
+#define CPUID_MODEL_DALES 31 /* Havendale, Auburndale */
+#define CPUID_MODEL_NEHALEM_EX 46
#ifndef ASSEMBLER
#include <stdint.h>
{ value, type, size, linesize }
#endif /* KERNEL */
+/* Monitor/mwait Leaf: */
+typedef struct {
+ uint32_t linesize_min;
+ uint32_t linesize_max;
+ uint32_t extensions;
+ uint32_t sub_Cstates;
+} cpuid_mwait_leaf_t;
+
+/* Thermal and Power Management Leaf: */
+typedef struct {
+ boolean_t sensor;
+ boolean_t dynamic_acceleration;
+ uint32_t thresholds;
+ boolean_t ACNT_MCNT;
+} cpuid_thermal_leaf_t;
+
+/* Architectural Performance Monitoring Leaf: */
+typedef struct {
+ uint8_t version;
+ uint8_t number;
+ uint8_t width;
+ uint8_t events_number;
+ uint32_t events;
+ uint8_t fixed_number;
+ uint8_t fixed_width;
+} cpuid_arch_perf_leaf_t;
+
/* Physical CPU info - this is exported out of the kernel (kexts), so be wary of changes */
typedef struct {
char cpuid_vendor[16];
char cpuid_brand_string[48];
const char *cpuid_model_string;
- cpu_type_t cpuid_type; /* this is *not* a cpu_type_t in our <mach/machine.h> */
+ cpu_type_t cpuid_type; /* this is *not* a cpu_type_t in our <mach/machine.h> */
uint8_t cpuid_family;
uint8_t cpuid_model;
uint8_t cpuid_extmodel;
cpu_type_t cpuid_cpu_type; /* <mach/machine.h> */
cpu_subtype_t cpuid_cpu_subtype; /* <mach/machine.h> */
- /* Monitor/mwait Leaf: */
- uint32_t cpuid_mwait_linesize_min;
- uint32_t cpuid_mwait_linesize_max;
- uint32_t cpuid_mwait_extensions;
- uint32_t cpuid_mwait_sub_Cstates;
-
- /* Thermal and Power Management Leaf: */
- boolean_t cpuid_thermal_sensor;
- boolean_t cpuid_thermal_dynamic_acceleration;
- uint32_t cpuid_thermal_thresholds;
- boolean_t cpuid_thermal_ACNT_MCNT;
-
- /* Architectural Performance Monitoring Leaf: */
- uint8_t cpuid_arch_perf_version;
- uint8_t cpuid_arch_perf_number;
- uint8_t cpuid_arch_perf_width;
- uint8_t cpuid_arch_perf_events_number;
- uint32_t cpuid_arch_perf_events;
- uint8_t cpuid_arch_perf_fixed_number;
- uint8_t cpuid_arch_perf_fixed_width;
-
+ /* Per-vendor info */
+ cpuid_mwait_leaf_t cpuid_mwait_leaf;
+#define cpuid_mwait_linesize_max cpuid_mwait_leaf.linesize_max
+#define cpuid_mwait_linesize_min cpuid_mwait_leaf.linesize_min
+#define cpuid_mwait_extensions cpuid_mwait_leaf.extensions
+#define cpuid_mwait_sub_Cstates cpuid_mwait_leaf.sub_Cstates
+ cpuid_thermal_leaf_t cpuid_thermal_leaf;
+ cpuid_arch_perf_leaf_t cpuid_arch_perf_leaf;
+
/* Cache details: */
uint32_t cpuid_cache_linesize;
uint32_t cpuid_cache_L2_associativity;
/* Max leaf ids available from CPUID */
uint32_t cpuid_max_basic;
uint32_t cpuid_max_ext;
+
+ /* Family-specific info links */
+ uint32_t cpuid_cpufamily;
+ cpuid_mwait_leaf_t *cpuid_mwait_leafp;
+ cpuid_thermal_leaf_t *cpuid_thermal_leafp;
+ cpuid_arch_perf_leaf_t *cpuid_arch_perf_leafp;
+
} i386_cpu_info_t;
#ifdef __cplusplus
extern uint64_t cpuid_features(void);
extern uint64_t cpuid_extfeatures(void);
extern uint32_t cpuid_family(void);
+extern uint32_t cpuid_cpufamily(void);
extern void cpuid_get_info(i386_cpu_info_t *info_p);
extern i386_cpu_info_t *cpuid_info(void);