cpufeature.h 510 B

12345678910111213141516171819202122
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * CPU feature definitions for module loading, used by
  4. * module_cpu_feature_match(), see uapi/asm/hwcap.h for MIPS CPU features.
  5. */
  6. #ifndef __ASM_CPUFEATURE_H
  7. #define __ASM_CPUFEATURE_H
  8. #include <uapi/asm/hwcap.h>
  9. #include <asm/elf.h>
  10. #define MAX_CPU_FEATURES (8 * sizeof(elf_hwcap))
  11. #define cpu_feature(x) ilog2(HWCAP_ ## x)
  12. static inline bool cpu_have_feature(unsigned int num)
  13. {
  14. return elf_hwcap & (1UL << num);
  15. }
  16. #endif /* __ASM_CPUFEATURE_H */