From patchwork Wed Jul 20 20:38:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 72508 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp77974qga; Wed, 20 Jul 2016 13:48:43 -0700 (PDT) X-Received: by 10.129.145.10 with SMTP id i10mr26814150ywg.263.1469047723600; Wed, 20 Jul 2016 13:48:43 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id z68si2753901qkb.225.2016.07.20.13.48.43; Wed, 20 Jul 2016 13:48:43 -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 1C6D1617AA; Wed, 20 Jul 2016 20:48:43 +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 6DAED68932; Wed, 20 Jul 2016 20:40:44 +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 E491468908; Wed, 20 Jul 2016 20:40:36 +0000 (UTC) Received: from mail-lf0-f41.google.com (mail-lf0-f41.google.com [209.85.215.41]) by lists.linaro.org (Postfix) with ESMTPS id A735068908 for ; Wed, 20 Jul 2016 20:39:20 +0000 (UTC) Received: by mail-lf0-f41.google.com with SMTP id f93so46377363lfi.2 for ; Wed, 20 Jul 2016 13:39:20 -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=TbgEiz9b65xhKnvdHBJlsjkzr+zLX3Q5eY/e0JjiDBo=; b=his1hYmvYDf6R9uwYU/f7PsX1eVaJs9PJPusEXvlmsXrpmsH38NokoL46D3KkTil+e G4mgkSMAToH0KWp9j1ZV/yVQxR6glJSH1m6MLwJbxjXcbkqy3Bkv5oPy39uluP9/Z/dm ATR07rZCMoLly2K7XM67QByuEoq/fLLpDPFHaLcfnzmvMjORe4io3ARDhZbRUZgaRe+X WxZJVDOO4DX0cldJjpZc8oeCPt48nxEVkxe1ezbXJlMfoYEQgc1XOlxxFZRyq1EQCmdy kxpBsPk1p/QDKVCkU94UsDvuLFnvdVGfAUF3WXjMjnqQ0ekfd+nE0EaIzu3bYfTo89+7 f3oQ== X-Gm-Message-State: ALyK8tISu1ZmxsNwKQmOXJ00MQTlEqMAboRjXSbCTD1g6JdyBiMacA9RWnGyj8yHRLBqx4jooHQ= X-Received: by 10.46.1.69 with SMTP id 66mr21849897ljb.27.1469047159522; Wed, 20 Jul 2016 13:39:19 -0700 (PDT) Received: from localhost.localdomain (c-83-233-90-46.cust.bredband2.com. [83.233.90.46]) by smtp.gmail.com with ESMTPSA id 29sm895112lfu.43.2016.07.20.13.39.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Jul 2016 13:39:18 -0700 (PDT) From: Christophe Milard To: mike.holmes@linaro.org, lng-odp@lists.linaro.org, balakrishna.garapati@linaro.org Date: Wed, 20 Jul 2016 22:38:57 +0200 Message-Id: <1469047144-7960-12-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1469047144-7960-1-git-send-email-christophe.milard@linaro.org> References: <1469047144-7960-1-git-send-email-christophe.milard@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv2 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 (sha:77a27212b563299959fb2a609b86bb9117a8f918). 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 \