From patchwork Fri Feb 5 08:56:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongbo Zhang X-Patchwork-Id: 61260 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp958082lbl; Fri, 5 Feb 2016 00:57:44 -0800 (PST) X-Received: by 10.107.16.17 with SMTP id y17mr16212656ioi.119.1454662663988; Fri, 05 Feb 2016 00:57:43 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id e41si9438600ioj.85.2016.02.05.00.57.43; Fri, 05 Feb 2016 00:57:43 -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; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id DBE1461D25; Fri, 5 Feb 2016 08:57:42 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=Bf64rO8f; dkim-adsp=none (unprotected policy); dkim-atps=neutral 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.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,T_DKIM_INVALID,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 8BB6661D29; Fri, 5 Feb 2016 08:57:12 +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 A75A461D34; Fri, 5 Feb 2016 08:57:07 +0000 (UTC) Received: from mail-pf0-f179.google.com (mail-pf0-f179.google.com [209.85.192.179]) by lists.linaro.org (Postfix) with ESMTPS id 4265061945 for ; Fri, 5 Feb 2016 08:57:02 +0000 (UTC) Received: by mail-pf0-f179.google.com with SMTP id 65so65638137pfd.2 for ; Fri, 05 Feb 2016 00:57:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xqqxOLScbYR85VWgsE2q3bKeRhIjaRGf5PH7C5RQ48g=; b=Bf64rO8fExPyfznSHvmkKwEOAF3yXZhJz3x9HKX6/YA5kw8tx3gHck5DQ/4UYBgh// 3ZbK+skRrb8rP0zvgd4KrPTtPSomRIt4rdkor74/74p4M65ySbX+AlWy0IexoOPZgZB5 dWYOFBfjbZsgYZmfc6BtoHhHRMm7yfwy8JfKY= 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=xqqxOLScbYR85VWgsE2q3bKeRhIjaRGf5PH7C5RQ48g=; b=HhrIYvpHYNcfXFmjFh34pGZTP4JmEjI2Kt7Cod4TB+ecviuiqK7+IX/Znbpi+U3vzB LQIlZQLjIdpyrkbrTYzAPf0KESbH/sl3oGus2DfK1I2yk/gq+taSmCf+p0+e8wvsRAu8 IzhmTHL9M1SaqVPFudz16N05XbD5EejJNTgfFwNrZA0tb3R+7DDWjbLGeWZWnHeTKROL j4lUrpudGGE206CQOiz9G2jDS84BK7bFxf+JcJtfy3or7vRRBFZr9l9bbH/nt62AB3G2 Mc0uVkjPLWT9ZAu/WeEvH5dxxIzXMfHgqycZiHpn+q/qlDiYwurV9zhjcTdwmk227xyb kwhw== X-Gm-Message-State: AG10YOQOb2JGn+4rCz7HQA/7w9jrJwDZ1TeQ0sad/ahXFLfqGhLsUVFNv6+p1GFf3/xr7BOxTGk= X-Received: by 10.98.89.78 with SMTP id n75mr17969761pfb.120.1454662621680; Fri, 05 Feb 2016 00:57:01 -0800 (PST) Received: from ubuntu1504.ap.freescale.net (gate-zmy3.freescale.com. [192.88.167.1]) by smtp.gmail.com with ESMTPSA id h89sm18321814pfj.52.2016.02.05.00.56.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Feb 2016 00:57:01 -0800 (PST) From: hongbo.zhang@linaro.org To: lng-odp@lists.linaro.org Date: Fri, 5 Feb 2016 16:56:44 +0800 Message-Id: <1454662607-28792-2-git-send-email-hongbo.zhang@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1454662607-28792-1-git-send-email-hongbo.zhang@linaro.org> References: <1454662607-28792-1-git-send-email-hongbo.zhang@linaro.org> X-Topics: Architecture patch Subject: [lng-odp] [PATCH v3 API-NEXT 1/4] 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: Hongbo Zhang --- doc/application-api-guide/doxygen.cfg | 1 + include/odp/api/align.h | 5 ----- platform/linux-generic/arch/x86/odp/cpu_arch.h | 14 ++++++++++++++ platform/linux-generic/include/odp/align.h | 9 ++------- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/doc/application-api-guide/doxygen.cfg b/doc/application-api-guide/doxygen.cfg index 7951e9e..c585108 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/ \ $(SRCDIR)/helper/include FILE_PATTERNS = *.h odp*.c *.dox RECURSIVE = YES diff --git a/include/odp/api/align.h b/include/odp/api/align.h index 677ff12..f4b4be6 100644 --- a/include/odp/api/align.h +++ b/include/odp/api/align.h @@ -47,11 +47,6 @@ extern "C" { */ /** - * @def ODP_CACHE_LINE_SIZE - * Cache line size - */ - -/** * @def ODP_PAGE_SIZE * Page size */ diff --git a/platform/linux-generic/arch/x86/odp/cpu_arch.h b/platform/linux-generic/arch/x86/odp/cpu_arch.h index 997a954..58836c6 100644 --- a/platform/linux-generic/arch/x86/odp/cpu_arch.h +++ b/platform/linux-generic/arch/x86/odp/cpu_arch.h @@ -11,6 +11,20 @@ extern "C" { #endif +/** @ingroup odp_compiler_optim + * @{ + */ + +/** + * @def ODP_CACHE_LINE_SIZE + * Cache line size + */ +#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