diff --git a/sys/compat/linuxkpi/common/include/linux/bitops.h b/sys/compat/linuxkpi/common/include/linux/bitops.h index 0e25fd3cfb1d..49bfc4cc7414 100644 --- a/sys/compat/linuxkpi/common/include/linux/bitops.h +++ b/sys/compat/linuxkpi/common/include/linux/bitops.h @@ -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) {