summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTim Chase <[email protected]>2014-04-26 20:56:03 -0500
committerBrian Behlendorf <[email protected]>2014-07-22 09:47:48 -0700
commit7f23e0010977ffa492d6df57aee0c97ce8e74278 (patch)
tree1aced52d08f23ac1d04de9e53b7dfc0391002059 /include
parent377e12f14a2c3694c3a733782b91ae7beecc44f3 (diff)
Add functions and macros as used upstream.
Added highbit64() and howmany() which are used in recent upstream code. Both highbit() and highbit64() should at some point be re-factored to use the optimized fls() and fls64() functions. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Prakash Surya <[email protected]> Signed-off-by: Tim Chase <[email protected]> Closes #363
Diffstat (limited to 'include')
-rw-r--r--include/sys/sysmacros.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/sys/sysmacros.h b/include/sys/sysmacros.h
index e73c7fd1e..565fc5600 100644
--- a/include/sys/sysmacros.h
+++ b/include/sys/sysmacros.h
@@ -150,6 +150,7 @@ extern unsigned long spl_hostid;
/* Missing misc functions */
extern int highbit(unsigned long i);
+extern int highbit64(uint64_t i);
extern uint32_t zone_get_hostid(void *zone);
extern void spl_setup(void);
extern void spl_cleanup(void);
@@ -172,6 +173,9 @@ extern void spl_cleanup(void);
#ifndef roundup
#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
#endif
+#ifndef howmany
+#define howmany(x, y) (((x) + ((y) - 1)) / (y))
+#endif
/*
* Compatibility macros/typedefs needed for Solaris -> Linux port