From fc4ff90ea80e3b4c1ba62197d2618048bb64e894 Mon Sep 17 00:00:00 2001 From: Veselin Georgiev Date: Tue, 23 Sep 2014 15:11:00 +0300 Subject: [PATCH] Recognize presence of RDTSCP on Intel CPUs as well. Previously the detection only tested this AMD CPUs and the table check was only present in recog_amd.c Thanks to Andrew Roberts for reporting this issue! --- libcpuid/cpuid_main.c | 1 + libcpuid/recog_amd.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/libcpuid/cpuid_main.c b/libcpuid/cpuid_main.c index 544de48..cd0d7c8 100644 --- a/libcpuid/cpuid_main.c +++ b/libcpuid/cpuid_main.c @@ -179,6 +179,7 @@ static void load_features_common(struct cpu_raw_data_t* raw, struct cpu_id_t* da }; const struct feature_map_t matchtable_edx81[] = { { 11, CPU_FEATURE_SYSCALL }, + { 27, CPU_FEATURE_RDTSCP }, { 29, CPU_FEATURE_LM }, }; const struct feature_map_t matchtable_ecx81[] = { diff --git a/libcpuid/recog_amd.c b/libcpuid/recog_amd.c index 577605f..c5390b9 100644 --- a/libcpuid/recog_amd.c +++ b/libcpuid/recog_amd.c @@ -271,7 +271,6 @@ static void load_amd_features(struct cpu_raw_data_t* raw, struct cpu_id_t* data) { 20, CPU_FEATURE_NX }, { 22, CPU_FEATURE_MMXEXT }, { 25, CPU_FEATURE_FXSR_OPT }, - { 27, CPU_FEATURE_RDTSCP }, { 30, CPU_FEATURE_3DNOWEXT }, { 31, CPU_FEATURE_3DNOW }, };