From patchwork Mon Jul 18 17:49:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 72229 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp211809qga; Mon, 18 Jul 2016 09:58:35 -0700 (PDT) X-Received: by 10.37.198.211 with SMTP id k202mr14822470ybf.164.1468861115103; Mon, 18 Jul 2016 09:58:35 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id s90si10948688qtd.71.2016.07.18.09.58.34; Mon, 18 Jul 2016 09:58:35 -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 B982961769; Mon, 18 Jul 2016 16:58:34 +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 5221A68829; Mon, 18 Jul 2016 16:51:26 +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 2986768800; Mon, 18 Jul 2016 16:50:57 +0000 (UTC) Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com [209.85.215.44]) by lists.linaro.org (Postfix) with ESMTPS id D82CF68799 for ; Mon, 18 Jul 2016 16:50:49 +0000 (UTC) Received: by mail-lf0-f44.google.com with SMTP id f93so136188388lfi.2 for ; Mon, 18 Jul 2016 09:50:49 -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=+N4UN8ZU7cC/hD5QKrfZ+AEX5zDvbQxk9mnlN6Xkzhw=; b=bYiLdXgAeNWadI/AhayK2HvIi1g6RgQpHdxW4JxZfGW/mklkkLKgatn4I/CxinyjZl 5C/l4oHwQgaRTn2OjLOiF16rR86joXuusKKZCFeOV6MqkIcpx/nID2et0+CW0ysT6CUw 9oLluEg2O1C7gFuIS9EdAKExQIalUE2dziMcvqnNTwOZcuXkR6kxUN/3V3xrNWfI4Jvw VjzU3sbjoHfTNV7ocrJX/LNdRoyPAF/6QWDVZbPmon2K4nEIndlRGQUUZkYsMJdn7e9s yzJ7OwuTW8ubqxJuuNzAf1NK8jDI4Ukv96TNKOkzzMf8y393N9GZVt8eK7lOnZsCydC5 ERaw== X-Gm-Message-State: ALyK8tLrjtYQHsWYV0KiZTJ6gZS8oOMcoESrTsLUDZMlH09KwnbKlUl0qTnPD7JFy8+Vr2R4tic= X-Received: by 10.25.17.228 with SMTP id 97mr16441097lfr.154.1468860648735; Mon, 18 Jul 2016 09:50:48 -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 y200sm2226229lfd.12.2016.07.18.09.50.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Jul 2016 09:50:48 -0700 (PDT) From: Christophe Milard To: mike.holmes@linaro.org, yi.he@linaro.org, balakrishna.garapati@linaro.org, lng-odp@lists.linaro.org Date: Mon, 18 Jul 2016 19:49:31 +0200 Message-Id: <1468864178-43721-12-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1468864178-43721-1-git-send-email-christophe.milard@linaro.org> References: <1468864178-43721-1-git-send-email-christophe.milard@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH 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" duplicated from the API side (hash: 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 \