From patchwork Tue Feb 23 08:12:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongbo Zhang X-Patchwork-Id: 62672 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1702098lbl; Tue, 23 Feb 2016 00:13:59 -0800 (PST) X-Received: by 10.140.32.100 with SMTP id g91mr40037302qgg.47.1456215236676; Tue, 23 Feb 2016 00:13:56 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id c204si32871791qha.64.2016.02.23.00.13.56; Tue, 23 Feb 2016 00:13:56 -0800 (PST) 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 Received: by lists.linaro.org (Postfix, from userid 109) id 49DFE62D4C; Tue, 23 Feb 2016 08:13:56 +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 D53F662D52; Tue, 23 Feb 2016 08:13:25 +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 51CCA62D52; Tue, 23 Feb 2016 08:13:20 +0000 (UTC) Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com [209.85.220.49]) by lists.linaro.org (Postfix) with ESMTPS id A0D9B6177D for ; Tue, 23 Feb 2016 08:13:17 +0000 (UTC) Received: by mail-pa0-f49.google.com with SMTP id yy13so106308541pab.3 for ; Tue, 23 Feb 2016 00:13:17 -0800 (PST) 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=/bYsGyfiLtmMvlHTdpBe/84AEVXkJDd77oLH7zy0pIg=; b=FFl1Gg4ozpzxcQrBfzcuYXQjCNXqaskyas8wBmWVWg1UY+JTNFm9I0heF0H9iY6KH5 aQEPGh3sJo0zHhZWcgE89WrsMpg8uj7ar7hjjTxZcdlljLi37f2wfvd8lXkEeuhqQ/0m yssda9XgzIwTjzOTU2cXNMTPKJliAf7Fj7F+J79F3md0tUSNFcWqnaWYgCKUVBNj9ipO BzuP5+nOzWGBNkKUwvrN2URqEGiiDSy+8YyidmI0ZItzRGv3T7dFoRVZUrDHK+qXrSY0 knGZhRnakmbVd4/ZewHU3OEeX4DhXcDmMlWb3A726ouG6M1pAIeMpWPfkgXWHruPJy2J Fw7w== X-Gm-Message-State: AG10YOTL8tr0vRrMz3MXBDTQB5/PWXN3ef9az2S0HuFxQUDOE6lznkNFVXCNtwsdcQ5yCZ6Du2g= X-Received: by 10.66.119.202 with SMTP id kw10mr39271623pab.110.1456215196993; Tue, 23 Feb 2016 00:13:16 -0800 (PST) Received: from ubuntu1504.ap.freescale.net (gate-zmy3.freescale.com. [192.88.167.1]) by smtp.gmail.com with ESMTPSA id 17sm41920352pfp.96.2016.02.23.00.13.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Feb 2016 00:13:16 -0800 (PST) From: hongbo.zhang@linaro.org To: lng-odp@lists.linaro.org Date: Tue, 23 Feb 2016 16:12:46 +0800 Message-Id: <1456215173-4456-2-git-send-email-hongbo.zhang@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1456215173-4456-1-git-send-email-hongbo.zhang@linaro.org> References: <1456215173-4456-1-git-send-email-hongbo.zhang@linaro.org> X-Topics: Architecture patch Subject: [lng-odp] [PATCH v4 1/8] linux-generic: separate x86 ODP_CACHE_LINE_SIZE to its arch file 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: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Hongbo Zhang Currently all ODP_CACHE_LINE_SIZE macros for different architectures are held in one header file, they should be moved to their own arch file. This patch moves ODP_CACHE_LINE_SIZE for x86. Signed-off-by: Mike Holmes Signed-off-by: Hongbo Zhang Reviewed-and-tested-by: Bill Fischofer --- configure.ac | 1 + doc/application-api-guide/doxygen.cfg | 1 + m4/ax_prog_doxygen.m4 | 1 + platform/linux-generic/arch/x86/odp/cpu_arch.h | 10 ++++++++++ platform/linux-generic/include/odp/align.h | 9 ++------- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index a7cb035..c8ee8f8 100644 --- a/configure.ac +++ b/configure.ac @@ -392,6 +392,7 @@ AC_MSG_RESULT([ libdir: ${libdir} includedir: ${includedir} testdir: ${testdir} + WITH_ARCH: ${WITH_ARCH} cc: ${CC} cppflags: ${CPPFLAGS} diff --git a/doc/application-api-guide/doxygen.cfg b/doc/application-api-guide/doxygen.cfg index 7951e9e..4d6506d 100644 --- a/doc/application-api-guide/doxygen.cfg +++ b/doc/application-api-guide/doxygen.cfg @@ -14,6 +14,7 @@ INPUT = $(SRCDIR)/doc \ $(SRCDIR)/doc/users-guide \ $(SRCDIR)/include \ $(SRCDIR)/platform/$(WITH_PLATFORM)/include/odp \ + $(SRCDIR)/platform/$(WITH_PLATFORM)/arch/$(WITH_ARCH) \ $(SRCDIR)/helper/include FILE_PATTERNS = *.h odp*.c *.dox RECURSIVE = YES diff --git a/m4/ax_prog_doxygen.m4 b/m4/ax_prog_doxygen.m4 index 58bb016..de6d18e 100644 --- a/m4/ax_prog_doxygen.m4 +++ b/m4/ax_prog_doxygen.m4 @@ -409,6 +409,7 @@ DX_ENV_APPEND(PROJECT, $DX_PROJECT) DX_ENV_APPEND(DOCDIR, $DX_DOCDIR) DX_ENV_APPEND(VERSION, $VERSION) DX_ENV_APPEND(WITH_PLATFORM, $with_platform) +DX_ENV_APPEND(WITH_ARCH, $ARCH) # Doxygen itself: DX_ARG_ABLE(doc, [generate any doxygen documentation], diff --git a/platform/linux-generic/arch/x86/odp/cpu_arch.h b/platform/linux-generic/arch/x86/odp/cpu_arch.h index 997a954..3a16fa6 100644 --- a/platform/linux-generic/arch/x86/odp/cpu_arch.h +++ b/platform/linux-generic/arch/x86/odp/cpu_arch.h @@ -11,6 +11,16 @@ extern "C" { #endif +/** @ingroup odp_compiler_optim + * @{ + */ + +#define ODP_CACHE_LINE_SIZE 64 + +/** + * @} + */ + static inline void odp_cpu_pause(void) { #ifdef __SSE2__ diff --git a/platform/linux-generic/include/odp/align.h b/platform/linux-generic/include/odp/align.h index be8c9ae..161a302 100644 --- a/platform/linux-generic/include/odp/align.h +++ b/platform/linux-generic/include/odp/align.h @@ -31,11 +31,7 @@ extern "C" { #define ODP_FIELD_SIZEOF(type, member) sizeof(((type *)0)->member) -#if defined __x86_64__ || defined __i386__ - -#define ODP_CACHE_LINE_SIZE 64 - -#elif defined __arm__ || defined __aarch64__ +#if defined __arm__ || defined __aarch64__ #define ODP_CACHE_LINE_SIZE 64 @@ -47,8 +43,6 @@ extern "C" { #define ODP_CACHE_LINE_SIZE 64 -#else -#error GCC target not found #endif #else @@ -65,6 +59,7 @@ extern "C" { * @} */ +#include #include #ifdef __cplusplus