From d2f97b2a2651d8e1a6e9e1dcb07cfe8570efcfff Mon Sep 17 00:00:00 2001 From: Tom Caputi Date: Thu, 14 Jul 2016 15:51:24 -0400 Subject: [PATCH] Added highbit() and lowbit() macros Signed-off-by: Tom Caputi Signed-off-by: Tony Hutter Signed-off-by: Brian Behlendorf Closes #562 --- include/sys/sysmacros.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/sys/sysmacros.h b/include/sys/sysmacros.h index 4a96e075f..f6b1e28e8 100644 --- a/include/sys/sysmacros.h +++ b/include/sys/sysmacros.h @@ -158,6 +158,9 @@ extern uint32_t zone_get_hostid(void *zone); extern void spl_setup(void); extern void spl_cleanup(void); +#define highbit(x) __fls(x) +#define lowbit(x) __ffs(x) + #define highbit64(x) fls64(x) #define makedevice(maj,min) makedev(maj,min)