From patchwork Tue Jul 19 10:18:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Brooks X-Patchwork-Id: 72575 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp489620qga; Thu, 21 Jul 2016 08:03:00 -0700 (PDT) X-Received: by 10.200.57.108 with SMTP id t41mr57109085qtb.33.1469113380607; Thu, 21 Jul 2016 08:03:00 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id w7si5246591qtb.116.2016.07.21.08.02.56; Thu, 21 Jul 2016 08:03:00 -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 4224E6807F; Thu, 21 Jul 2016 15:02: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 B9E7267456; Thu, 21 Jul 2016 15:02:51 +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 AB5FE6168F; Thu, 21 Jul 2016 15:02:49 +0000 (UTC) Received: from mail-oi0-f54.google.com (mail-oi0-f54.google.com [209.85.218.54]) by lists.linaro.org (Postfix) with ESMTPS id CCA9361095 for ; Thu, 21 Jul 2016 15:02:48 +0000 (UTC) Received: by mail-oi0-f54.google.com with SMTP id l65so121324226oib.1 for ; Thu, 21 Jul 2016 08:02:48 -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=AC8rx/szbbGn5z3NqUsCOO5b0hEkgCarAVt+fUEgp7o=; b=IZwuswi0GIuKt4HHtACrKh9W4gZNwjwyIUjagq2ar8yS5JgViLr4/PwOC446W+krVk 0U7iSv7BvKUyGAheNkubudGuTb8cemBItnLdLOOn+PubCqLeOoOClI21hTJgViW5soTm 7d8rvISQRVewOQo+nq+fCgZAVSVnk0n/B6QAd1QdabKARJJuxpIeNB8/AEIscGl+st+k knkxT/IMrdFzOvVTHNaC/Wg4Bx2BSNvNAhLmnWoBS5zaAoFkQEvj2pLP5yJbh4E7Vovv B7V+e4A8LnVHBhwmj2N78mlPsoTdn+0eRbdEU8r/ij+TMAL4gnNotbKs2CmYgHEl9giR A/Rw== X-Gm-Message-State: ALyK8tLfzakCI4mCyZpzzg1ql+DHj4V9P/6MLQ2fTgjqI82GeNyGh/60Gb4ahfC8vBa6YqkY/wU= X-Received: by 10.157.18.246 with SMTP id g109mr31767463otg.180.1469113368238; Thu, 21 Jul 2016 08:02:48 -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 187sm3322710oid.20.2016.07.21.08.02.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jul 2016 08:02:47 -0700 (PDT) From: Brian Brooks To: lng-odp@lists.linaro.org Date: Tue, 19 Jul 2016 05:18:39 -0500 Message-Id: <20160719101839.106211-1-brian.brooks@linaro.org> X-Mailer: git-send-email 2.9.0 X-Topics: patch Subject: [lng-odp] [PATCH v2] linux-generic: fixup cache line size API 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 '_' since it leaks into the ODP API header files by inclusion. 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 | 14 ++++---------- 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 | 8 ++------ 5 files changed, 9 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..1f49cd2 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 +#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..c36b17b 100644 --- a/platform/linux-generic/include/odp/api/align.h +++ b/platform/linux-generic/include/odp/api/align.h @@ -31,16 +31,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)