xref: /linux/include/linux/device-id/x86_cpu.h (revision d2c9a99135da931377240942d44f3dea104cedb8)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef LINUX_DEVICE_ID_X86_CPU_H
3 #define LINUX_DEVICE_ID_X86_CPU_H
4 
5 #ifdef __KERNEL__
6 #include <linux/types.h>
7 typedef unsigned long kernel_ulong_t;
8 #endif
9 
10 /* Wild cards for x86_cpu_id::vendor, family, model and feature */
11 #define X86_VENDOR_ANY 0xffff
12 #define X86_FAMILY_ANY 0
13 #define X86_MODEL_ANY  0
14 #define X86_STEPPING_ANY 0
15 #define X86_STEP_MIN 0
16 #define X86_STEP_MAX 0xf
17 #define X86_PLATFORM_ANY 0x0
18 #define X86_FEATURE_ANY 0	/* Same as FPU, you can't test for that */
19 #define X86_CPU_TYPE_ANY 0
20 
21 /*
22  * Match x86 CPUs for CPU specific drivers.
23  * See documentation of "x86_match_cpu" for details.
24  */
25 
26 /*
27  * MODULE_DEVICE_TABLE expects this struct to be called x86cpu_device_id.
28  * Although gcc seems to ignore this error, clang fails without this define.
29  */
30 #define x86cpu_device_id x86_cpu_id
31 struct x86_cpu_id {
32 	__u16 vendor;
33 	__u16 family;
34 	__u16 model;
35 	__u16 steppings;
36 	__u16 feature;	/* bit index */
37 	/* Solely for kernel-internal use: DO NOT EXPORT to userspace! */
38 	__u16 flags;
39 	__u8  platform_mask;
40 	__u8  type;
41 	kernel_ulong_t driver_data;
42 };
43 
44 #endif /* ifndef LINUX_DEVICE_ID_X86_CPU_H */
45