diff options
Diffstat (limited to 'arch/arm64/include/asm/cpufeature.h')
-rw-r--r-- | arch/arm64/include/asm/cpufeature.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h index cd4ac0516488..20b2b3d6b702 100644 --- a/arch/arm64/include/asm/cpufeature.h +++ b/arch/arm64/include/asm/cpufeature.h | |||
@@ -21,9 +21,29 @@ | |||
21 | #define MAX_CPU_FEATURES (8 * sizeof(elf_hwcap)) | 21 | #define MAX_CPU_FEATURES (8 * sizeof(elf_hwcap)) |
22 | #define cpu_feature(x) ilog2(HWCAP_ ## x) | 22 | #define cpu_feature(x) ilog2(HWCAP_ ## x) |
23 | 23 | ||
24 | #define NCAPS 0 | ||
25 | |||
26 | extern DECLARE_BITMAP(cpu_hwcaps, NCAPS); | ||
27 | |||
24 | static inline bool cpu_have_feature(unsigned int num) | 28 | static inline bool cpu_have_feature(unsigned int num) |
25 | { | 29 | { |
26 | return elf_hwcap & (1UL << num); | 30 | return elf_hwcap & (1UL << num); |
27 | } | 31 | } |
28 | 32 | ||
33 | static inline bool cpus_have_cap(unsigned int num) | ||
34 | { | ||
35 | if (num >= NCAPS) | ||
36 | return false; | ||
37 | return test_bit(num, cpu_hwcaps); | ||
38 | } | ||
39 | |||
40 | static inline void cpus_set_cap(unsigned int num) | ||
41 | { | ||
42 | if (num >= NCAPS) | ||
43 | pr_warn("Attempt to set an illegal CPU capability (%d >= %d)\n", | ||
44 | num, NCAPS); | ||
45 | else | ||
46 | __set_bit(num, cpu_hwcaps); | ||
47 | } | ||
48 | |||
29 | #endif | 49 | #endif |