diff options
author | Tom Caputi <[email protected]> | 2016-07-14 15:51:24 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-07-20 10:28:46 -0700 |
commit | d2f97b2a2651d8e1a6e9e1dcb07cfe8570efcfff (patch) | |
tree | d925609902a69330eebc8a8698327f54462314b1 /include | |
parent | 5ad98ad0978d43b41180018536ce5efdaa4ea546 (diff) |
Added highbit() and lowbit() macros
Signed-off-by: Tom Caputi <[email protected]>
Signed-off-by: Tony Hutter <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #562
Diffstat (limited to 'include')
-rw-r--r-- | include/sys/sysmacros.h | 3 |
1 files changed, 3 insertions, 0 deletions
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) |