From patchwork Thu Aug 4 19:30:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Brooks X-Patchwork-Id: 73308 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1560048qga; Thu, 4 Aug 2016 12:32:06 -0700 (PDT) X-Received: by 10.55.149.1 with SMTP id x1mr8828835qkd.270.1470339125994; Thu, 04 Aug 2016 12:32:05 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id b67si6618696qke.42.2016.08.04.12.32.05; Thu, 04 Aug 2016 12:32:05 -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 1084960800; Thu, 4 Aug 2016 19:32:05 +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 9E19460806; Thu, 4 Aug 2016 19:30:44 +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 5B1F36080E; Thu, 4 Aug 2016 19:30:41 +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 6DF42607FE for ; Thu, 4 Aug 2016 19:30:15 +0000 (UTC) Received: by mail-oi0-f41.google.com with SMTP id 4so125410577oih.2 for ; Thu, 04 Aug 2016 12:30:15 -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=R9gA6CtqJHeSr7qchcExModg9Tw2V1jrAY+JBY27fiWjs/B3LmeWXBY96uiwZpAT5n DRjkTwPqCplPuw3W03OrHhGir6lUuo0WmXDusGqCcl+v8pJoUjbScCrX+gPFC/YMHl9W u8aoDXq8aqDezE/SE7cqkcjUv8nQ69M5T1oQxLh63wTe4R9ocz10vK86K3ZyFCGx1v27 CIhmjd8SXRX+zBxm3YNHvnb6AAJyHkPz6XpXg+5mv2rO/P1kYGnY0JJepScWWLmSnBVQ auci2HzoAv51scUtS0LhA/VYTzSZhq6gMMqnUis4RZo2V9XNjE8pKOeAMZrIi3BQTx8K vh3A== X-Gm-Message-State: AEkoousuXhCcBELLF60XdBDCYoLTr28XUFBeHyryhmDQ9bSFa9o3VvnCYWiEnfA/KuycG+apSjg= X-Received: by 10.202.216.4 with SMTP id p4mr2514767oig.140.1470339014854; Thu, 04 Aug 2016 12:30:14 -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 o185sm6883540oif.26.2016.08.04.12.30.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Aug 2016 12:30:13 -0700 (PDT) From: Brian Brooks To: lng-odp@lists.linaro.org Date: Thu, 4 Aug 2016 14:30:04 -0500 Message-Id: <20160804193006.99010-4-brian.brooks@linaro.org> X-Mailer: git-send-email 2.9.2 In-Reply-To: <20160804193006.99010-1-brian.brooks@linaro.org> References: <20160804193006.99010-1-brian.brooks@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v2 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) {