From: Jerin Jacob Date: Thu, 19 Dec 2019 11:25:05 +0000 (+0530) Subject: eal: introduce structure markers X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=2b393160a480;p=dpdk.git eal: introduce structure markers 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 Reviewed-by: Gavin Hu Acked-by: Matan Azrad --- diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h index c352838073..4b5f3a31f0 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. */ +__extension__ typedef void *RTE_MARKER[0]; +/** Marker for 1B alignment in a structure. */ +__extension__ typedef uint8_t RTE_MARKER8[0]; +/** Marker for 2B alignment in a structure. */ +__extension__ typedef uint16_t RTE_MARKER16[0]; +/** Marker for 4B alignment in a structure. */ +__extension__ typedef uint16_t RTE_MARKER32[0]; +/** Marker for 8B alignment in a structure. */ +__extension__ typedef uint64_t RTE_MARKER64[0]; /** * Combines 32b inputs most significant set bits into the least