Loading...
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
7#ifndef __ASM_CPUFEATURE_H
8#define __ASM_CPUFEATURE_H
9
10#include <uapi/asm/hwcap.h>
11#include <asm/elf.h>
12
13#define MAX_CPU_FEATURES (8 * sizeof(elf_hwcap))
14
15#define cpu_feature(x) ilog2(HWCAP_ ## x)
16
17static inline bool cpu_have_feature(unsigned int num)
18{
19 return elf_hwcap & (1UL << num);
20}
21
22#endif /* __ASM_CPUFEATURE_H */
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
11#ifndef __ASM_CPUFEATURE_H
12#define __ASM_CPUFEATURE_H
13
14#include <uapi/asm/hwcap.h>
15#include <asm/elf.h>
16
17#define MAX_CPU_FEATURES (8 * sizeof(elf_hwcap))
18
19#define cpu_feature(x) ilog2(HWCAP_ ## x)
20
21static inline bool cpu_have_feature(unsigned int num)
22{
23 return elf_hwcap & (1UL << num);
24}
25
26#endif /* __ASM_CPUFEATURE_H */