cpufeature.h 717 B

123456789101112131415161718192021222324252627
  1. /*
  2. * CPU feature definitions for module loading, used by
  3. * module_cpu_feature_match(), see uapi/asm/hwcap.h for MIPS CPU features.
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License
  7. * as published by the Free Software Foundation; either version
  8. * 2 of the License, or (at your option) any later version.
  9. */
  10. #ifndef __ASM_CPUFEATURE_H
  11. #define __ASM_CPUFEATURE_H
  12. #include <uapi/asm/hwcap.h>
  13. #include <asm/elf.h>
  14. #define MAX_CPU_FEATURES (8 * sizeof(elf_hwcap))
  15. #define cpu_feature(x) ilog2(HWCAP_ ## x)
  16. static inline bool cpu_have_feature(unsigned int num)
  17. {
  18. return elf_hwcap & (1UL << num);
  19. }
  20. #endif /* __ASM_CPUFEATURE_H */