| @@ -20,12 +20,14 @@ · 19 unmodified lines |
| 20 | 20 | #define X86_CENTAUR_FAM6_C7_D 0xd |
| 21 | 21 | #define X86_CENTAUR_FAM6_NANO 0xf |
| 22 | 22 | |
| 23 | +#define X86_STEPPINGS(mins, maxs) GENMASK(maxs, mins) |
| 23 | 24 | /** |
| 24 | | − * X86_MATCH_VENDOR_FAM_MODEL_FEATURE - Base macro for CPU matching |
| 25 | + * X86_MATCH_VENDOR_FAM_MODEL_STEPPINGS_FEATURE - Base macro for CPU matching |
| 25 | 26 | * @_vendor: The vendor name, e.g. INTEL, AMD, HYGON, ..., ANY |
| 26 | 27 | * The name is expanded to X86_VENDOR_@_vendor |
| 27 | 28 | * @_family: The family number or X86_FAMILY_ANY |
| 28 | 29 | * @_model: The model number, model constant or X86_MODEL_ANY |
| 30 | + * @_steppings: Bitmask for steppings, stepping constant or X86_STEPPING_ANY |
| 29 | 31 | * @_feature: A X86_FEATURE bit or X86_FEATURE_ANY |
| 30 | 32 | * @_data: Driver specific data or NULL. The internal storage |
| 31 | 33 | * format is unsigned long. The supplied value, pointer |
| @@ -37,15 +39,34 @@ · 5 unmodified lines |
| 37 | 39 | * into another macro at the usage site for good reasons, then please |
| 38 | 40 | * start this local macro with X86_MATCH to allow easy grepping. |
| 39 | 41 | */ |
| 40 | | −#define X86_MATCH_VENDOR_FAM_MODEL_FEATURE(_vendor, _family, _model, \ |
| 41 | | − _feature, _data) { \ |
| 42 | +#define X86_MATCH_VENDOR_FAM_MODEL_STEPPINGS_FEATURE(_vendor, _family, _model, \ |
| 43 | + _steppings, _feature, _data) { \ |
| 42 | 44 | .vendor = X86_VENDOR_##_vendor, \ |
| 43 | 45 | .family = _family, \ |
| 44 | 46 | .model = _model, \ |
| 47 | + .steppings = _steppings, \ |
| 45 | 48 | .feature = _feature, \ |
| 46 | 49 | .driver_data = (unsigned long) _data \ |
| 47 | 50 | } |
| 48 | 51 | |
| 52 | +/** |
| 53 | + * X86_MATCH_VENDOR_FAM_MODEL_FEATURE - Macro for CPU matching |
| 54 | + * @_vendor: The vendor name, e.g. INTEL, AMD, HYGON, ..., ANY |
| 55 | + * The name is expanded to X86_VENDOR_@_vendor |
| 56 | + * @_family: The family number or X86_FAMILY_ANY |
| 57 | + * @_model: The model number, model constant or X86_MODEL_ANY |
| 58 | + * @_feature: A X86_FEATURE bit or X86_FEATURE_ANY |
| 59 | + * @_data: Driver specific data or NULL. The internal storage |
| 60 | + * format is unsigned long. The supplied value, pointer |
| 61 | + * etc. is casted to unsigned long internally. |
| 62 | + * |
| 63 | + * The steppings arguments of X86_MATCH_VENDOR_FAM_MODEL_STEPPINGS_FEATURE() is |
| 64 | + * set to wildcards. |
| 65 | + */ |
| 66 | +#define X86_MATCH_VENDOR_FAM_MODEL_FEATURE(vendor, family, model, feature, data) \ |
| 67 | + X86_MATCH_VENDOR_FAM_MODEL_STEPPINGS_FEATURE(vendor, family, model, \ |
| 68 | + X86_STEPPING_ANY, feature, data) |
| 69 | + |
| 49 | 70 | /** |
| 50 | 71 | * X86_MATCH_VENDOR_FAM_FEATURE - Macro for matching vendor, family and CPU feature |
| 51 | 72 | * @vendor: The vendor name, e.g. INTEL, AMD, HYGON, ..., ANY |