diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2021-06-05 06:42:20 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2021-07-23 05:12:51 -0700 |
commit | 7c124e3714c38157230ed1a5d743b37defe64dc2 (patch) | |
tree | f1e13e18239c4421675234b56d880ae081d4bdcd /sysdeps/x86/sys | |
parent | 5b8d271571434a74b2464c278eafe2ff81f31029 (diff) | |
download | glibc-7c124e3714c38157230ed1a5d743b37defe64dc2.tar glibc-7c124e3714c38157230ed1a5d743b37defe64dc2.tar.gz glibc-7c124e3714c38157230ed1a5d743b37defe64dc2.tar.bz2 glibc-7c124e3714c38157230ed1a5d743b37defe64dc2.zip |
x86: Install <bits/platform/x86.h> [BZ #27958]
1. Install <bits/platform/x86.h> for <sys/platform/x86.h> which includes
<bits/platform/x86.h>.
2. Rename HAS_CPU_FEATURE to CPU_FEATURE_PRESENT which checks if the
processor has the feature.
3. Rename CPU_FEATURE_USABLE to CPU_FEATURE_ACTIVE which checks if the
feature is active. There may be other preconditions, like sufficient
stack space or further setup for AMX, which must be satisfied before the
feature can be used.
This fixes BZ #27958.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'sysdeps/x86/sys')
-rw-r--r-- | sysdeps/x86/sys/platform/x86.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sysdeps/x86/sys/platform/x86.h b/sysdeps/x86/sys/platform/x86.h index e930219944..2d119f312f 100644 --- a/sysdeps/x86/sys/platform/x86.h +++ b/sysdeps/x86/sys/platform/x86.h @@ -30,7 +30,7 @@ extern const struct cpuid_feature *__x86_get_cpuid_feature_leaf (unsigned int) __attribute__ ((pure)); static __inline__ _Bool -x86_cpu_has_feature (unsigned int __index) +x86_cpu_present (unsigned int __index) { const struct cpuid_feature *__ptr = __x86_get_cpuid_feature_leaf (__index / (8 * sizeof (unsigned int) * 4)); @@ -43,7 +43,7 @@ x86_cpu_has_feature (unsigned int __index) } static __inline__ _Bool -x86_cpu_is_usable (unsigned int __index) +x86_cpu_active (unsigned int __index) { const struct cpuid_feature *__ptr = __x86_get_cpuid_feature_leaf (__index / (8 * sizeof (unsigned int) * 4)); @@ -52,13 +52,13 @@ x86_cpu_is_usable (unsigned int __index) unsigned int __bit = __reg & (8 * sizeof (unsigned int) - 1); __reg /= 8 * sizeof (unsigned int); - return __ptr->usable_array[__reg] & (1 << __bit); + return __ptr->active_array[__reg] & (1 << __bit); } -/* HAS_CPU_FEATURE evaluates to true if CPU supports the feature. */ -#define HAS_CPU_FEATURE(name) x86_cpu_has_feature (x86_cpu_##name) -/* CPU_FEATURE_USABLE evaluates to true if the feature is usable. */ -#define CPU_FEATURE_USABLE(name) x86_cpu_is_usable (x86_cpu_##name) +/* CPU_FEATURE_PRESENT evaluates to true if CPU supports the feature. */ +#define CPU_FEATURE_PRESENT(name) x86_cpu_present (x86_cpu_##name) +/* CPU_FEATURE_ACTIVE evaluates to true if the feature is active. */ +#define CPU_FEATURE_ACTIVE(name) x86_cpu_active (x86_cpu_##name) __END_DECLS |