From patchwork Thu Dec 21 13:00:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 122562 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp857380qgn; Thu, 21 Dec 2017 05:04:31 -0800 (PST) X-Google-Smtp-Source: ACJfBosVsVgPQc9OrlG/6TieD2fyLdnpczYsi2MkGMNDKKJQc6B1pKnt2rQVPLGexjKaWmM7ce1m X-Received: by 10.200.52.137 with SMTP id w9mr14923469qtb.290.1513861471475; Thu, 21 Dec 2017 05:04:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513861471; cv=none; d=google.com; s=arc-20160816; b=eoHWvuj7Wz48XV6DLAtd9Y7bg+Cs4YbpyHKmxhIxQ1EP+W9P/qw5d1JBWaTvWazje7 6cjSkwaf29mJ2AIrJ9XgifAshFCQwedu7Za0rQGZK+gwjWWu87AyJk0TflOHxJ/Wc72C iSIn5qnYfndchnguVbi0ZnlHmH7KPKzCxhiSJ2LMqZM5TRr1kSifC6rcoofGTWwMLps9 7P3g/khFPJLLRES0PwRiCqS3loDwfw52gF3JiEiAuzWNmy3ffz8qmWBIhL+Vz94X/g4q hEGg82jDgyGy0Sx5S+tVQOY7BngaGICUVHqkvkHMnQjFA5WPIPV9zUFgFFpGJoczr9Fh Yesg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=qobpFHpNhNu62M52ESvJ0hAEztHQTVjokRwejDDZMPQ=; b=f3OBIHSTS5GCYNmJkk1zAzDsSNvEVGGiZnnM082YE0w2o68SFxTww3SweBT5pgqjNS JjXMltcNU5CR2KYf4ng76x3A5978kAqiEJWYKXdE4ifBHOaJNct2hvvsa/3Y632hb+aA Zt7Aqi53WsZn/FPe3wWftU6G3bekxwWfBVWKWuVBlpyk00nGhvx8DemR0lTQG/m+oO39 nI9xMS7NDRaKM2+2NNjWlW9oE22QtECxBsBtTLLkGJoIpiQFx3HN01dOZpvEkgQdldej dP9NkHGp/dqVLFqbylkVoWbBu6Bxdc9AP6UzlVX9LoZu05gKmmmROWxjQtuupEL4qkTJ JJxw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id m129si996347qkd.30.2017.12.21.05.04.30; Thu, 21 Dec 2017 05:04:31 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id DE86F616E2; Thu, 21 Dec 2017 13:04:30 +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=-1.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, TVD_SUBJ_WIPE_DEBT, 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 94AC560C31; Thu, 21 Dec 2017 13:01:39 +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 48AF260974; Thu, 21 Dec 2017 13:01:13 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id CA4056095F for ; Thu, 21 Dec 2017 13:00:37 +0000 (UTC) Received: from mxback12g.mail.yandex.net (mxback12g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:91]) by forward103j.mail.yandex.net (Yandex) with ESMTP id E4DF234C2517 for ; Thu, 21 Dec 2017 16:00:35 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback12g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 7TkDVs9k9j-0BXOj1ng; Thu, 21 Dec 2017 16:00:11 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id A7lll3EN3S-0BmqHJKk; Thu, 21 Dec 2017 16:00:11 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 21 Dec 2017 16:00:07 +0300 Message-Id: <1513861209-18790-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513861209-18790-1-git-send-email-odpbot@yandex.ru> References: <1513861209-18790-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 358 Subject: [lng-odp] [PATCH v1 1/3] linux-gen: arch: remove unused powerpc files 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" From: Petri Savolainen These C files were not built. Signed-off-by: Petri Savolainen --- /** Email created from pull request 358 (psavol:master-arch-dir-cleanup) ** https://github.com/Linaro/odp/pull/358 ** Patch: https://github.com/Linaro/odp/pull/358.patch ** Base sha: 6b5cdc77eb9759a2349b10372a964648559bc92c ** Merge commit sha: 93353441d4d0b5d0d679401db0daaef8f7f26ee1 **/ platform/linux-generic/arch/powerpc/odp_cpu_arch.c | 41 ---------------------- .../linux-generic/arch/powerpc/odp_global_time.c | 15 -------- 2 files changed, 56 deletions(-) delete mode 100644 platform/linux-generic/arch/powerpc/odp_cpu_arch.c delete mode 100644 platform/linux-generic/arch/powerpc/odp_global_time.c diff --git a/platform/linux-generic/arch/powerpc/odp_cpu_arch.c b/platform/linux-generic/arch/powerpc/odp_cpu_arch.c deleted file mode 100644 index 6a16f13a2..000000000 --- a/platform/linux-generic/arch/powerpc/odp_cpu_arch.c +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include - -#include -#include - -#include -#include -#include -#include -#include - -#define GIGA 1000000000 - -uint64_t odp_cpu_cycles(void) -{ - struct timespec time; - uint64_t sec, ns, hz, cycles; - int ret; - - ret = clock_gettime(CLOCK_MONOTONIC_RAW, &time); - - if (ret != 0) - ODP_ABORT("clock_gettime failed\n"); - - hz = odp_cpu_hz_max(); - sec = (uint64_t)time.tv_sec; - ns = (uint64_t)time.tv_nsec; - - cycles = sec * hz; - cycles += (ns * hz) / GIGA; - - return cycles; -} diff --git a/platform/linux-generic/arch/powerpc/odp_global_time.c b/platform/linux-generic/arch/powerpc/odp_global_time.c deleted file mode 100644 index d54ba6bc8..000000000 --- a/platform/linux-generic/arch/powerpc/odp_global_time.c +++ /dev/null @@ -1,15 +0,0 @@ - -int cpu_has_global_time(void) -{ - return 0; -} - -uint64_t cpu_global_time(void) -{ - return 0; -} - -uint64_t cpu_global_time_freq(void) -{ - return 0; -} From patchwork Thu Dec 21 13:00:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 122559 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp852681qgn; Thu, 21 Dec 2017 05:01:43 -0800 (PST) X-Google-Smtp-Source: ACJfBovm/rdRL7ph37bo98scYtIZB0VGsVi1H+CMpCEycBDqYEm/A2aVK8Ql4YDSNY9IVT5h8dKU X-Received: by 10.237.47.228 with SMTP id m91mr15045672qtd.205.1513861303782; Thu, 21 Dec 2017 05:01:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513861303; cv=none; d=google.com; s=arc-20160816; b=WfYC9D7rrod2aSsPjInkaGsHtY3HPARg7RMt3bjqWinPKKMapOBlPEljCbSk8RauwN lhJq5IGU4cZh6mZcq7iii+0mJ89HtYp4ZTxefzX/Xnsj3uHu7+qwbjR9ch/0WEI8/qMG en4/nMgVEwB71dXrV/Qt6PQevsWzdEiXvIXTTFz+mC6+W1ucdt1HfYUIu5nxMEAwcQMz mkzokfLx22bFIncW5r58+U8N1hB9pbBIQfK5/zk1nZzR6tEJIjY+cLNCoiRYMJ7egzac jRoNAJOUx8hS1yTC0i4lEQbQWYu+RrufSEIEDl9q+ynh8y0eienA9yoi+C/Gx0K9DaQm ep3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=FPgWuLnfp6EvC9Qb/NYHsjt0YeaHQvcZ8BDmm+fzVL4=; b=ZSR6xSDt8R2A/y8VdLL6wRSWzk6EWkWvt+n5wwRcwXE28HXWr0PDWmyhbte/KgrL/Q REmfYFcRMyCe4oew/qG+j1uT4YS5wzpU8LIWQfoamBPwJ1zpZbaFJdO0BSPN3udfSbs7 KZpV8N/Ay5NFMpAtbmPgqIG+Y+2Bagd0/VetZd+hBkKhYR40OWDF/Rw/h7uvs6H9Zhc6 sjACFFiCVq3F/NrVLujN1Fm18VcOO8SKF/zvQCl5Jsg1DL0C8Yl513h11+9sVJYMG6hw /auT8bi4LwXl82wZBAMsadY5CdTX1MajaPYLT8MtPm808wfS5CE5dNpa0PwqlgfqIXl0 u4oQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id x3si2662592qkl.94.2017.12.21.05.01.43; Thu, 21 Dec 2017 05:01:43 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 79E8C60B4F; Thu, 21 Dec 2017 13:01:43 +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,FREEMAIL_FROM, 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 85D296096B; Thu, 21 Dec 2017 13:01:13 +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 C34D860A6E; Thu, 21 Dec 2017 13:01:04 +0000 (UTC) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [77.88.28.101]) by lists.linaro.org (Postfix) with ESMTPS id BBB7860940 for ; Thu, 21 Dec 2017 13:00:37 +0000 (UTC) Received: from mxback8o.mail.yandex.net (mxback8o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::22]) by forward101p.mail.yandex.net (Yandex) with ESMTP id B45716A81B55 for ; Thu, 21 Dec 2017 16:00:36 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback8o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 6S0Xd1ad2u-0aa8cXsH; Thu, 21 Dec 2017 16:00:36 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id A7lll3EN3S-0ZmCSjIU; Thu, 21 Dec 2017 16:00:36 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 21 Dec 2017 16:00:08 +0300 Message-Id: <1513861209-18790-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513861209-18790-1-git-send-email-odpbot@yandex.ru> References: <1513861209-18790-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 358 Subject: [lng-odp] [PATCH v1 2/3] linux-gen: arch: cpu arch specific time header 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" From: Petri Savolainen Rename odp_time_internal.h to odp_arch_time_internal.h, and move it under arch directory. This header specifies internal CPU arch specific time counter functions. All architectures must implement these functions. Signed-off-by: Petri Savolainen --- /** Email created from pull request 358 (psavol:master-arch-dir-cleanup) ** https://github.com/Linaro/odp/pull/358 ** Patch: https://github.com/Linaro/odp/pull/358.patch ** Base sha: 6b5cdc77eb9759a2349b10372a964648559bc92c ** Merge commit sha: 93353441d4d0b5d0d679401db0daaef8f7f26ee1 **/ platform/linux-generic/Makefile.am | 3 ++- platform/linux-generic/arch/aarch64/odp_global_time.c | 2 +- platform/linux-generic/arch/default/odp_global_time.c | 13 +------------ platform/linux-generic/arch/mips64/odp_cpu_arch.c | 1 - .../odp_time_internal.h => arch/odp_arch_time_internal.h} | 4 ++-- platform/linux-generic/arch/x86/cpu_flags.c | 2 +- platform/linux-generic/arch/x86/odp_global_time.c | 2 +- platform/linux-generic/odp_time.c | 2 +- 8 files changed, 9 insertions(+), 20 deletions(-) rename platform/linux-generic/{include/odp_time_internal.h => arch/odp_arch_time_internal.h} (82%) diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index bbe6a21c2..d1b916292 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -5,6 +5,7 @@ include $(top_srcdir)/platform/Makefile.inc AM_CPPFLAGS = -I$(srcdir)/include AM_CPPFLAGS += -I$(top_srcdir)/include +AM_CPPFLAGS += -I$(top_srcdir)/platform/$(with_platform)/arch AM_CPPFLAGS += -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@ AM_CPPFLAGS += -I$(top_builddir)/include AM_CPPFLAGS += -Iinclude @@ -115,6 +116,7 @@ nodist_odpapiplatinclude_HEADERS = \ include/odp/api/plat/static_inline.h noinst_HEADERS = \ + arch/odp_arch_time_internal.h \ include/_fdserver_internal.h \ include/_ishm_internal.h \ include/_ishmphy_internal.h \ @@ -150,7 +152,6 @@ noinst_HEADERS = \ include/odp_schedule_if.h \ include/odp_sorted_list_internal.h \ include/odp_shm_internal.h \ - include/odp_time_internal.h \ include/odp_timer_internal.h \ include/odp_timer_wheel_internal.h \ include/odp_traffic_mngr_internal.h \ diff --git a/platform/linux-generic/arch/aarch64/odp_global_time.c b/platform/linux-generic/arch/aarch64/odp_global_time.c index 97444f7e9..a1b48ea00 100644 --- a/platform/linux-generic/arch/aarch64/odp_global_time.c +++ b/platform/linux-generic/arch/aarch64/odp_global_time.c @@ -11,7 +11,7 @@ #include #include -#include +#include int cpu_has_global_time(void) { diff --git a/platform/linux-generic/arch/default/odp_global_time.c b/platform/linux-generic/arch/default/odp_global_time.c index 89cce1cfb..ae8a6bbda 100644 --- a/platform/linux-generic/arch/default/odp_global_time.c +++ b/platform/linux-generic/arch/default/odp_global_time.c @@ -4,18 +4,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include "config.h" - -#include - -#include -#include - -#include -#include -#include -#include -#include +#include int cpu_has_global_time(void) { diff --git a/platform/linux-generic/arch/mips64/odp_cpu_arch.c b/platform/linux-generic/arch/mips64/odp_cpu_arch.c index 620a01044..50ffc2e77 100644 --- a/platform/linux-generic/arch/mips64/odp_cpu_arch.c +++ b/platform/linux-generic/arch/mips64/odp_cpu_arch.c @@ -9,7 +9,6 @@ #include #include #include -#include uint64_t odp_cpu_cycles(void) { diff --git a/platform/linux-generic/include/odp_time_internal.h b/platform/linux-generic/arch/odp_arch_time_internal.h similarity index 82% rename from platform/linux-generic/include/odp_time_internal.h rename to platform/linux-generic/arch/odp_arch_time_internal.h index 99ac79772..ce27101d6 100644 --- a/platform/linux-generic/include/odp_time_internal.h +++ b/platform/linux-generic/arch/odp_arch_time_internal.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef ODP_TIME_INTERNAL_H_ -#define ODP_TIME_INTERNAL_H_ +#ifndef ODP_ARCH_TIME_INTERNAL_H_ +#define ODP_ARCH_TIME_INTERNAL_H_ #ifdef __cplusplus extern "C" { diff --git a/platform/linux-generic/arch/x86/cpu_flags.c b/platform/linux-generic/arch/x86/cpu_flags.c index e46c4ffb6..fd8806462 100644 --- a/platform/linux-generic/arch/x86/cpu_flags.c +++ b/platform/linux-generic/arch/x86/cpu_flags.c @@ -41,7 +41,7 @@ #include #include -#include +#include #include #include diff --git a/platform/linux-generic/arch/x86/odp_global_time.c b/platform/linux-generic/arch/x86/odp_global_time.c index 3ed243cc6..c372f0890 100644 --- a/platform/linux-generic/arch/x86/odp_global_time.c +++ b/platform/linux-generic/arch/x86/odp_global_time.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include uint64_t cpu_global_time(void) { diff --git a/platform/linux-generic/odp_time.c b/platform/linux-generic/odp_time.c index 0df4682c3..1ec57c7cd 100644 --- a/platform/linux-generic/odp_time.c +++ b/platform/linux-generic/odp_time.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include From patchwork Thu Dec 21 13:00:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 122560 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp856051qgn; Thu, 21 Dec 2017 05:03:40 -0800 (PST) X-Google-Smtp-Source: ACJfBosYYGJddzzd/3KQ2eA6hxsyG7EGmPr/nbISPZXWJCDpBXYFScISqHZHdNHLzE4W4pVxPdqo X-Received: by 10.55.151.71 with SMTP id z68mr14237553qkd.83.1513861420285; Thu, 21 Dec 2017 05:03:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513861420; cv=none; d=google.com; s=arc-20160816; b=rPwACO2NDSexR3dLLelyWdPaRWz5/okp1TdQX2EfRJmMZiOLcaa0ZF8h3nF/zDhE59 pDammM+iTcY2dkL1tn/ukAWzSxrly0L2aS9rMgyQeCE4OCdL9M+4fZ6kEKpNU8acz1Qp orEEOPJNNzYzI/QzpVCx6TxlF1tMmseBTGdqlIv85tBHNGUrT/lOHMTGx6fyaH2yilmz Ka4vFV19XZO9Oc/awzI37e5+A5lb9cNhlt70GMtBjssvxgL1SZzvqXrRlH7jrTn8owHw xG/jRR4Zi1q1RlGn1XYUCdkvW/5Y/QFUVNLJshRX3uJIvHMgGCZeVu5RbvhW7olXK1xe bQDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=9Q+6yk8d76fZfLgOj+I69Y1QBOGHCuXE6w5PR1EIryY=; b=xamXU95bl+sG5b8PilI9WSGbF2TsG9IHA0FdfyRpAZnfNMagSTzJW1uJtulVZNNuih sMYmvQFc0S32O/1Yzfwwwbww7TTsHZB+F82jRZanRmHfSvhek2D9EzE2TVZihAn6L7WW 3gBc3N/O/tbq+Y1DBeUVKq/sQSugdnhGre4/kozAvjmn6lPllmpHniP+hTrH3PPhPE8c Ik+4bVAP/4N5PJfjvBe+yQAvLaNckCCAiCnUqe0GsNNUWlw15M6bnnzATXRIBhjky0cR JdwuFVrxHa6QmUcQUO0xHeoRO1i+B7BSmhrXQwavoCY8eKTy/naXqH86W123borgQiAi Kl6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id e23si1208962qkj.235.2017.12.21.05.03.39; Thu, 21 Dec 2017 05:03:40 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id DD9B06099A; Thu, 21 Dec 2017 13:03:39 +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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, 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 50291609A2; Thu, 21 Dec 2017 13:01:29 +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 171426096B; Thu, 21 Dec 2017 13:01:12 +0000 (UTC) Received: from forward102j.mail.yandex.net (forward102j.mail.yandex.net [5.45.198.243]) by lists.linaro.org (Postfix) with ESMTPS id 1B1BF60953 for ; Thu, 21 Dec 2017 13:00:39 +0000 (UTC) Received: from mxback13g.mail.yandex.net (mxback13g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:92]) by forward102j.mail.yandex.net (Yandex) with ESMTP id 6A5AE5604456 for ; Thu, 21 Dec 2017 16:00:37 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback13g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id OJEykZczuR-0bVasPkZ; Thu, 21 Dec 2017 16:00:37 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id A7lll3EN3S-0amS84Pe; Thu, 21 Dec 2017 16:00:36 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 21 Dec 2017 16:00:09 +0300 Message-Id: <1513861209-18790-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513861209-18790-1-git-send-email-odpbot@yandex.ru> References: <1513861209-18790-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 358 Subject: [lng-odp] [PATCH v1 3/3] linux-gen: arch: single cpu cycles file 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" From: Petri Savolainen CPU cycle functions were mixed over odp_cpu_cycles.c and odp_cpu_arch.c files. Implement all three cpu cycle API functions in odp_cpu_cycles.c. odp_cpu_arch.c is deleted. Signed-off-by: Petri Savolainen --- /** Email created from pull request 358 (psavol:master-arch-dir-cleanup) ** https://github.com/Linaro/odp/pull/358 ** Patch: https://github.com/Linaro/odp/pull/358.patch ** Base sha: 6b5cdc77eb9759a2349b10372a964648559bc92c ** Merge commit sha: 93353441d4d0b5d0d679401db0daaef8f7f26ee1 **/ platform/linux-generic/Makefile.am | 15 +++------ platform/linux-generic/arch/default/odp_cpu_arch.c | 38 ---------------------- .../linux-generic/arch/default/odp_cpu_cycles.c | 29 +++++++++++++++++ .../mips64/{odp_cpu_arch.c => odp_cpu_cycles.c} | 10 ++++++ .../arch/x86/{odp_cpu_arch.c => odp_cpu_cycles.c} | 17 ++++++---- 5 files changed, 54 insertions(+), 55 deletions(-) delete mode 100644 platform/linux-generic/arch/default/odp_cpu_arch.c rename platform/linux-generic/arch/mips64/{odp_cpu_arch.c => odp_cpu_cycles.c} (79%) rename platform/linux-generic/arch/x86/{odp_cpu_arch.c => odp_cpu_cycles.c} (77%) diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index d1b916292..8152ea180 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -224,37 +224,32 @@ __LIB__libodp_linux_la_SOURCES = \ odp_weak.c if ARCH_IS_ARM -__LIB__libodp_linux_la_SOURCES += arch/default/odp_cpu_arch.c \ - arch/default/odp_cpu_cycles.c \ +__LIB__libodp_linux_la_SOURCES += arch/default/odp_cpu_cycles.c \ arch/default/odp_global_time.c \ arch/default/odp_sysinfo_parse.c arch_odp_headers = arch/arm/odp/api/cpu_arch.h endif if ARCH_IS_AARCH64 -__LIB__libodp_linux_la_SOURCES += arch/default/odp_cpu_arch.c \ - arch/default/odp_cpu_cycles.c \ +__LIB__libodp_linux_la_SOURCES += arch/default/odp_cpu_cycles.c \ arch/aarch64/odp_global_time.c \ arch/default/odp_sysinfo_parse.c arch_odp_headers = arch/aarch64/odp/api/cpu_arch.h endif if ARCH_IS_MIPS64 -__LIB__libodp_linux_la_SOURCES += arch/mips64/odp_cpu_arch.c \ - arch/default/odp_cpu_cycles.c \ +__LIB__libodp_linux_la_SOURCES += arch/mips64/odp_cpu_cycles.c \ arch/default/odp_global_time.c \ arch/mips64/odp_sysinfo_parse.c arch_odp_headers = arch/mips64/odp/api/cpu_arch.h endif if ARCH_IS_POWERPC -__LIB__libodp_linux_la_SOURCES += arch/default/odp_cpu_arch.c \ - arch/default/odp_cpu_cycles.c \ +__LIB__libodp_linux_la_SOURCES += arch/default/odp_cpu_cycles.c \ arch/default/odp_global_time.c \ arch/powerpc/odp_sysinfo_parse.c arch_odp_headers = arch/powerpc/odp/api/cpu_arch.h endif if ARCH_IS_X86 __LIB__libodp_linux_la_SOURCES += arch/x86/cpu_flags.c \ - arch/x86/odp_cpu_arch.c \ - arch/default/odp_cpu_cycles.c \ + arch/x86/odp_cpu_cycles.c \ arch/x86/odp_global_time.c \ arch/x86/odp_sysinfo_parse.c arch_odp_headers = arch/x86/odp/api/cpu_arch.h diff --git a/platform/linux-generic/arch/default/odp_cpu_arch.c b/platform/linux-generic/arch/default/odp_cpu_arch.c deleted file mode 100644 index 8a8da7445..000000000 --- a/platform/linux-generic/arch/default/odp_cpu_arch.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include - -#include -#include - -#include -#include - -#define GIGA 1000000000 - -uint64_t odp_cpu_cycles(void) -{ - struct timespec time; - uint64_t sec, ns, hz, cycles; - int ret; - - ret = clock_gettime(CLOCK_MONOTONIC_RAW, &time); - - if (ret != 0) - ODP_ABORT("clock_gettime failed\n"); - - hz = odp_cpu_hz_max(); - sec = (uint64_t)time.tv_sec; - ns = (uint64_t)time.tv_nsec; - - cycles = sec * hz; - cycles += (ns * hz) / GIGA; - - return cycles; -} diff --git a/platform/linux-generic/arch/default/odp_cpu_cycles.c b/platform/linux-generic/arch/default/odp_cpu_cycles.c index ccc588825..548aa8172 100644 --- a/platform/linux-generic/arch/default/odp_cpu_cycles.c +++ b/platform/linux-generic/arch/default/odp_cpu_cycles.c @@ -6,7 +6,36 @@ #include "config.h" +#include + +#include +#include + #include +#include + +#define GIGA 1000000000 + +uint64_t odp_cpu_cycles(void) +{ + struct timespec time; + uint64_t sec, ns, hz, cycles; + int ret; + + ret = clock_gettime(CLOCK_MONOTONIC_RAW, &time); + + if (ret != 0) + ODP_ABORT("clock_gettime failed\n"); + + hz = odp_cpu_hz_max(); + sec = (uint64_t)time.tv_sec; + ns = (uint64_t)time.tv_nsec; + + cycles = sec * hz; + cycles += (ns * hz) / GIGA; + + return cycles; +} uint64_t odp_cpu_cycles_max(void) { diff --git a/platform/linux-generic/arch/mips64/odp_cpu_arch.c b/platform/linux-generic/arch/mips64/odp_cpu_cycles.c similarity index 79% rename from platform/linux-generic/arch/mips64/odp_cpu_arch.c rename to platform/linux-generic/arch/mips64/odp_cpu_cycles.c index 50ffc2e77..85a95f097 100644 --- a/platform/linux-generic/arch/mips64/odp_cpu_arch.c +++ b/platform/linux-generic/arch/mips64/odp_cpu_cycles.c @@ -21,3 +21,13 @@ 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/x86/odp_cpu_arch.c b/platform/linux-generic/arch/x86/odp_cpu_cycles.c similarity index 77% rename from platform/linux-generic/arch/x86/odp_cpu_arch.c rename to platform/linux-generic/arch/x86/odp_cpu_cycles.c index a20d91734..a474ac250 100644 --- a/platform/linux-generic/arch/x86/odp_cpu_arch.c +++ b/platform/linux-generic/arch/x86/odp_cpu_cycles.c @@ -4,14 +4,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include "config.h" - -#include - #include -#include - -#include uint64_t odp_cpu_cycles(void) { @@ -29,3 +22,13 @@ 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; +}