diff options
Diffstat (limited to 'sysdeps/x86_64/multiarch/init-arch.h')
-rw-r--r-- | sysdeps/x86_64/multiarch/init-arch.h | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/sysdeps/x86_64/multiarch/init-arch.h b/sysdeps/x86_64/multiarch/init-arch.h index 0aece18de3..cba10cf3f1 100644 --- a/sysdeps/x86_64/multiarch/init-arch.h +++ b/sysdeps/x86_64/multiarch/init-arch.h @@ -109,19 +109,18 @@ extern struct cpu_features extern void __init_cpu_features (void) attribute_hidden; -# define INIT_ARCH() \ - do \ - if (__cpu_features.kind == arch_kind_unknown) \ - __init_cpu_features (); \ - while (0) - -/* Used from outside libc.so to get access to the CPU features structure. */ -extern const struct cpu_features *__get_cpu_features (void) - __attribute__ ((const)); - -# ifndef NOT_IN_libc -# define __get_cpu_features() (&__cpu_features) -# endif + +/* Implicitly call __init_cpu_features before accessing the CPU features + structure. */ + +extern __always_inline attribute_hidden +const struct cpu_features * +__get_cpu_features (void) +{ + if (__cpu_features.kind == arch_kind_unknown) + __init_cpu_features (); + return &__cpu_features; +} # define HAS_CPU_FEATURE(idx, reg, bit) \ ((__get_cpu_features ()->cpuid[idx].reg & (bit)) != 0) |