From patchwork Tue Jul 26 16:38:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Brooks X-Patchwork-Id: 72818 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1785280qga; Tue, 26 Jul 2016 09:38:40 -0700 (PDT) X-Received: by 10.237.53.125 with SMTP id b58mr37817590qte.104.1469551120198; Tue, 26 Jul 2016 09:38:40 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id x32si965117qta.101.2016.07.26.09.38.39; Tue, 26 Jul 2016 09:38:40 -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 B6574687EB; Tue, 26 Jul 2016 16:38:39 +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_H2, 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 E35FD687CA; Tue, 26 Jul 2016 16:38:35 +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 70444687E5; Tue, 26 Jul 2016 16:38:33 +0000 (UTC) Received: from mail-io0-f181.google.com (mail-io0-f181.google.com [209.85.223.181]) by lists.linaro.org (Postfix) with ESMTPS id A77DF687C1 for ; Tue, 26 Jul 2016 16:38:32 +0000 (UTC) Received: by mail-io0-f181.google.com with SMTP id b62so29365054iod.3 for ; Tue, 26 Jul 2016 09:38:32 -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; bh=B+/zSOO7nwQzq/ICMyXIRnp1qiTEow7kqhQ9COLXzqU=; b=I0U2dabcua4eDaJrfgLjj2DoiQU9YWRj5Ahf3O71rWBBJi+fSu1nGoeYkaQKFKfXq3 T+o8dFUj+Zu8hIYlFI79SQsIdQb05Wxm2a27y8kewzrdB9ODrGzzyl13mFggLIyaVAZo Fu4jA/cz0w7NtFdu9/XwAibisGzRD/sU1ulBAa5xvm/pSVuNwLTXO+NKpF7khwXY6y3f bFeIROwVQ0kz1xqeDLaotBHGaNVyS1v+IZdbaSAdnV01fFl2nPnnHCLr2yzzNCzvQnGy +icI7fp8IyA+zl9f4mYjUqf2Xhd4Kri8CKSmBkZmE4EnuKfNlFI33o0iEBYSRfX3Wu6z 4QSw== X-Gm-Message-State: AEkoouvNih4uJBnH1/E+sPCMfAjqaWjckmE7FXnrR/jrJFQGU0lDQF6MdkEa1hkLsSbdbNU5drg= X-Received: by 10.157.52.200 with SMTP id t8mr14180041otd.90.1469551112094; Tue, 26 Jul 2016 09:38:32 -0700 (PDT) Received: from localhost.localdomain (adsl-68-248-140-212.dsl.applwi.ameritech.net. [68.248.140.212]) by smtp.gmail.com with ESMTPSA id d82sm565722oia.14.2016.07.26.09.38.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jul 2016 09:38:31 -0700 (PDT) From: Brian Brooks To: lng-odp@lists.linaro.org Date: Tue, 26 Jul 2016 11:38:27 -0500 Message-Id: <20160726163827.95668-1-brian.brooks@linaro.org> X-Mailer: git-send-email 2.9.0 X-Topics: patch Subject: [lng-odp] [PATCH v4] linux-generic: internal cache line size 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" Define the ODP API for cache line size to the cache line size defined in the internal architecture directories. Prefix internal cache line size identifier with '_odp'. Signed-off-by: Brian Brooks --- platform/linux-generic/arch/default/odp/api/cpu_arch.h | 10 +--------- platform/linux-generic/arch/mips64/odp/api/cpu_arch.h | 12 +++--------- platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h | 10 +--------- platform/linux-generic/arch/x86/odp/api/cpu_arch.h | 10 +--------- platform/linux-generic/include/odp/api/align.h | 11 ++++------- 5 files changed, 10 insertions(+), 43 deletions(-) -- 2.9.0 diff --git a/platform/linux-generic/arch/default/odp/api/cpu_arch.h b/platform/linux-generic/arch/default/odp/api/cpu_arch.h index 29f8889..22b1da2 100644 --- a/platform/linux-generic/arch/default/odp/api/cpu_arch.h +++ b/platform/linux-generic/arch/default/odp/api/cpu_arch.h @@ -11,15 +11,7 @@ extern "C" { #endif -/** @ingroup odp_compiler_optim - * @{ - */ - -#define ODP_CACHE_LINE_SIZE 64 - -/** - * @} - */ +#define _ODP_CACHE_LINE_SIZE 64 static inline void odp_cpu_pause(void) { diff --git a/platform/linux-generic/arch/mips64/odp/api/cpu_arch.h b/platform/linux-generic/arch/mips64/odp/api/cpu_arch.h index 7b5bfd2..3582b12 100644 --- a/platform/linux-generic/arch/mips64/odp/api/cpu_arch.h +++ b/platform/linux-generic/arch/mips64/odp/api/cpu_arch.h @@ -11,18 +11,12 @@ extern "C" { #endif -/** @ingroup odp_compiler_optim - * @{ - */ - #if defined __OCTEON__ -#define ODP_CACHE_LINE_SIZE 128 +#define _ODP_CACHE_LINE_SIZE 128 +#else +#error Please add support for your arch in cpu_arch.h #endif -/** - * @} - */ - static inline void odp_cpu_pause(void) { __asm__ __volatile__ ("nop"); diff --git a/platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h b/platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h index 29f8889..22b1da2 100644 --- a/platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h +++ b/platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h @@ -11,15 +11,7 @@ extern "C" { #endif -/** @ingroup odp_compiler_optim - * @{ - */ - -#define ODP_CACHE_LINE_SIZE 64 - -/** - * @} - */ +#define _ODP_CACHE_LINE_SIZE 64 static inline void odp_cpu_pause(void) { diff --git a/platform/linux-generic/arch/x86/odp/api/cpu_arch.h b/platform/linux-generic/arch/x86/odp/api/cpu_arch.h index 3a16fa6..44e6b30 100644 --- a/platform/linux-generic/arch/x86/odp/api/cpu_arch.h +++ b/platform/linux-generic/arch/x86/odp/api/cpu_arch.h @@ -11,15 +11,7 @@ extern "C" { #endif -/** @ingroup odp_compiler_optim - * @{ - */ - -#define ODP_CACHE_LINE_SIZE 64 - -/** - * @} - */ +#define _ODP_CACHE_LINE_SIZE 64 static inline void odp_cpu_pause(void) { diff --git a/platform/linux-generic/include/odp/api/align.h b/platform/linux-generic/include/odp/api/align.h index d8bc653..c238b80 100644 --- a/platform/linux-generic/include/odp/api/align.h +++ b/platform/linux-generic/include/odp/api/align.h @@ -17,6 +17,8 @@ extern "C" { #endif +#include + /** @ingroup odp_compiler_optim * @{ */ @@ -31,16 +33,12 @@ extern "C" { #define ODP_FIELD_SIZEOF(type, member) sizeof(((type *)0)->member) -#if defined __arm__ || defined __aarch64__ - -#define ODP_CACHE_LINE_SIZE 64 - -#endif - #else #error Non-gcc compatible compiler #endif +#define ODP_CACHE_LINE_SIZE _ODP_CACHE_LINE_SIZE + #define ODP_PAGE_SIZE 4096 #define ODP_ALIGNED_CACHE ODP_ALIGNED(ODP_CACHE_LINE_SIZE) @@ -52,7 +50,6 @@ extern "C" { */ #include -#include #ifdef __cplusplus }