linuxkpi: Define FIELD_FIT()

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38536
This commit is contained in:
Jean-Sébastien Pédron 2023-02-09 00:38:22 +01:00
parent 83276e1f95
commit bf6f665081
No known key found for this signature in database
GPG Key ID: 39E99761A5FD94CC

View File

@ -127,6 +127,9 @@ _uX_replace_bits(8)
#define __bf_shf(x) (__builtin_ffsll(x) - 1)
#define FIELD_FIT(_mask, _value) \
(!(((typeof(_mask))(_value) << __bf_shf(_mask)) & ~(_mask)))
#define FIELD_PREP(_mask, _value) \
(((typeof(_mask))(_value) << __bf_shf(_mask)) & (_mask))