1
0
Fork 0
mirror of https://github.com/anrieff/libcpuid synced 2024-12-16 16:35:45 +00:00

Ability to display AMD brand code

So that it's easier to test and debug

Also added AMD Champlain mobile
Processor: AMD Athlon(tm) II P320 Dual-Core Processor
This commit is contained in:
wdlkmpx 2016-05-11 09:23:30 +00:00
parent 756ef8c469
commit 061bd5986c
3 changed files with 150 additions and 3 deletions

View file

@ -71,6 +71,45 @@ enum _amd_code_t {
};
typedef enum _amd_code_t amd_code_t;
const struct amd_code_str { amd_code_t code; char *str; } amd_code_str[] = {
{ NO_CODE, "NO_CODE", },
{ OPTERON_GENERIC, "OPTERON_GENERIC", },
{ OPTERON_800, "OPTERON_800", },
{ ATHLON_XP, "ATHLON_XP", },
{ ATHLON_XP_M, "ATHLON_XP_M", },
{ ATHLON_XP_M_LV, "ATHLON_XP_M_LV", },
{ ATHLON, "ATHLON", },
{ ATHLON_MP, "ATHLON_MP", },
{ MOBILE_ATHLON64, "MOBILE_ATHLON64", },
{ ATHLON_FX, "ATHLON_FX", },
{ DURON, "DURON", },
{ DURON_MP, "DURON_MP", },
{ MOBILE_DURON, "MOBILE_DURON", },
{ MOBILE_SEMPRON, "MOBILE_SEMPRON", },
{ OPTERON_SINGLE, "OPTERON_SINGLE", },
{ OPTERON_DUALCORE, "OPTERON_DUALCORE", },
{ OPTERON_800_DUALCORE, "OPTERON_800_DUALCORE",},
{ MOBILE_TURION, "MOBILE_TURION", },
{ ATHLON_64, "ATHLON_64", },
{ ATHLON_64_FX, "ATHLON_64_FX", },
{ TURION_64, "TURION_64", },
{ TURION_X2, "TURION_X2", },
{ SEMPRON, "SEMPRON", },
{ M_SEMPRON, "M_SEMPRON", },
{ SEMPRON_DUALCORE, "SEMPRON_DUALCORE", },
{ PHENOM, "PHENOM", },
{ PHENOM2, "PHENOM2", },
{ ATHLON_64_X2, "ATHLON_64_X2", },
{ ATHLON_64_X3, "ATHLON_64_X3", },
{ ATHLON_64_X4, "ATHLON_64_X4", },
{ FUSION_C, "FUSION_C", },
{ FUSION_E, "FUSION_E", },
{ FUSION_EA, "FUSION_EA", },
{ FUSION_Z, "FUSION_Z", },
{ FUSION_A, "FUSION_A", },
{ NA, "NA", },
};
const struct match_entry_t cpudb_amd[] = {
{ -1, -1, -1, -1, -1, 1, -1, -1, NO_CODE , 0, "Unknown AMD CPU" },
@ -238,10 +277,12 @@ const struct match_entry_t cpudb_amd[] = {
{ 15, 4, -1, 16, 10, 4, 512, -1, PHENOM2 , 0, "Phenom II X4 (Zosma)" },
{ 15, 4, -1, 16, 10, 6, 512, -1, PHENOM2 , 0, "Phenom II X6 (Thuban)" },
{ 15, 4, -1, 16, -1, 2, 1024, -1, ATHLON_64_X2 , 0, "Athlon II X2 (Regor)" },
{ 15, 4, -1, 16, -1, 2, 512, -1, ATHLON_64_X2 , 0, "Athlon II X2 (Regor)" },
{ 15, 6, -1, 16, 6, 2, 512, -1, ATHLON , 0, "Athlon II (Champlain)" },
{ 15, 6, -1, 16, 6, 2, 512, -1, ATHLON_64_X2 , 0, "Athlon II X2 (Regor)" },
{ 15, 6, -1, 16, 6, 2, 1024, -1, ATHLON_64_X2 , 0, "Athlon II X2 (Regor)" },
{ 15, 5, -1, 16, 5, 3, 512, -1, ATHLON_64_X3 , 0, "Athlon II X3 (Rana)" },
{ 15, 5, -1, 16, 5, 4, 512, -1, ATHLON_64_X4 , 0, "Athlon II X4 (Propus)" },
/* 2011 CPUs: K10 architecture: Llano */
{ 15, 1, -1, 18, 1, 2, 512, -1, FUSION_EA , 0, "Llano X2" },
{ 15, 1, -1, 18, 1, 2, 1024, -1, FUSION_EA , 0, "Llano X2" },
@ -481,7 +522,20 @@ static amd_code_t decode_amd_codename_part1(const char *bs)
static void decode_amd_codename(struct cpu_raw_data_t* raw, struct cpu_id_t* data)
{
amd_code_t code = decode_amd_codename_part1(data->brand_str);
int i = 0;
char* code_str = NULL;
while (amd_code_str[i].code != NA) {
if (code == amd_code_str[i].code) {
code_str = amd_code_str[i].str;
break;
}
i++;
}
if (code_str)
debugf(2, "Detected AMD brand code: %d (%s)\n", code, code_str);
else
debugf(2, "Detected AMD brand code: %d\n", code);
if (code == ATHLON_64_X2 && data->l2_cache < 512)
code = SEMPRON_DUALCORE;
match_cpu_codename(cpudb_amd, COUNT_OF(cpudb_amd), data, code, 0);

View file

@ -0,0 +1,93 @@
basic_cpuid[0]=00000005 68747541 444d4163 69746e65
basic_cpuid[1]=00100f63 01020800 00802009 178bfbff
basic_cpuid[2]=00000000 00000000 00000000 00000000
basic_cpuid[3]=00000000 00000000 00000000 00000000
basic_cpuid[4]=00000000 00000000 00000000 00000000
basic_cpuid[5]=00000040 00000040 00000003 00000000
basic_cpuid[6]=00000000 00000000 00000000 00000000
basic_cpuid[7]=00000000 00000000 00000000 00000000
basic_cpuid[8]=00000000 00000000 00000000 00000000
basic_cpuid[9]=00000000 00000000 00000000 00000000
basic_cpuid[10]=00000000 00000000 00000000 00000000
basic_cpuid[11]=00000000 00000000 00000000 00000000
basic_cpuid[12]=00000000 00000000 00000000 00000000
basic_cpuid[13]=00000000 00000000 00000000 00000000
basic_cpuid[14]=00000000 00000000 00000000 00000000
basic_cpuid[15]=00000000 00000000 00000000 00000000
basic_cpuid[16]=00000000 00000000 00000000 00000000
basic_cpuid[17]=00000000 00000000 00000000 00000000
basic_cpuid[18]=00000000 00000000 00000000 00000000
basic_cpuid[19]=00000000 00000000 00000000 00000000
basic_cpuid[20]=00000000 00000000 00000000 00000000
basic_cpuid[21]=00000000 00000000 00000000 00000000
basic_cpuid[22]=00000000 00000000 00000000 00000000
basic_cpuid[23]=00000000 00000000 00000000 00000000
basic_cpuid[24]=00000000 00000000 00000000 00000000
basic_cpuid[25]=00000000 00000000 00000000 00000000
basic_cpuid[26]=00000000 00000000 00000000 00000000
basic_cpuid[27]=00000000 00000000 00000000 00000000
basic_cpuid[28]=00000000 00000000 00000000 00000000
basic_cpuid[29]=00000000 00000000 00000000 00000000
basic_cpuid[30]=00000000 00000000 00000000 00000000
basic_cpuid[31]=00000000 00000000 00000000 00000000
ext_cpuid[0]=8000001b 68747541 444d4163 69746e65
ext_cpuid[1]=00100f63 20002212 0008377f efd3fbff
ext_cpuid[2]=20444d41 6c687441 74286e6f 4920296d
ext_cpuid[3]=33502049 44203032 2d6c6175 65726f43
ext_cpuid[4]=6f725020 73736563 0000726f 00000000
ext_cpuid[5]=ff30ff10 ff30ff20 40020140 40020140
ext_cpuid[6]=20800000 42004200 02008140 00000000
ext_cpuid[7]=00000000 00000000 00000000 000001f9
ext_cpuid[8]=00003030 00000000 00002001 00000000
ext_cpuid[9]=00000000 00000000 00000000 00000000
ext_cpuid[10]=00000001 00000040 00000000 0000000f
ext_cpuid[11]=00000000 00000000 00000000 00000000
ext_cpuid[12]=00000000 00000000 00000000 00000000
ext_cpuid[13]=00000000 00000000 00000000 00000000
ext_cpuid[14]=00000000 00000000 00000000 00000000
ext_cpuid[15]=00000000 00000000 00000000 00000000
ext_cpuid[16]=00000000 00000000 00000000 00000000
ext_cpuid[17]=00000000 00000000 00000000 00000000
ext_cpuid[18]=00000000 00000000 00000000 00000000
ext_cpuid[19]=00000000 00000000 00000000 00000000
ext_cpuid[20]=00000000 00000000 00000000 00000000
ext_cpuid[21]=00000000 00000000 00000000 00000000
ext_cpuid[22]=00000000 00000000 00000000 00000000
ext_cpuid[23]=00000000 00000000 00000000 00000000
ext_cpuid[24]=00000000 00000000 00000000 00000000
ext_cpuid[25]=f0300000 60100000 00000000 00000000
ext_cpuid[26]=00000000 00000000 00000000 00000000
ext_cpuid[27]=0000001f 00000000 00000000 00000000
ext_cpuid[28]=00000000 00000000 00000000 00000000
ext_cpuid[29]=00000000 00000000 00000000 00000000
ext_cpuid[30]=00000000 00000000 00000000 00000000
ext_cpuid[31]=00000000 00000000 00000000 00000000
intel_fn4[0]=00000000 00000000 00000000 00000000
intel_fn4[1]=00000000 00000000 00000000 00000000
intel_fn4[2]=00000000 00000000 00000000 00000000
intel_fn4[3]=00000000 00000000 00000000 00000000
intel_fn11[0]=00000000 00000000 00000000 00000000
intel_fn11[1]=00000000 00000000 00000000 00000000
intel_fn11[2]=00000000 00000000 00000000 00000000
intel_fn11[3]=00000000 00000000 00000000 00000000
--------------------------------------------------------------------------------
15
6
3
16
6
2
2
64
64
512
0
2
16
-1
64
64
-1
64 (authoritative)
Athlon II (Champlain)
fpu vme de pse tsc msr pae mce cx8 apic mtrr sep pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht pni monitor cx16 syscall popcnt mmxext 3dnow 3dnowext nx fxsr_opt rdtscp lm lahf_lm cmp_legacy svm abm sse4a 3dnowprefetch osvw ibs skinit wdt ts ttp tm_amd stc 100mhzsteps hwpstate constant_tsc