diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | sysdeps/x86/cpu-features.c | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog index 51c6fef0a5..3f55c55a1d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2015-08-13 H.J. Lu <hongjiu.lu@intel.com> + * sysdeps/x86/cpu-features.c (init_cpu_features): Call + __get_cpuid_max if not compiling for i586, i686 nor x86-64. + +2015-08-13 H.J. Lu <hongjiu.lu@intel.com> + * sysdeps/unix/sysv/linux/x86/elision-conf.h: Don't include <cpuid.h>. diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c index 587080c1a4..582a8f5f79 100644 --- a/sysdeps/x86/cpu-features.c +++ b/sysdeps/x86/cpu-features.c @@ -40,6 +40,14 @@ init_cpu_features (struct cpu_features *cpu_features) unsigned int model = 0; enum cpu_features_kind kind; +#if !defined __i586__ && !defined __i686__ && !defined __x86_64__ + if (__get_cpuid_max (0, 0) == 0) + { + kind = arch_kind_other; + goto no_cpuid; + } +#endif + __cpuid (0, cpu_features->max_cpuid, ebx, ecx, edx); /* This spells out "GenuineIntel". */ @@ -196,6 +204,10 @@ init_cpu_features (struct cpu_features *cpu_features) } } +#if !defined __i586__ && !defined __i686__ && !defined __x86_64__ +no_cpuid: +#endif + cpu_features->family = family; cpu_features->model = model; cpu_features->kind = kind; |