From: Jerin Jacob <jer...@marvell.com>

Introduce EAL typedef for structure 1B, 2B, 4B, 8B alignment marking and
a generic marker for a point in a structure.

Signed-off-by: Jerin Jacob <jer...@marvell.com>
---

v2:
- Changed __extension__  to  RTE_STD_C11 (Thomas)
- Change "a point" to "any place" of RTE_MARKER comment(Thomas)

 lib/librte_eal/common/include/rte_common.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lib/librte_eal/common/include/rte_common.h 
b/lib/librte_eal/common/include/rte_common.h
index 459d082d1..00c8b8434 100644
--- a/lib/librte_eal/common/include/rte_common.h
+++ b/lib/librte_eal/common/include/rte_common.h
@@ -335,6 +335,18 @@ typedef uint64_t phys_addr_t;
 typedef uint64_t rte_iova_t;
 #define RTE_BAD_IOVA ((rte_iova_t)-1)
 
+/*********** Structure alignment markers ********/
+
+/** Generic marker for any place in a structure. */
+RTE_STD_C11 typedef void    *RTE_MARKER[0];
+/** Marker for 1B alignment in a structure. */
+RTE_STD_C11 typedef uint8_t  RTE_MARKER8[0];
+/** Marker for 2B alignment in a structure. */
+RTE_STD_C11 typedef uint16_t RTE_MARKER16[0];
+/** Marker for 4B alignment in a structure. */
+RTE_STD_C11 typedef uint16_t RTE_MARKER32[0];
+/** Marker for 8B alignment in a structure. */
+RTE_STD_C11 typedef uint64_t RTE_MARKER64[0];
 
 /**
  * Combines 32b inputs most significant set bits into the least
-- 
2.24.1

Reply via email to