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