xref: /openbmc/linux/arch/s390/include/asm/cpufeature.h (revision 293d5b43)
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 
8 #ifndef __ASM_S390_CPUFEATURE_H
9 #define __ASM_S390_CPUFEATURE_H
10 
11 #include <asm/elf.h>
12 
13 /* Hardware features on Linux on z Systems are indicated by facility bits that
14  * are mapped to the so-called machine flags.  Particular machine flags are
15  * then used to define ELF hardware capabilities; most notably hardware flags
16  * that are essential for user space / glibc.
17  *
18  * Restrict the set of exposed CPU features to ELF hardware capabilities for
19  * now.  Additional machine flags can be indicated by values larger than
20  * MAX_ELF_HWCAP_FEATURES.
21  */
22 #define MAX_ELF_HWCAP_FEATURES	(8 * sizeof(elf_hwcap))
23 #define MAX_CPU_FEATURES	MAX_ELF_HWCAP_FEATURES
24 
25 #define cpu_feature(feat)	ilog2(HWCAP_S390_ ## feat)
26 
27 int cpu_have_feature(unsigned int nr);
28 
29 #endif /* __ASM_S390_CPUFEATURE_H */
30