GNU Linux-libre 4.9.282-gnu1
[releases.git] / arch / x86 / include / asm / cpu_device_id.h
1 #ifndef _CPU_DEVICE_ID
2 #define _CPU_DEVICE_ID 1
3
4 /*
5  * Declare drivers belonging to specific x86 CPUs
6  * Similar in spirit to pci_device_id and related PCI functions
7  */
8
9 #include <linux/mod_devicetable.h>
10
11 #define X86_STEPPINGS(mins, maxs)    GENMASK(maxs, mins)
12
13 /**
14  * X86_MATCH_VENDOR_FAM_MODEL_STEPPINGS_FEATURE - Base macro for CPU matching
15  * @_vendor:    The vendor name, e.g. INTEL, AMD, HYGON, ..., ANY
16  *              The name is expanded to X86_VENDOR_@_vendor
17  * @_family:    The family number or X86_FAMILY_ANY
18  * @_model:     The model number, model constant or X86_MODEL_ANY
19  * @_steppings: Bitmask for steppings, stepping constant or X86_STEPPING_ANY
20  * @_feature:   A X86_FEATURE bit or X86_FEATURE_ANY
21  * @_data:      Driver specific data or NULL. The internal storage
22  *              format is unsigned long. The supplied value, pointer
23  *              etc. is casted to unsigned long internally.
24  *
25  * Backport version to keep the SRBDS pile consistant. No shorter variants
26  * required for this.
27  */
28 #define X86_MATCH_VENDOR_FAM_MODEL_STEPPINGS_FEATURE(_vendor, _family, _model, \
29                                                     _steppings, _feature, _data) { \
30         .vendor         = X86_VENDOR_##_vendor,                         \
31         .family         = _family,                                      \
32         .model          = _model,                                       \
33         .steppings      = _steppings,                                   \
34         .feature        = _feature,                                     \
35         .driver_data    = (unsigned long) _data                         \
36 }
37
38 extern const struct x86_cpu_id *x86_match_cpu(const struct x86_cpu_id *match);
39
40 #endif