Lines Matching full:field

70 				 _pfx "value too large for the field"); \
79 * FIELD_MAX() - produce the maximum value representable by a field
80 * @_mask: shifted mask defining the field's length and position
82 * FIELD_MAX() returns the maximum value that can be held in the field
92 * FIELD_FIT() - check if value fits in the field
93 * @_mask: shifted mask defining the field's length and position
94 * @_val: value to test against the field
106 * @_mask: shifted mask defining the field's length and position
107 * @_val: value to put in the field
120 * @_mask: shifted mask defining the field's length and position
123 * FIELD_GET() extracts the field specified by @_mask from the
136 static __always_inline u64 field_multiplier(u64 field) in field_multiplier() argument
138 if ((field | (field - 1)) & ((field | (field - 1)) + 1)) in field_multiplier()
140 return field & -field; in field_multiplier()
142 static __always_inline u64 field_mask(u64 field) in field_mask() argument
144 return field / field_multiplier(field); in field_mask()
146 #define field_max(field) ((typeof(field))field_mask(field)) argument
148 static __always_inline __##type type##_encode_bits(base v, base field) \
150 if (__builtin_constant_p(v) && (v & ~field_mask(field))) \
152 return to((v & field_mask(field)) * field_multiplier(field)); \
155 base val, base field) \
157 return (old & ~to(field)) | type##_encode_bits(val, field); \
160 base val, base field) \
162 *p = (*p & ~to(field)) | type##_encode_bits(val, field); \
164 static __always_inline base type##_get_bits(__##type v, base field) \
166 return (from(v) & field)/field_multiplier(field); \