Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / arch / loongarch / include / asm / cpufeature.h
blob4da22a8e63ded988f8b316a4705fc730c47ef54a
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * CPU feature definitions for module loading, used by
4 * module_cpu_feature_match(), see uapi/asm/hwcap.h for LoongArch CPU features.
6 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
7 */
9 #ifndef __ASM_CPUFEATURE_H
10 #define __ASM_CPUFEATURE_H
12 #include <uapi/asm/hwcap.h>
13 #include <asm/elf.h>
15 #define MAX_CPU_FEATURES (8 * sizeof(elf_hwcap))
17 #define cpu_feature(x) ilog2(HWCAP_ ## x)
19 static inline bool cpu_have_feature(unsigned int num)
21 return elf_hwcap & (1UL << num);
24 #endif /* __ASM_CPUFEATURE_H */