mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
LinuxKPI: add BITS_TO_BYTES()
Just like BITS_TO_LONG() ... used in rtw89. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D44603
This commit is contained in:
parent
218b2ccf8c
commit
f674f016c0
1 changed files with 1 additions and 0 deletions
|
|
@ -54,6 +54,7 @@
|
|||
#define GENMASK_ULL(h, l) (((~0ULL) >> (BITS_PER_LONG_LONG - (h) - 1)) & ((~0ULL) << (l)))
|
||||
#define BITS_PER_BYTE 8
|
||||
#define BITS_PER_TYPE(t) (sizeof(t) * BITS_PER_BYTE)
|
||||
#define BITS_TO_BYTES(n) howmany((n), BITS_PER_BYTE)
|
||||
|
||||
#define hweight8(x) bitcount((uint8_t)(x))
|
||||
#define hweight16(x) bitcount16(x)
|
||||
|
|
|
|||
Loading…
Reference in a new issue