From patchwork Tue Jul 26 02:56:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Brooks X-Patchwork-Id: 72753 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1454796qga; Mon, 25 Jul 2016 19:57:13 -0700 (PDT) X-Received: by 10.55.132.198 with SMTP id g189mr25099959qkd.16.1469501833131; Mon, 25 Jul 2016 19:57:13 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id z68si19691991qke.276.2016.07.25.19.57.12; Mon, 25 Jul 2016 19:57:13 -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 58D11686BA; Tue, 26 Jul 2016 02:57:12 +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 CFC63686C7; Tue, 26 Jul 2016 02:56:36 +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 E749B686BA; Tue, 26 Jul 2016 02:56:32 +0000 (UTC) Received: from mail-io0-f169.google.com (mail-io0-f169.google.com [209.85.223.169]) by lists.linaro.org (Postfix) with ESMTPS id B5CFF686A2 for ; Tue, 26 Jul 2016 02:56:31 +0000 (UTC) Received: by mail-io0-f169.google.com with SMTP id m101so190320610ioi.2 for ; Mon, 25 Jul 2016 19:56:31 -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=3W//PCB3UjXkOnsdiKbSUKXhiDJUJUuOE0a/jLw9n7c=; b=bdubrZOdOUQVHRjeRvLyZntkkTe/iQApAW16GfuUDhBbXBvAUNHA0bZnu7Yvf9+2ov HXk9PdAJDZwJAwpPxWpTOGmHDFvQLQkHYdrJJ8blgGWdXBKp4vs6AN9+fpfuvxgfdxGq Z7e7i0202SaHB5Cf3vm5CzvACk2uCFA8ZxQ7XJV/oQfcr+29tJLKtIKU5F9+7Fhn9Cbh cLNn2lCyyEXzFQN3txvxT0a0tzFeOZtAyDgRUiSjD3rq0516KBQ7JMJy/bvGfdapr0f5 4aiVIKF9FEWbnD8FL3L6hga9JNbAn0uO6+T0Zw97pjDUyst4NABirMYxZrkl5IxOinlN /SoA== X-Gm-Message-State: AEkoouuW9GVDOjzkcuCVOLtUKo4gBn4dwjDC3DVzS3G7G8nVKpgMgSRznmN1nvYt/xNzQuhExu4= X-Received: by 10.202.212.205 with SMTP id l196mr12003046oig.175.1469501791316; Mon, 25 Jul 2016 19:56:31 -0700 (PDT) Received: from localhost.localdomain (68-248-140-212.lightspeed.austtx.sbcglobal.net. [68.248.140.212]) by smtp.gmail.com with ESMTPSA id z189sm12624679oig.29.2016.07.25.19.56.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jul 2016 19:56:30 -0700 (PDT) From: Brian Brooks To: lng-odp@lists.linaro.org Date: Mon, 25 Jul 2016 21:56:14 -0500 Message-Id: <20160726025625.7343-2-brian.brooks@linaro.org> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160726025625.7343-1-brian.brooks@linaro.org> References: <20160726025625.7343-1-brian.brooks@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v3 01/12] 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 specific directories. Prefix internal cache line size identifier with '_'. 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 | 10 ++-------- 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 | 12 +++++------- 5 files changed, 10 insertions(+), 42 deletions(-) -- 2.9.0 Reviewed-by: Christophe Milard 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..5f4cf39 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 +#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..df9a3c1 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,7 @@ extern "C" { */ #include -#include + #ifdef __cplusplus }