23 #define foreach_x86_cpu_uarch \ 24 _(0x06, 0x4f, "Broadwell", "Broadwell-EP/EX") \ 25 _(0x06, 0x3d, "Broadwell", "Broadwell") \ 26 _(0x06, 0x3f, "Haswell", "Haswell-E") \ 27 _(0x06, 0x3c, "Haswell", "Haswell") \ 28 _(0x06, 0x3e, "IvyBridge", "IvyBridge-E/EN/EP") \ 29 _(0x06, 0x3a, "IvyBridge", "IvyBridge") \ 30 _(0x06, 0x2a, "SandyBridge", "SandyBridge") \ 31 _(0x06, 0x2d, "SandyBridge", "SandyBridge-E/EN/EP") \ 32 _(0x06, 0x25, "Westmere", "Arrandale,Clarksdale") \ 33 _(0x06, 0x2c, "Westmere", "Westmere-EP/EX,Gulftown") \ 34 _(0x06, 0x2f, "Westmere", "Westmere-EX") \ 35 _(0x06, 0x1e, "Nehalem", "Clarksfield,Lynnfield,Jasper Forest") \ 36 _(0x06, 0x1a, "Nehalem", "Nehalem-EP,Bloomfield)") \ 37 _(0x06, 0x2e, "Nehalem", "Nehalem-EX") \ 38 _(0x06, 0x17, "Penryn", "Yorkfield,Wolfdale,Penryn,Harpertown (DP)") \ 39 _(0x06, 0x1d, "Penryn", "Dunnington (MP)") \ 40 _(0x06, 0x37, "Atom", "Bay Trail") \ 41 _(0x06, 0x36, "Atom", "Cedarview") \ 42 _(0x06, 0x26, "Atom", "Lincroft") \ 43 _(0x06, 0x1c, "Atom", "Pineview/Silverthorne") 49 u32 __attribute__((unused)) eax, ebx, ecx, edx;
52 if (__get_cpuid (1, &eax, &ebx, &ecx, &edx) == 0)
53 return format (s,
"unknown (missing cpuid)");
55 model = ((eax >> 4) & 0x0f) | ((eax >> 12) & 0xf0);
56 family = (eax >> 8) & 0x0f;
58 #define _(f,m,a,c) if ((model == m) && (family == f)) return format(s, "%s (%s)", a, c); 61 return format (s,
"unknown (family 0x%02x model 0x%02x)", family, model);
64 return format (s,
"unknown");
72 u32 __attribute__((unused)) eax, ebx, ecx, edx;
76 if (__get_cpuid (1, &eax, &ebx, &ecx, &edx) == 0)
77 return format (s,
"unknown (missing cpuid)");
79 __get_cpuid (0x80000000, &eax, &ebx, &ecx, &edx);
81 return format (s,
"unknown (missing ext feature)");
84 name_u32 = (
u32 *) name;
86 __get_cpuid (0x80000002, &eax, &ebx, &ecx, &edx);
92 __get_cpuid (0x80000003, &eax, &ebx, &ecx, &edx);
98 __get_cpuid (0x80000004, &eax, &ebx, &ecx, &edx);
104 s =
format (s,
"%s", name);
109 return format (s,
"unknown");
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
u8 * format_cpu_uarch(u8 *s, va_list *args)
u8 * format_cpu_model_name(u8 *s, va_list *args)
#define vec_free(V)
Free vector's memory (no header).
#define foreach_x86_cpu_uarch