[dpdk-dev] [RFC PATCH 1/6] eal: introduce macros for getting value for bit
Parav Pandit
parav at mellanox.com
Wed Jun 10 19:17:23 CEST 2020
There are several drivers which duplicate bit generation macro.
Introduce a generic bit macros so that such drivers avoid redefining
same in multiple drivers.
Signed-off-by: Parav Pandit <parav at mellanox.com>
---
lib/librte_eal/include/rte_bits.h | 10 ++++++++++
1 file changed, 10 insertions(+)
create mode 100644 lib/librte_eal/include/rte_bits.h
diff --git a/lib/librte_eal/include/rte_bits.h b/lib/librte_eal/include/rte_bits.h
new file mode 100644
index 000000000..37f284971
--- /dev/null
+++ b/lib/librte_eal/include/rte_bits.h
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright 2020 Mellanox Technologies, Ltd.
+ */
+
+#ifndef _RTE_BITS_H_
+#define _RTE_BITS_H_
+
+#define RTE_BIT(bit_num) (1UL << (bit_num))
+
+#endif
--
2.25.4
More information about the dev
mailing list