linuxkpi: Define FIELD_FIT()
Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38536
This commit is contained in:
parent
83276e1f95
commit
bf6f665081
@ -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))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user