cpufeature.h 924 B

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