From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BCE16A04F0; Thu, 19 Dec 2019 12:24:30 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 473161BE8A; Thu, 19 Dec 2019 12:24:30 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id AE6C51BDFD for ; Thu, 19 Dec 2019 12:24:28 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xBJBN8nF007138; Thu, 19 Dec 2019 03:24:27 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=B3WRrQgS3Xj+0WX1ohZk0W8NYXn21n8I6vhn0eyMzyQ=; b=qUyxoEWulw3Itre9mdStAf51SbbzrAfzP0B1VlsDdcJ0e2dMlZYMAIyfXcI1azUSxdBu qYKW8zqeCNoFuuJm5xHIDVpaXXjvF2SkX9fHeclPYeFQGu7+f49A/dDEizPvirX8EO72 FaoGctLYVC+52RlvUqpO1AXLxh+L/7kb+AZEOBobesn4OnlKiAPtgnBQOjoj3hzbIxtf lpoOMuHWgWv3DLGNHRDahpo/SnqNmBXKG6/I1jlm2w3qM8zjJDgzrJ1e/E86ooPfIFbJ pz8l0srhWEdPktIn86wcAyZfqq+xJzk/bXzU14Ba/7kFxTW0iUp9dXZ+6/eu2Vg14nYz 3w== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 2wxneb2p8x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 19 Dec 2019 03:24:26 -0800 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 19 Dec 2019 03:24:25 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 19 Dec 2019 03:24:25 -0800 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 584A73F7041; Thu, 19 Dec 2019 03:24:23 -0800 (PST) From: To: CC: , , Jerin Jacob Date: Thu, 19 Dec 2019 16:55:05 +0530 Message-ID: <20191219112507.3142025-1-jerinj@marvell.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191208113413.2179329-1-jerinj@marvell.com> References: <20191208113413.2179329-1-jerinj@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-12-19_01:2019-12-17,2019-12-19 signatures=0 Subject: [dpdk-dev] [PATCH v2 1/3] eal: introduce structure marker typedefs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Jerin Jacob 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 --- 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