summaryrefslogtreecommitdiffstats
path: root/drivers/net/mlx5/mlx5_utils.h
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2017-12-08 17:16:13 +0000
committerLuca Boccassi <luca.boccassi@gmail.com>2017-12-08 17:16:56 +0000
commit47d9763a1dd3103d732da9eec350cfc1cd784717 (patch)
treee44976be8d0ddfb4a054556d07b3b6036cf88e87 /drivers/net/mlx5/mlx5_utils.h
parentfdd2322bb45e83d3fd96b06ea32a4afbb60bcb6f (diff)
New upstream version 16.11.4
Change-Id: I733e0292d2e060161d148b3e114065d00b36d2ba Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_utils.h')
-rw-r--r--drivers/net/mlx5/mlx5_utils.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/mlx5/mlx5_utils.h b/drivers/net/mlx5/mlx5_utils.h
index a824787f..f126979b 100644
--- a/drivers/net/mlx5/mlx5_utils.h
+++ b/drivers/net/mlx5/mlx5_utils.h
@@ -35,6 +35,7 @@
#define RTE_PMD_MLX5_UTILS_H_
#include <stddef.h>
+#include <stdint.h>
#include <stdio.h>
#include <limits.h>
#include <assert.h>
@@ -61,6 +62,9 @@
!!(((bf)[((b) / (sizeof((bf)[0]) * CHAR_BIT))] & \
((size_t)1 << ((b) % (sizeof((bf)[0]) * CHAR_BIT))))))
+/* Convert a bit number to the corresponding 64-bit mask */
+#define MLX5_BITSHIFT(v) (UINT64_C(1) << (v))
+
/* Save and restore errno around argument evaluation. */
#define ERRNO_SAFE(x) ((errno = (int []){ errno, ((x), 0) }[0]))