summaryrefslogtreecommitdiff
path: root/include/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/util.h')
-rw-r--r--include/util.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/util.h b/include/util.h
index a6de67e3d8..43d9a71992 100644
--- a/include/util.h
+++ b/include/util.h
@@ -66,6 +66,9 @@ extern "C" {
#define DIV_ROUND_UP(x, y) (((x) + ((y) - 1)) / (y))
#define DIV_ROUND_NEAREST(x, y) (((x) + ((y) / 2)) / (y))
+/* Convert number of bits to number of 32-bit words */
+#define BITS_TO_WORDS(x) (((x) + 31) / 32)
+
/*
* Swap two variables (requires c99)
*