cpufeature.h 963 B

123456789101112131415161718192021222324252627282930
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Module interface for CPU features
  4. *
  5. * Copyright IBM Corp. 2015
  6. * Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
  7. */
  8. #ifndef __ASM_S390_CPUFEATURE_H
  9. #define __ASM_S390_CPUFEATURE_H
  10. #include <asm/elf.h>
  11. /* Hardware features on Linux on z Systems are indicated by facility bits that
  12. * are mapped to the so-called machine flags. Particular machine flags are
  13. * then used to define ELF hardware capabilities; most notably hardware flags
  14. * that are essential for user space / glibc.
  15. *
  16. * Restrict the set of exposed CPU features to ELF hardware capabilities for
  17. * now. Additional machine flags can be indicated by values larger than
  18. * MAX_ELF_HWCAP_FEATURES.
  19. */
  20. #define MAX_ELF_HWCAP_FEATURES (8 * sizeof(elf_hwcap))
  21. #define MAX_CPU_FEATURES MAX_ELF_HWCAP_FEATURES
  22. #define cpu_feature(feat) ilog2(HWCAP_S390_ ## feat)
  23. int cpu_have_feature(unsigned int nr);
  24. #endif /* __ASM_S390_CPUFEATURE_H */