summaryrefslogtreecommitdiff
path: root/include/openvswitch/util.h
diff options
context:
space:
mode:
authorBen Warren <ben@skyportsystems.com>2016-04-04 21:32:07 -0400
committerBen Pfaff <blp@ovn.org>2016-04-14 13:47:18 -0700
commit064d7f842838bdc41a3b80e49ec92eee19e6e41b (patch)
tree80b3f479dd3c7364b1cf8d8ded10e70dfb3fdd77 /include/openvswitch/util.h
parente29747e4405e032f4f3021db510783b6e422f9b6 (diff)
downloadopenvswitch-064d7f842838bdc41a3b80e49ec92eee19e6e41b.tar.gz
Move lib/meta-flow.h to include/openvswitch directory
This commit also moves some bitmap macros into public header files and adds some #include directives in soure files in order to make the 'meta-flow.h' move possible. Signed-off-by: Ben Warren <ben@skyportsystems.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'include/openvswitch/util.h')
-rw-r--r--include/openvswitch/util.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/openvswitch/util.h b/include/openvswitch/util.h
index cfafc3612..2230b2a0c 100644
--- a/include/openvswitch/util.h
+++ b/include/openvswitch/util.h
@@ -191,6 +191,10 @@ is_pow2(uintmax_t x)
#define RDP2_4(X) (RDP2_5(X) | (RDP2_5(X) >> 2))
#define RDP2_5(X) ( (X) | ( (X) >> 1))
+/* Macros for sizing bitmaps */
+#define BITMAP_ULONG_BITS (sizeof(unsigned long) * CHAR_BIT)
+#define BITMAP_N_LONGS(N_BITS) DIV_ROUND_UP(N_BITS, BITMAP_ULONG_BITS)
+
/* Given ATTR, and TYPE, cast the ATTR to TYPE by first casting ATTR to
* (void *). This is to suppress the alignment warning issued by clang. */
#define ALIGNED_CAST(TYPE, ATTR) ((TYPE) (void *) (ATTR))