From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 7E10CC35A for ; Fri, 13 Nov 2015 19:59:11 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 13 Nov 2015 10:59:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,288,1444719600"; d="scan'208";a="837290951" Received: from dwdohert-dpdk-fedora-20.ir.intel.com (HELO dwdohert-dpdk-fedora-23.ir.intel.com) ([163.33.213.71]) by fmsmga001.fm.intel.com with ESMTP; 13 Nov 2015 10:59:11 -0800 From: Declan Doherty To: dev@dpdk.org Date: Fri, 13 Nov 2015 18:58:03 +0000 Message-Id: <1447441090-8129-4-git-send-email-declan.doherty@intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1447441090-8129-1-git-send-email-declan.doherty@intel.com> References: <1447176763-19303-1-git-send-email-declan.doherty@intel.com> <1447441090-8129-1-git-send-email-declan.doherty@intel.com> Subject: [dpdk-dev] [PATCH v7 03/10] eal: add __rte_packed /__rte_aligned macros X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 18:59:11 -0000 Adding a new macro for specifying __aligned__ attribute, and updating the current __rte_cache_aligned macro to use it. Also adding a new macro to specify the __packed__ attribute Signed-off-by: Declan Doherty Acked-by: Sergio Gonzalez Monroy --- lib/librte_eal/common/include/rte_memory.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h index 1bed415..18fd952 100644 --- a/lib/librte_eal/common/include/rte_memory.h +++ b/lib/librte_eal/common/include/rte_memory.h @@ -76,9 +76,19 @@ enum rte_page_sizes { /**< Return the first cache-aligned value greater or equal to size. */ /** + * Force alignment + */ +#define __rte_aligned(a) __attribute__((__aligned__(a))) + +/** * Force alignment to cache line. */ -#define __rte_cache_aligned __attribute__((__aligned__(RTE_CACHE_LINE_SIZE))) +#define __rte_cache_aligned __rte_aligned(RTE_CACHE_LINE_SIZE) + +/** + * Force a structure to be packed + */ +#define __rte_packed __attribute__((__packed__)) typedef uint64_t phys_addr_t; /**< Physical address definition. */ #define RTE_BAD_PHYS_ADDR ((phys_addr_t)-1) @@ -104,7 +114,7 @@ struct rte_memseg { /**< store segment MFNs */ uint64_t mfn[DOM0_NUM_MEMBLOCK]; #endif -} __attribute__((__packed__)); +} __rte_packed; /** * Lock page in physical memory and prevent from swapping. -- 2.5.0