From patchwork Thu Jul 21 12:06:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 72552 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp382312qga; Thu, 21 Jul 2016 04:17:19 -0700 (PDT) X-Received: by 10.200.48.112 with SMTP id g45mr81979890qte.70.1469099839486; Thu, 21 Jul 2016 04:17:19 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id d4si4635489qkf.184.2016.07.21.04.17.19; Thu, 21 Jul 2016 04:17:19 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 2FA1A68221; Thu, 21 Jul 2016 11:17:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 18BDF68972; Thu, 21 Jul 2016 11:08:24 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 2F52663A3A; Thu, 21 Jul 2016 11:08:19 +0000 (UTC) Received: from mail-lf0-f42.google.com (mail-lf0-f42.google.com [209.85.215.42]) by lists.linaro.org (Postfix) with ESMTPS id F2BB06155C for ; Thu, 21 Jul 2016 11:07:27 +0000 (UTC) Received: by mail-lf0-f42.google.com with SMTP id l69so58596967lfg.1 for ; Thu, 21 Jul 2016 04:07:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1nDLT2nHrFWch8/7qrnpu33h5n9/Dw3jbiDuqIl1WNI=; b=lGP5bmMb69fmKgWoiqsx+6Lv2c+4IWU4VF10vta3nPITjw+Gp2LAtQ5/GI7CaDXY7+ 3z1RTpzrSCctrygqkzH5F5Rf6UElL31ezKui0ETKAvbhj2Mo7kaOB+EMzt0e3SuZMumR at1SPDsO6BbJSSd+zIBcRhykL2uFHcR0Lhplad3WBVzR8cUQphdYBlx+6XNKuAyQOzda ihB5C/4+XWHWwJi3zgThQdrYWpob1o+atqlRkV0AxTBphggq+sZNiVrCMjzo8OZ5SJJo Yj3AcjPEZGqyUehdZko4knmyXGC/GNmKkK7VffQnXwAT+M8/XdqwBLUmzVVRwaExaa5E mI8w== X-Gm-Message-State: ALyK8tJpkUcRI3UlwhuA6zbvCQiXBdTJu3bK5sa1RwCcDMhbLDjOx9IPODZcOOvWIFlOstNLpow= X-Received: by 10.25.208.131 with SMTP id h125mr1224421lfg.214.1469099246743; Thu, 21 Jul 2016 04:07:26 -0700 (PDT) Received: from erachmi-ericsson.ki.sw.ericsson.se (c-83-233-90-46.cust.bredband2.com. [83.233.90.46]) by smtp.gmail.com with ESMTPSA id i80sm1577861lfg.6.2016.07.21.04.07.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Jul 2016 04:07:26 -0700 (PDT) From: Christophe Milard To: mike.holmes@linaro.org, lng-odp@lists.linaro.org, balakrishna.garapati@linaro.org Date: Thu, 21 Jul 2016 14:06:19 +0200 Message-Id: <1469102786-65530-12-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1469102786-65530-1-git-send-email-christophe.milard@linaro.org> References: <1469102786-65530-1-git-send-email-christophe.milard@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv3 11/18] drv: adding align.h X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Based on API interface file. Signed-off-by: Christophe Milard --- include/odp/drv/spec/align.h | 78 ++++++++++++++++++++++++++++++++++++++++++++ platform/Makefile.inc | 1 + 2 files changed, 79 insertions(+) create mode 100644 include/odp/drv/spec/align.h -- 2.7.4 diff --git a/include/odp/drv/spec/align.h b/include/odp/drv/spec/align.h new file mode 100644 index 0000000..2b2f32c --- /dev/null +++ b/include/odp/drv/spec/align.h @@ -0,0 +1,78 @@ +/* Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODPDRV alignments + */ + +#ifndef ODPDRV_API_ALIGN_H_ +#define ODPDRV_API_ALIGN_H_ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup odpdrv_compiler_optim + * Macros that allow cache line size configuration, check that + * alignment is a power of two etc. + * @{ + */ + +/* Checkpatch complains, but cannot use __aligned(size) for this purpose. */ + +/** + * @def ODPDRV_ALIGNED + * Defines type/struct/variable alignment in bytes + */ + +/** + * @def ODPDRV_PACKED + * Defines type/struct to be packed + */ + +/** + * @def ODPDRV_OFFSETOF + * Returns offset of member in type + */ + +/** + * @def ODPDRV_FIELD_SIZEOF + * Returns sizeof member + */ + +/** + * @def ODPDRV_CACHE_LINE_SIZE + * Cache line size + */ + +/** + * @def ODPDRV_PAGE_SIZE + * Page size + */ + +/** + * @def ODPDRV_ALIGNED_CACHE + * Defines type/struct/variable to be cache line size aligned + */ + +/** + * @def ODPDRV_ALIGNED_PAGE + * Defines type/struct/variable to be page size aligned + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#include +#endif diff --git a/platform/Makefile.inc b/platform/Makefile.inc index dd3b376..edb598f 100644 --- a/platform/Makefile.inc +++ b/platform/Makefile.inc @@ -63,6 +63,7 @@ odpapispecinclude_HEADERS = \ odpdrvspecincludedir= $(includedir)/odp/drv/spec odpdrvspecinclude_HEADERS = \ + $(top_srcdir)/include/odp/drv/spec/align.h \ $(top_srcdir)/include/odp/drv/spec/byteorder.h \ $(top_srcdir)/include/odp/drv/spec/compiler.h \ $(top_srcdir)/include/odp/drv/spec/std_types.h \