mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
LinuxKPI: add HWEIGHT32()
Add HWEIGHT32() macro needed by iwlwifi and while here add the 8/16/64
variants likewise.
Sponsored by: The FreeBSD Foundation
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30501
(cherry picked from commit 4cc8a9da49)
This commit is contained in:
parent
1b9b5de489
commit
b5519f2ce7
1 changed files with 5 additions and 0 deletions
|
|
@ -63,6 +63,11 @@
|
|||
#define hweight64(x) bitcount64(x)
|
||||
#define hweight_long(x) bitcountl(x)
|
||||
|
||||
#define HWEIGHT8(x) (bitcount8((uint8_t)(x)) + 1)
|
||||
#define HWEIGHT16(x) (bitcount16(x) + 1)
|
||||
#define HWEIGHT32(x) (bitcount32(x) + 1)
|
||||
#define HWEIGHT64(x) (bitcount64(x) + 1)
|
||||
|
||||
static inline int
|
||||
__ffs(int mask)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue