From patchwork Tue Jul 26 02:56:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Brooks X-Patchwork-Id: 72757 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1455598qga; Mon, 25 Jul 2016 20:00:28 -0700 (PDT) X-Received: by 10.55.214.77 with SMTP id t74mr26973605qki.80.1469502028755; Mon, 25 Jul 2016 20:00:28 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id y34si19734655qta.16.2016.07.25.20.00.28; Mon, 25 Jul 2016 20:00:28 -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 6C307686BE; Tue, 26 Jul 2016 03:00:28 +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 B63456174A; Tue, 26 Jul 2016 02:57:38 +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 232CF686D3; Tue, 26 Jul 2016 02:57:35 +0000 (UTC) Received: from mail-io0-f180.google.com (mail-io0-f180.google.com [209.85.223.180]) by lists.linaro.org (Postfix) with ESMTPS id 92AD9686CD for ; Tue, 26 Jul 2016 02:56:37 +0000 (UTC) Received: by mail-io0-f180.google.com with SMTP id 38so190529626iol.0 for ; Mon, 25 Jul 2016 19:56:37 -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=lwmM9/4TSUG/C+NpW3ymOn7T+R1jkZrATGgGVChjc9o=; b=nDY0KWgkVGOHfIfNzkOG8ueeM2eCT7tdc2QI7mkYHWQ7Lm2V8IAjMJhxfCRhHsbyYI n4HZeS3FZimbhufR/m5RV+Rj9OrJVJjgqJUcUkEsnfF5dZWwrrxMLCdKqRab7pWUlzex Dx0EAAblci6ZU5e0CeeBp/4uUzuHM/YLZYzgsElmf09u84yZs7gX5b+GXODolA2454lm r4dL8f1SAVN0zENV1U0hgDJ271LyS5rihRHSCzFGj2vjlQQMdBA96CLQ0iKrB2zaJx1j bcvx60ZYHkq3OpZuMu0kf9nYsXzmU3oDSLTQTxEQE5igKWPPRFO2A0P80qDCY3uHT/Qb 9KaA== X-Gm-Message-State: AEkooutE1z5mBE8Jx07mNDDipcV9wtdBOSLBimfgO0cT/9DxRI4wyehK0/rTD0zAH6d7oXQAHlE= X-Received: by 10.157.51.49 with SMTP id f46mr11834623otc.40.1469501797067; Mon, 25 Jul 2016 19:56:37 -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.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jul 2016 19:56:36 -0700 (PDT) From: Brian Brooks To: lng-odp@lists.linaro.org Date: Mon, 25 Jul 2016 21:56:18 -0500 Message-Id: <20160726025625.7343-6-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 05/12] 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.0 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) {