From patchwork Tue Aug 2 21:29:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Brooks X-Patchwork-Id: 73187 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp378017qga; Tue, 2 Aug 2016 14:31:47 -0700 (PDT) X-Received: by 10.37.104.11 with SMTP id d11mr48796645ybc.77.1470173507334; Tue, 02 Aug 2016 14:31:47 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id m184si136132qkd.202.2016.08.02.14.31.47; Tue, 02 Aug 2016 14:31:47 -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 ECC736868B; Tue, 2 Aug 2016 21:31:46 +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 F342B6852E; Tue, 2 Aug 2016 21:30:34 +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 60D56686AC; Tue, 2 Aug 2016 21:30:29 +0000 (UTC) Received: from mail-oi0-f41.google.com (mail-oi0-f41.google.com [209.85.218.41]) by lists.linaro.org (Postfix) with ESMTPS id 31F7D6867B for ; Tue, 2 Aug 2016 21:29:51 +0000 (UTC) Received: by mail-oi0-f41.google.com with SMTP id l65so255150177oib.1 for ; Tue, 02 Aug 2016 14:29:51 -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=NY/Ka5EIsQZTiSYup/LM1waqVUkNOd8dhCu6goHvb+4=; b=K9ZzcgP5aRogkHg5hkFJvHOW3iN4NsYlby0UrZzWl1rNVpJZq5OxTI45eMl/HOIhRP BalE4KBRELGsevQJH9CoPPPlkS+RX39LbER7J9dFG7q2V2TfUBVUiFrVJTqM4mhDD/LQ qQ/U7KUfQutT22+mDzKVVrK1W0E7U0Zn1lSyE36LbCaFWBa3pK+bA60f1kpfXQ20dQBf a7zkw5+cRomko+JZvrX4mNBw082IlzD8A6o5KV5XzZtGZ6IW+phmCrFnAQNih3bbXg1F k0w7XDV/GOOZXXgywulSPkCYn3Js5zEy0jZ5nsTJfz8eWt/aUTqJRfCuR6U+UBjj65fd v5Jw== X-Gm-Message-State: AEkoouvS21KJypWZUeaohrNaw2IP5mW2n0uLJXTPyIftL1mzTH8cOJFa5zKmaBiScJb7Sa79jwM= X-Received: by 10.157.17.5 with SMTP id g5mr36163718ote.57.1470173390694; Tue, 02 Aug 2016 14:29:50 -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 98sm2175967oth.15.2016.08.02.14.29.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Aug 2016 14:29:49 -0700 (PDT) From: Brian Brooks To: lng-odp@lists.linaro.org Date: Tue, 2 Aug 2016 16:29:42 -0500 Message-Id: <20160802212944.122603-4-brian.brooks@linaro.org> X-Mailer: git-send-email 2.9.2 In-Reply-To: <20160802212944.122603-1-brian.brooks@linaro.org> References: <20160802212944.122603-1-brian.brooks@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 4/6] linux-generic: lift odp_cpu_cycles_max/resolution() 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 odp_cpu_cycles_max() and odp_cpu_cycles_resolution() in the include API directory. These do not point to an internal value in arch because they are common across all archs. Signed-off-by: Brian Brooks --- platform/linux-generic/arch/default/odp_cpu_arch.c | 10 ---------- platform/linux-generic/arch/mips64/odp_cpu_arch.c | 10 ---------- platform/linux-generic/arch/powerpc/odp_cpu_arch.c | 10 ---------- platform/linux-generic/arch/x86/odp_cpu_arch.c | 10 ---------- platform/linux-generic/include/odp/api/cpu.h | 11 +++++++++++ 5 files changed, 11 insertions(+), 40 deletions(-) -- 2.9.2 diff --git a/platform/linux-generic/arch/default/odp_cpu_arch.c b/platform/linux-generic/arch/default/odp_cpu_arch.c index 2ac223e..109dd93 100644 --- a/platform/linux-generic/arch/default/odp_cpu_arch.c +++ b/platform/linux-generic/arch/default/odp_cpu_arch.c @@ -36,13 +36,3 @@ uint64_t odp_cpu_cycles(void) return cycles; } - -uint64_t odp_cpu_cycles_max(void) -{ - return UINT64_MAX; -} - -uint64_t odp_cpu_cycles_resolution(void) -{ - return 1; -} diff --git a/platform/linux-generic/arch/mips64/odp_cpu_arch.c b/platform/linux-generic/arch/mips64/odp_cpu_arch.c index 646acf9..6dc8f86 100644 --- a/platform/linux-generic/arch/mips64/odp_cpu_arch.c +++ b/platform/linux-generic/arch/mips64/odp_cpu_arch.c @@ -19,13 +19,3 @@ uint64_t odp_cpu_cycles(void) return cycle; } - -uint64_t odp_cpu_cycles_max(void) -{ - return UINT64_MAX; -} - -uint64_t odp_cpu_cycles_resolution(void) -{ - return 1; -} diff --git a/platform/linux-generic/arch/powerpc/odp_cpu_arch.c b/platform/linux-generic/arch/powerpc/odp_cpu_arch.c index 2ac223e..109dd93 100644 --- a/platform/linux-generic/arch/powerpc/odp_cpu_arch.c +++ b/platform/linux-generic/arch/powerpc/odp_cpu_arch.c @@ -36,13 +36,3 @@ uint64_t odp_cpu_cycles(void) return cycles; } - -uint64_t odp_cpu_cycles_max(void) -{ - return UINT64_MAX; -} - -uint64_t odp_cpu_cycles_resolution(void) -{ - return 1; -} diff --git a/platform/linux-generic/arch/x86/odp_cpu_arch.c b/platform/linux-generic/arch/x86/odp_cpu_arch.c index c8cf27b..c3be356 100644 --- a/platform/linux-generic/arch/x86/odp_cpu_arch.c +++ b/platform/linux-generic/arch/x86/odp_cpu_arch.c @@ -21,13 +21,3 @@ uint64_t odp_cpu_cycles(void) return tsc.tsc_64; } - -uint64_t odp_cpu_cycles_max(void) -{ - return UINT64_MAX; -} - -uint64_t odp_cpu_cycles_resolution(void) -{ - return 1; -} diff --git a/platform/linux-generic/include/odp/api/cpu.h b/platform/linux-generic/include/odp/api/cpu.h index 4585d35..8dd978e 100644 --- a/platform/linux-generic/include/odp/api/cpu.h +++ b/platform/linux-generic/include/odp/api/cpu.h @@ -18,6 +18,17 @@ extern "C" { #endif #include "cpu_arch.h" +#include + +static inline uint64_t odp_cpu_cycles_max(void) +{ + return UINT64_MAX; +} + +static inline uint64_t odp_cpu_cycles_resolution(void) +{ + return 1; +} static inline void odp_cpu_pause(void) {