From f043e7133a62e054cb2f6d9aac4e3a80f855d3cd Mon Sep 17 00:00:00 2001 From: Veselin Georgiev Date: Wed, 19 Nov 2008 17:15:57 +0000 Subject: [PATCH] Support for Intel Atom CPU git-svn-id: https://svn.code.sf.net/p/libcpuid/code/HEAD/libcpuid@20 3b4be424-7ac5-41d7-8526-f4ddcb85d872 --- libcpuid/recog_intel.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/libcpuid/recog_intel.c b/libcpuid/recog_intel.c index 8a27f4c..13a44b8 100644 --- a/libcpuid/recog_intel.c +++ b/libcpuid/recog_intel.c @@ -48,6 +48,9 @@ enum _intel_code_t { KENTSFIELD, MORE_THAN_QUADCORE, PENTIUM_D, + ATOM_DIAMONDVILLE, + ATOM_DUALCORE, + ATOM_SILVERTHORNE, }; typedef enum _intel_code_t intel_code_t; @@ -118,6 +121,11 @@ const struct match_entry_t cpudb_intel[] = { { 6, 13, -1, -1, -1, PENTIUM , "Pentium M (Dothan)" }, { 6, 13, -1, -1, -1, CELERON , "Celeron M" }, + { 6, 12, -1, -1, -1, NO_CODE , "Unknown Atom" }, + { 6, 12, -1, -1, -1, ATOM_DIAMONDVILLE , "Atom (Diamondville)" }, + { 6, 12, -1, -1, -1, ATOM_DUALCORE , "Atom (Dual Core)" }, + { 6, 12, -1, -1, -1, ATOM_SILVERTHORNE , "Atom (Silverthorne)" }, + /* ////////////////////////////////////////////////// */ { 6, 14, -1, -1, -1, NO_CODE , "Unknown Yonah" }, @@ -380,7 +388,7 @@ static void decode_intel_deterministic_cache_info(struct cpu_raw_data_t* raw, partitions = ((raw->intel_fn4[ecx][1] >> 12) & 0x3ff) + 1; linesize = (raw->intel_fn4[ecx][1] & 0xfff) + 1; sets = raw->intel_fn4[ecx][2] + 1; - size = ways * partitions * linesize * sets; + size = ways * partitions * linesize * sets / 1024; check_case(1, type, size, ways, linesize, data); } } @@ -431,6 +439,10 @@ static void decode_intel_codename(struct cpu_raw_data_t* raw, struct cpu_id_t* d { PENTIUM, "Pentium" }, { CORE_SOLO, "Genuine Intel(R) CPU" }, { CORE_SOLO, "Intel(R) Core(TM)2" }, + { ATOM_DIAMONDVILLE, "Atom(TM) CPU 2" }, + { ATOM_DIAMONDVILLE, "Atom(TM) CPU N" }, + { ATOM_DUALCORE, "Atom(TM) CPU 3" }, + { ATOM_SILVERTHORNE, "Atom(TM) CPU Z" }, }; for (i = 0; i < COUNT_OF(matchtable); i++) if (strstr(bs, matchtable[i].search)) {