1 /* ----------------------------------------------------------------------- *
3 * Pportions of this file taken from the dmidecode project
5 * Copyright (C) 2000-2002 Alan Cox <alan@redhat.com>
6 * Copyright (C) 2002-2008 Jean Delvare <khali@linux-fr.org>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 * For the avoidance of doubt the "preferred form" of this code is one which
23 * is in an open unpatent encumbered format. Where cryptographic key signing
24 * forms part of the process of creating an executable the information
25 * including keys needed to generate an equivalently functional executable
26 * are deemed to be part of the source code.
32 const char *dmi_processor_type(uint8_t code
)
35 static const char *type
[] = {
41 "Video Processor" /* 0x06 */
44 if (code
>= 0x01 && code
<= 0x06)
45 return type
[code
- 0x01];
49 const char *dmi_processor_family(uint8_t code
, char *manufacturer
)
52 /* TODO : Need to implement code/value (see dmidecode) insteed of array to address large index */
53 static const char *family
[256] = {
74 "Celeron M", /* 0x14 */
94 "Core 2 Duo", /* 0x28 */
188 "Turion 64", /* 0x86 */
193 "Third-Generation Opteron",
197 "Athlon X2", /* 0x8F */
215 "Quad-Core Xeon 3200", /* 0xA1 */
216 "Dual-Core Xeon 3000",
217 "Quad-Core Xeon 5300",
218 "Dual-Core Xeon 5100",
219 "Dual-Core Xeon 5000",
221 "Dual-Core Xeon ULV",
222 "Dual-Core Xeon 7100",
223 "Quad-Core Xeon 5400",
224 "Quad-Core Xeon", /* 0xAA */
225 "Dual-Core Xeon 5200",
226 "Dual-Core Xeon 7200",
227 "Quad-Core Xeon 7300",
228 "Quad-Core Xeon 7400",
229 "Multi-Core Xeon 7400", /* 0xAF */
231 "Pentium III Speedstep",
240 "Celeron D", /* 0xBA */
243 "Core Solo", /* 0xBD */
249 "Core 2 Extreme Mobile",
251 "Core 2 Solo Mobile",
253 "Dual-Core Celeron", /* 0xC7 */
257 "ESA/390 G6", /* 0xCB */
268 "Multi-Core Xeon", /*0xD6 */
269 "Dual-Core Xeon 3xxx",
270 "Quad-Core Xeon 3xxx", /*0xD8 */
272 "Dual-Core Xeon 5xxx", /*0xDA */
273 "Quad-Core Xeon 5xxx",
275 "Dual-Core Xeon 7xxx", /*0xDD */
276 "Quad-Core Xeon 7xxx",
277 "Multi-Core Xeon 7xxx",
284 "Embedded Opteron Quad-Core", /* 0xE6 */
285 "Phenom Triple-Core",
286 "Turion Ultra Dual-Core Mobile",
287 "Turion Dual-Core Mobile",
289 "Sempron SI", /*0xEB */
311 /* Special case for ambiguous value 0xBE */
313 /* Best bet based on manufacturer string */
314 if (strstr(manufacturer
, "Intel") != NULL
315 || strncasecmp(manufacturer
, "Intel", 5) == 0)
317 if (strstr(manufacturer
, "AMD") != NULL
318 || strncasecmp(manufacturer
, "AMD", 3) == 0)
320 return "Core 2 or K7";
323 if (family
[code
] != NULL
) {
329 const char *dmi_processor_status(uint8_t code
)
331 static const char *status
[] = {
332 "Unknown", /* 0x00 */
349 const char *dmi_processor_upgrade(uint8_t code
)
352 static const char *upgrade
[] = {
357 "Replaceable Piggy Back",
366 "Socket A (Socket 462)",
370 "Socket 939" /* 0x12 */
377 "Socket LGA1366" /* 0x19 */
380 if (code
>= 0x01 && code
<= 0x19)
381 return upgrade
[code
- 0x01];
385 void dmi_processor_cache(uint16_t code
, const char *level
, uint16_t ver
,
388 if (code
== 0xFFFF) {
390 sprintf(cache
, "Not Provided");
392 sprintf(cache
, "No %s Cache", level
);
394 sprintf(cache
, "0x%04X", code
);
397 /* Intel AP-485 revision 28, table 5 */
398 const char *cpu_flags_strings
[PROCESSOR_FLAGS_ELEMENTS
] = {
399 "FPU (Floating-point unit on-chip)", /* 0 */
400 "VME (Virtual mode extension)",
401 "DE (Debugging extension)",
402 "PSE (Page size extension)",
403 "TSC (Time stamp counter)",
404 "MSR (Model specific registers)",
405 "PAE (Physical address extension)",
406 "MCE (Machine check exception)",
407 "CX8 (CMPXCHG8 instruction supported)",
408 "APIC (On-chip APIC hardware supported)",
410 "SEP (Fast system call)",
411 "MTRR (Memory type range registers)",
412 "PGE (Page global enable)",
413 "MCA (Machine check architecture)",
414 "CMOV (Conditional move instruction supported)",
415 "PAT (Page attribute table)",
416 "PSE-36 (36-bit page size extension)",
417 "PSN (Processor serial number present and enabled)",
418 "CLFSH (CLFLUSH instruction supported)",
421 "ACPI (ACPI supported)",
422 "MMX (MMX technology supported)",
423 "FXSR (Fast floating-point save and restore)",
424 "SSE (Streaming SIMD extensions)",
425 "SSE2 (Streaming SIMD extensions 2)",
427 "HTT (Hyper-threading technology)",
428 "TM (Thermal monitor supported)",
429 "IA64 (IA64 capabilities)", /* 30 */
430 "PBE (Pending break enabled)" /* 31 */