From patchwork Mon Sep 18 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: 112918 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3637569qgf; Mon, 18 Sep 2017 06:02:37 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBcxRQr2ZUObywv5SMCJNu3/Jvil4nqWFim/E+KkKZMDqFx1I38gTKJJMEnqUs30naUAntz X-Received: by 10.55.113.70 with SMTP id m67mr10051914qkc.187.1505739756859; Mon, 18 Sep 2017 06:02:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505739756; cv=none; d=google.com; s=arc-20160816; b=d3I6yYmNbZF3VRiCKuEFDJpLJW6E751B/rPp7hdeYpUkGwwYvEXuL+y813yKUpfjkC Q0fMe81dQptI2RrYQQUYxGrdky5aF5dVcNwY0wgFqPI9WGxVY7Mp9aO19fndkvgmK9oi xF4dgRonLp9OsQENigyqm972tB2b7hBPPodFu2SQNX09wMO/zNJ2GjTSjSWbGrwnYAbP d/YTh0kVT/RY+xpMuuyY7pfv9OK4uQKKdGTZRu3Omf7lqfuFp43vqtCDKWscqMbbTpDT jR+wfLOCjrW9Y4s+COTzKCwRDw68ovEa7A46u0UCEZysU5Frav4ua/mA0Ky9BiDaZSqe CauQ== 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=l8jdoA4Wh/bkC/+7VCtkAE021UJOCsp8frTlwC4p+g0=; b=dyOMeGdU3l9EjstNHhhsGYigle5qcWm7Uv7MHsXrJEbl6MIjMsJPaEQttQjgNIYoBR iwEElisD9gWUJSiEHp7I9XfD9mvx/RUPJwJZ/zNfPeDgE/Y5ULoMexrYgaJvAKQA0Cw3 68Ub42dNi1c/QngLvU/xgw27q8GzBaVSsh86u5B2vOpk7WCsAskYoeihwoFHMJadgvMB OVtIZhlTmlwLJzObrNST1bHjpeOhuM46+nEWlNO0ESQV70szb41vW15eFCcWCXpAO/Ez KG6e6o/loTnk3BeuGbx8U61466/8pBlUiizUnxHJFnzkFPxVaqjp1rn0zRB91RN8Zr8r OWJQ== ARC-Authentication-Results: i=1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id o132si6387152qka.426.2017.09.18.06.02.36; Mon, 18 Sep 2017 06:02:36 -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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 6951360D45; Mon, 18 Sep 2017 13:02:36 +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,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 744F460D58; Mon, 18 Sep 2017 13:00:46 +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 6F0A260D3E; Mon, 18 Sep 2017 13:00:34 +0000 (UTC) Received: from forward106p.mail.yandex.net (forward106p.mail.yandex.net [77.88.28.109]) by lists.linaro.org (Postfix) with ESMTPS id AD2AA60D43 for ; Mon, 18 Sep 2017 13:00:24 +0000 (UTC) Received: from mxback8j.mail.yandex.net (mxback8j.mail.yandex.net [IPv6:2a02:6b8:0:1619::111]) by forward106p.mail.yandex.net (Yandex) with ESMTP id 5D1332D831D0 for ; Mon, 18 Sep 2017 16:00:23 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback8j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 0KvZ6mYE5N-0N60UvKH; Mon, 18 Sep 2017 16:00:23 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id WiH8IrUPsa-0MLWVjQt; Mon, 18 Sep 2017 16:00:22 +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: Mon, 18 Sep 2017 16:00:08 +0300 Message-Id: <1505739611-19678-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505739611-19678-1-git-send-email-odpbot@yandex.ru> References: <1505739611-19678-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 163 Subject: [lng-odp] [PATCH v5 1/4] linux-gen: split arm into arm and aarch64 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: Dmitry Eremin-Solenikov In preparation to arch-file cleanup split ARM architecture into 32-bit ARM and AArch64. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 163 (lumag:improve-build-4) ** https://github.com/Linaro/odp/pull/163 ** Patch: https://github.com/Linaro/odp/pull/163.patch ** Base sha: e1c46f8e296a730ed27141a33189185bb7dfd1b1 ** Merge commit sha: a232c0012683b33d1a12d67ce30127ac78ba57e0 **/ configure.ac | 3 +- platform/Makefile.inc | 3 + platform/linux-generic/Makefile.am | 7 ++ .../linux-generic/arch/aarch64/odp/api/cpu_arch.h | 30 +++++++ platform/linux-generic/arch/aarch64/odp_cpu_arch.c | 94 ++++++++++++++++++++++ .../linux-generic/arch/aarch64/odp_sysinfo_parse.c | 28 +++++++ platform/linux-generic/arch/arm/odp_cpu_arch.c | 23 ------ 7 files changed, 164 insertions(+), 24 deletions(-) create mode 100644 platform/linux-generic/arch/aarch64/odp/api/cpu_arch.h create mode 100644 platform/linux-generic/arch/aarch64/odp_cpu_arch.c create mode 100644 platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c diff --git a/configure.ac b/configure.ac index 4af2c7c72..99bee092f 100644 --- a/configure.ac +++ b/configure.ac @@ -109,7 +109,7 @@ AS_CASE([$host], [i686*], [ARCH_DIR=x86], [mips64*], [ARCH_DIR=mips64], [powerpc*], [ARCH_DIR=powerpc], - [aarch64*], [ARCH_DIR=arm], + [aarch64*], [ARCH_DIR=aarch64], [arm*], [ARCH_DIR=arm], [ARCH_DIR=undefined] ) @@ -220,6 +220,7 @@ AM_CONDITIONAL([user_guide], [test "x${user_guides}" = "xyes" ]) AM_CONDITIONAL([HAVE_MSCGEN], [test "x${MSCGEN}" = "xmscgen"]) AM_CONDITIONAL([helper_linux], [test x$helper_linux = xyes ]) AM_CONDITIONAL([ARCH_IS_ARM], [test "x${ARCH_DIR}" = "xarm"]) +AM_CONDITIONAL([ARCH_IS_AARCH64], [test "x${ARCH_DIR}" = "xaarch64"]) AM_CONDITIONAL([ARCH_IS_MIPS64], [test "x${ARCH_DIR}" = "xmips64"]) AM_CONDITIONAL([ARCH_IS_POWERPC], [test "x${ARCH_DIR}" = "xpowerpc"]) AM_CONDITIONAL([ARCH_IS_X86], [test "x${ARCH_DIR}" = "xx86"]) diff --git a/platform/Makefile.inc b/platform/Makefile.inc index f67225603..bb5da187b 100644 --- a/platform/Makefile.inc +++ b/platform/Makefile.inc @@ -86,6 +86,9 @@ EXTRA_DIST = \ arch/arm/odp/api/cpu_arch.h \ arch/arm/odp_cpu_arch.c \ arch/arm/odp_sysinfo_parse.c \ + arch/aarch64/odp/api/cpu_arch.h \ + arch/aarch64/odp_cpu_arch.c \ + arch/aarch64/odp_sysinfo_parse.c \ arch/default/odp/api/cpu_arch.h \ arch/default/odp_cpu_arch.c \ arch/default/odp_sysinfo_parse.c \ diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index f5f65384f..7257a60f5 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -71,6 +71,9 @@ odpapiinclude_HEADERS = \ if ARCH_IS_ARM odpapiinclude_HEADERS += $(srcdir)/arch/arm/odp/api/cpu_arch.h endif +if ARCH_IS_AARCH64 +odpapiinclude_HEADERS += $(srcdir)/arch/aarch64/odp/api/cpu_arch.h +endif if ARCH_IS_MIPS64 odpapiinclude_HEADERS += $(srcdir)/arch/mips64/odp/api/cpu_arch.h endif @@ -238,6 +241,10 @@ if ARCH_IS_ARM __LIB__libodp_linux_la_SOURCES += arch/arm/odp_cpu_arch.c \ arch/arm/odp_sysinfo_parse.c endif +if ARCH_IS_AARCH64 +__LIB__libodp_linux_la_SOURCES += arch/aarch64/odp_cpu_arch.c \ + arch/aarch64/odp_sysinfo_parse.c +endif if ARCH_IS_MIPS64 __LIB__libodp_linux_la_SOURCES += arch/mips64/odp_cpu_arch.c \ arch/mips64/odp_sysinfo_parse.c diff --git a/platform/linux-generic/arch/aarch64/odp/api/cpu_arch.h b/platform/linux-generic/arch/aarch64/odp/api/cpu_arch.h new file mode 100644 index 000000000..7c75a690e --- /dev/null +++ b/platform/linux-generic/arch/aarch64/odp/api/cpu_arch.h @@ -0,0 +1,30 @@ +/* Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef ODP_PLAT_CPU_ARCH_H_ +#define ODP_PLAT_CPU_ARCH_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#define _ODP_CACHE_LINE_SIZE 64 + +static inline void odp_cpu_pause(void) +{ + /* YIELD hints the CPU to switch to another thread if possible + * and executes as a NOP otherwise. + * ISB flushes the pipeline, then restarts. This is guaranteed to + * stall the CPU a number of cycles. + */ + __asm volatile("isb" ::: "memory"); +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/arch/aarch64/odp_cpu_arch.c b/platform/linux-generic/arch/aarch64/odp_cpu_arch.c new file mode 100644 index 000000000..b87d1c102 --- /dev/null +++ b/platform/linux-generic/arch/aarch64/odp_cpu_arch.c @@ -0,0 +1,94 @@ +/* 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; +} + +uint64_t odp_cpu_cycles_max(void) +{ + return UINT64_MAX; +} + +uint64_t odp_cpu_cycles_resolution(void) +{ + return 1; +} + +int cpu_has_global_time(void) +{ + uint64_t hz = cpu_global_time_freq(); + + /* + * The system counter portion of the architected timer must + * provide a uniform view of system time to all processing + * elements in the system. This should hold true even for + * heterogeneous SoCs. + * + * Determine whether the system has 'global time' by checking + * whether a read of the architected timer frequency sys reg + * returns a sane value. Sane is considered to be within + * 1MHz and 6GHz (1us and .1667ns period). + */ + return hz >= 1000000 && hz <= 6000000000; +} + +uint64_t cpu_global_time(void) +{ + uint64_t cntvct; + + /* + * To be consistent with other architectures, do not issue a + * serializing instruction, e.g. ISB, before reading this + * sys reg. + */ + + /* Memory clobber to minimize optimization around load from sys reg. */ + __asm__ volatile("mrs %0, cntvct_el0" : "=r"(cntvct) : : "memory"); + + return cntvct; +} + +uint64_t cpu_global_time_freq(void) +{ + uint64_t cntfrq; + + __asm__ volatile("mrs %0, cntfrq_el0" : "=r"(cntfrq) : : ); + + return cntfrq; +} diff --git a/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c b/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c new file mode 100644 index 000000000..1e2c729a7 --- /dev/null +++ b/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c @@ -0,0 +1,28 @@ +/* Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "config.h" + +#include +#include +#include + +int cpuinfo_parser(FILE *file ODP_UNUSED, system_info_t *sysinfo) +{ + int i; + + ODP_DBG("Warning: use dummy values for freq and model string\n"); + for (i = 0; i < MAX_CPU_NUMBER; i++) { + sysinfo->cpu_hz_max[i] = 1400000000; + strcpy(sysinfo->model_str[i], "UNKNOWN"); + } + + return 0; +} + +void sys_info_print_arch(void) +{ +} diff --git a/platform/linux-generic/arch/arm/odp_cpu_arch.c b/platform/linux-generic/arch/arm/odp_cpu_arch.c index 6622e619f..fc49ce371 100644 --- a/platform/linux-generic/arch/arm/odp_cpu_arch.c +++ b/platform/linux-generic/arch/arm/odp_cpu_arch.c @@ -70,33 +70,10 @@ int cpu_has_global_time(void) uint64_t cpu_global_time(void) { -#ifdef __aarch64__ - uint64_t cntvct; - - /* - * To be consistent with other architectures, do not issue a - * serializing instruction, e.g. ISB, before reading this - * sys reg. - */ - - /* Memory clobber to minimize optimization around load from sys reg. */ - __asm__ volatile("mrs %0, cntvct_el0" : "=r"(cntvct) : : "memory"); - - return cntvct; -#else return 0; -#endif } uint64_t cpu_global_time_freq(void) { -#ifdef __aarch64__ - uint64_t cntfrq; - - __asm__ volatile("mrs %0, cntfrq_el0" : "=r"(cntfrq) : : ); - - return cntfrq; -#else return 0; -#endif } From patchwork Mon Sep 18 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: 112919 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3639480qgf; Mon, 18 Sep 2017 06:03:53 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAuvlpKjKDptUJgCE02G+RydpzPNLKWpo6qgxbQqW36VINBmjBGbzznKOZafwjFbRyLVM/M X-Received: by 10.55.214.207 with SMTP id p76mr17128100qkl.65.1505739833562; Mon, 18 Sep 2017 06:03:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505739833; cv=none; d=google.com; s=arc-20160816; b=JGt9LYhjIpv53EX9afkSFGxn+GHnbnzWrrhI5jVQb/wrK9K1/LjdAdWIrOaV/M/j1N 0En7Cg6gl8MrJcABawpivgwgSBS+coWXTPZAT6rWOlKBPxpBXFOTyolSYppdeNDgKSKm so83aDdeYGqZQXzfnVY751lDVG27bXhGApMaZtsL/tws8vCtyT5P07mp2ixVVokyozln UnMaGLX2F3ghCxxTbyU9s5saw8QbpVf8GQZFdsb1NXyJLTwI3spCaaQ+Cj49mxXhldz7 baBeTEx+qLlmk3AGd3kDqF5cvvfxsUFiWnhMvsLvpxDOwnAx9U5ksJa3ZJbyXO/xUkAz 1txA== 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=tIOeuuH0vB+yW9IC+dWOIeYbrjAPNxZBatR+UzsjbAg=; b=nTmgK2aZk66um+alSyy3Tckc52kk/hnnJ02yvDoLyA0+p7oLO1L/QUW/YALumAtUFk i1dBH0On6VpSwxbIB0EKxCF9bgJpTz4I7p9uEORuYVjW7LiELieb4orNIxa6eS4eXywP YMJ1iq5EEz/c024XMPBf3iJw6MAjIiy1qLbv0abo0khkBUdESUXVl1ZKLjbvlp11s8Zw 2+BH2f+OjFTnZD259wJJ9VXuTBxxoaxVmLy3ELjCOkNofEyh2E/r3eFQ78xsFW/Tkkr9 85qNCTj5ToHa07x0KENKUxW5rQnee7PDi9W5Z/QiLSqzwftu7vSGW/8gSz6k5/OXJ2+v hr1w== ARC-Authentication-Results: i=1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id d123si6495042qkf.137.2017.09.18.06.03.53; Mon, 18 Sep 2017 06:03:53 -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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 043FA60D5E; Mon, 18 Sep 2017 13:03:53 +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,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 B8A9A60D4E; Mon, 18 Sep 2017 13:00:55 +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 3140E60D4A; Mon, 18 Sep 2017 13:00:36 +0000 (UTC) Received: from forward106o.mail.yandex.net (forward106o.mail.yandex.net [37.140.190.187]) by lists.linaro.org (Postfix) with ESMTPS id 07CAD60D44 for ; Mon, 18 Sep 2017 13:00:26 +0000 (UTC) Received: from mxback3o.mail.yandex.net (mxback3o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1d]) by forward106o.mail.yandex.net (Yandex) with ESMTP id 63E5F782DD5 for ; Mon, 18 Sep 2017 16:00:24 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback3o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id vQMluFiqLH-0OpqNeRe; Mon, 18 Sep 2017 16:00:24 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id WiH8IrUPsa-0NLi7m9K; Mon, 18 Sep 2017 16:00:23 +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: Mon, 18 Sep 2017 16:00:09 +0300 Message-Id: <1505739611-19678-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505739611-19678-1-git-send-email-odpbot@yandex.ru> References: <1505739611-19678-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 163 Subject: [lng-odp] [PATCH v5 2/4] linux-gen: deduplicate arch-specific 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: Dmitry Eremin-Solenikov Rewrite ARCH-specific files so that there is no significant code duplication between different arch files and default files set. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 163 (lumag:improve-build-4) ** https://github.com/Linaro/odp/pull/163 ** Patch: https://github.com/Linaro/odp/pull/163.patch ** Base sha: e1c46f8e296a730ed27141a33189185bb7dfd1b1 ** Merge commit sha: a232c0012683b33d1a12d67ce30127ac78ba57e0 **/ platform/Makefile.inc | 22 ------ platform/linux-generic/Makefile.am | 46 +++++++------ .../aarch64/{odp_cpu_arch.c => odp_global_time.c} | 37 ---------- .../linux-generic/arch/aarch64/odp_sysinfo_parse.c | 28 -------- platform/linux-generic/arch/arm/odp_cpu_arch.c | 79 ---------------------- .../linux-generic/arch/arm/odp_sysinfo_parse.c | 28 -------- platform/linux-generic/arch/default/odp_cpu_arch.c | 28 -------- .../linux-generic/arch/default/odp_cpu_cycles.c | 19 ++++++ .../linux-generic/arch/default/odp_global_time.c | 33 +++++++++ platform/linux-generic/arch/mips64/odp_cpu_arch.c | 25 ------- platform/linux-generic/arch/powerpc/odp_cpu_arch.c | 25 ------- .../linux-generic/arch/powerpc/odp_global_time.c | 15 ++++ platform/linux-generic/arch/x86/odp_cpu_arch.c | 72 -------------------- platform/linux-generic/arch/x86/odp_global_time.c | 77 +++++++++++++++++++++ 14 files changed, 169 insertions(+), 365 deletions(-) rename platform/linux-generic/arch/aarch64/{odp_cpu_arch.c => odp_global_time.c} (68%) delete mode 100644 platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c delete mode 100644 platform/linux-generic/arch/arm/odp_cpu_arch.c delete mode 100644 platform/linux-generic/arch/arm/odp_sysinfo_parse.c create mode 100644 platform/linux-generic/arch/default/odp_cpu_cycles.c create mode 100644 platform/linux-generic/arch/default/odp_global_time.c create mode 100644 platform/linux-generic/arch/powerpc/odp_global_time.c create mode 100644 platform/linux-generic/arch/x86/odp_global_time.c diff --git a/platform/Makefile.inc b/platform/Makefile.inc index bb5da187b..f3161abd4 100644 --- a/platform/Makefile.inc +++ b/platform/Makefile.inc @@ -81,25 +81,3 @@ odpapiabiarchinclude_HEADERS = \ $(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/pool.h \ $(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/queue.h \ $(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/shared_memory.h - -EXTRA_DIST = \ - arch/arm/odp/api/cpu_arch.h \ - arch/arm/odp_cpu_arch.c \ - arch/arm/odp_sysinfo_parse.c \ - arch/aarch64/odp/api/cpu_arch.h \ - arch/aarch64/odp_cpu_arch.c \ - arch/aarch64/odp_sysinfo_parse.c \ - arch/default/odp/api/cpu_arch.h \ - arch/default/odp_cpu_arch.c \ - arch/default/odp_sysinfo_parse.c \ - arch/mips64/odp/api/cpu_arch.h \ - arch/mips64/odp_cpu_arch.c \ - arch/mips64/odp_sysinfo_parse.c \ - arch/powerpc/odp/api/cpu_arch.h \ - arch/powerpc/odp_cpu_arch.c \ - arch/powerpc/odp_sysinfo_parse.c \ - arch/x86/odp/api/cpu_arch.h \ - arch/x86/odp_cpu_arch.c \ - arch/x86/odp_sysinfo_parse.c \ - arch/x86/cpu_flags.c \ - arch/x86/cpu_flags.h diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 7257a60f5..0ebb6f76c 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -68,22 +68,6 @@ odpapiinclude_HEADERS = \ $(srcdir)/include/odp/api/traffic_mngr.h \ $(srcdir)/include/odp/api/version.h -if ARCH_IS_ARM -odpapiinclude_HEADERS += $(srcdir)/arch/arm/odp/api/cpu_arch.h -endif -if ARCH_IS_AARCH64 -odpapiinclude_HEADERS += $(srcdir)/arch/aarch64/odp/api/cpu_arch.h -endif -if ARCH_IS_MIPS64 -odpapiinclude_HEADERS += $(srcdir)/arch/mips64/odp/api/cpu_arch.h -endif -if ARCH_IS_POWERPC -odpapiinclude_HEADERS += $(srcdir)/arch/powerpc/odp/api/cpu_arch.h -endif -if ARCH_IS_X86 -odpapiinclude_HEADERS += $(srcdir)/arch/x86/odp/api/cpu_arch.h -endif - odpapiplatincludedir= $(includedir)/odp/api/plat odpapiplatinclude_HEADERS = \ $(builddir)/include/odp/api/plat/static_inline.h \ @@ -238,27 +222,47 @@ __LIB__libodp_linux_la_SOURCES = \ odp_weak.c if ARCH_IS_ARM -__LIB__libodp_linux_la_SOURCES += arch/arm/odp_cpu_arch.c \ - arch/arm/odp_sysinfo_parse.c +__LIB__libodp_linux_la_SOURCES += arch/default/odp_cpu_arch.c \ + arch/default/odp_cpu_cycles.c \ + arch/default/odp_global_time.c \ + arch/default/odp_sysinfo_parse.c +arch_odp_headers = $(srcdir)/arch/arm/odp/api/cpu_arch.h endif if ARCH_IS_AARCH64 -__LIB__libodp_linux_la_SOURCES += arch/aarch64/odp_cpu_arch.c \ - arch/aarch64/odp_sysinfo_parse.c +__LIB__libodp_linux_la_SOURCES += arch/default/odp_cpu_arch.c \ + arch/default/odp_cpu_cycles.c \ + arch/aarch64/odp_global_time.c \ + arch/default/odp_sysinfo_parse.c +arch_odp_headers = $(srcdir)/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 \ + arch/default/odp_global_time.c \ arch/mips64/odp_sysinfo_parse.c +arch_odp_headers = $(srcdir)/arch/mips64/odp/api/cpu_arch.h endif if ARCH_IS_POWERPC -__LIB__libodp_linux_la_SOURCES += arch/powerpc/odp_cpu_arch.c \ +__LIB__libodp_linux_la_SOURCES += arch/default/odp_cpu_arch.c \ + arch/default/odp_cpu_cycles.c \ + arch/default/odp_global_time.c \ arch/powerpc/odp_sysinfo_parse.c +arch_odp_headers = $(srcdir)/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_global_time.c \ arch/x86/odp_sysinfo_parse.c +arch_odp_headers = $(srcdir)/arch/x86/odp/api/cpu_arch.h +noinst_HEADERS += $(srcdir)/arch/x86/cpu_flags.h endif +noinst_HEADERS += $(srcdir)/arch/default/odp/api/cpu_arch.h + +odpapiinclude_HEADERS += $(arch_odp_headers) + if HAVE_PCAP __LIB__libodp_linux_la_SOURCES += pktio/pcap.c endif diff --git a/platform/linux-generic/arch/aarch64/odp_cpu_arch.c b/platform/linux-generic/arch/aarch64/odp_global_time.c similarity index 68% rename from platform/linux-generic/arch/aarch64/odp_cpu_arch.c rename to platform/linux-generic/arch/aarch64/odp_global_time.c index b87d1c102..97444f7e9 100644 --- a/platform/linux-generic/arch/aarch64/odp_cpu_arch.c +++ b/platform/linux-generic/arch/aarch64/odp_global_time.c @@ -8,48 +8,11 @@ #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; -} - -uint64_t odp_cpu_cycles_max(void) -{ - return UINT64_MAX; -} - -uint64_t odp_cpu_cycles_resolution(void) -{ - return 1; -} - int cpu_has_global_time(void) { uint64_t hz = cpu_global_time_freq(); diff --git a/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c b/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c deleted file mode 100644 index 1e2c729a7..000000000 --- a/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright (c) 2016, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include -#include -#include - -int cpuinfo_parser(FILE *file ODP_UNUSED, system_info_t *sysinfo) -{ - int i; - - ODP_DBG("Warning: use dummy values for freq and model string\n"); - for (i = 0; i < MAX_CPU_NUMBER; i++) { - sysinfo->cpu_hz_max[i] = 1400000000; - strcpy(sysinfo->model_str[i], "UNKNOWN"); - } - - return 0; -} - -void sys_info_print_arch(void) -{ -} diff --git a/platform/linux-generic/arch/arm/odp_cpu_arch.c b/platform/linux-generic/arch/arm/odp_cpu_arch.c deleted file mode 100644 index fc49ce371..000000000 --- a/platform/linux-generic/arch/arm/odp_cpu_arch.c +++ /dev/null @@ -1,79 +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; -} - -uint64_t odp_cpu_cycles_max(void) -{ - return UINT64_MAX; -} - -uint64_t odp_cpu_cycles_resolution(void) -{ - return 1; -} - -int cpu_has_global_time(void) -{ - uint64_t hz = cpu_global_time_freq(); - - /* - * The system counter portion of the architected timer must - * provide a uniform view of system time to all processing - * elements in the system. This should hold true even for - * heterogeneous SoCs. - * - * Determine whether the system has 'global time' by checking - * whether a read of the architected timer frequency sys reg - * returns a sane value. Sane is considered to be within - * 1MHz and 6GHz (1us and .1667ns period). - */ - return hz >= 1000000 && hz <= 6000000000; -} - -uint64_t cpu_global_time(void) -{ - return 0; -} - -uint64_t cpu_global_time_freq(void) -{ - return 0; -} diff --git a/platform/linux-generic/arch/arm/odp_sysinfo_parse.c b/platform/linux-generic/arch/arm/odp_sysinfo_parse.c deleted file mode 100644 index 1e2c729a7..000000000 --- a/platform/linux-generic/arch/arm/odp_sysinfo_parse.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright (c) 2016, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include -#include -#include - -int cpuinfo_parser(FILE *file ODP_UNUSED, system_info_t *sysinfo) -{ - int i; - - ODP_DBG("Warning: use dummy values for freq and model string\n"); - for (i = 0; i < MAX_CPU_NUMBER; i++) { - sysinfo->cpu_hz_max[i] = 1400000000; - strcpy(sysinfo->model_str[i], "UNKNOWN"); - } - - return 0; -} - -void sys_info_print_arch(void) -{ -} diff --git a/platform/linux-generic/arch/default/odp_cpu_arch.c b/platform/linux-generic/arch/default/odp_cpu_arch.c index fab351feb..8a8da7445 100644 --- a/platform/linux-generic/arch/default/odp_cpu_arch.c +++ b/platform/linux-generic/arch/default/odp_cpu_arch.c @@ -12,10 +12,7 @@ #include #include -#include -#include #include -#include #define GIGA 1000000000 @@ -39,28 +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; -} - -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; -} diff --git a/platform/linux-generic/arch/default/odp_cpu_cycles.c b/platform/linux-generic/arch/default/odp_cpu_cycles.c new file mode 100644 index 000000000..ccc588825 --- /dev/null +++ b/platform/linux-generic/arch/default/odp_cpu_cycles.c @@ -0,0 +1,19 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "config.h" + +#include + +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/default/odp_global_time.c b/platform/linux-generic/arch/default/odp_global_time.c new file mode 100644 index 000000000..89cce1cfb --- /dev/null +++ b/platform/linux-generic/arch/default/odp_global_time.c @@ -0,0 +1,33 @@ +/* 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 + +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; +} diff --git a/platform/linux-generic/arch/mips64/odp_cpu_arch.c b/platform/linux-generic/arch/mips64/odp_cpu_arch.c index 143867ea0..620a01044 100644 --- a/platform/linux-generic/arch/mips64/odp_cpu_arch.c +++ b/platform/linux-generic/arch/mips64/odp_cpu_arch.c @@ -22,28 +22,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; -} - -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; -} diff --git a/platform/linux-generic/arch/powerpc/odp_cpu_arch.c b/platform/linux-generic/arch/powerpc/odp_cpu_arch.c index fab351feb..6a16f13a2 100644 --- a/platform/linux-generic/arch/powerpc/odp_cpu_arch.c +++ b/platform/linux-generic/arch/powerpc/odp_cpu_arch.c @@ -39,28 +39,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; -} - -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; -} diff --git a/platform/linux-generic/arch/powerpc/odp_global_time.c b/platform/linux-generic/arch/powerpc/odp_global_time.c new file mode 100644 index 000000000..d54ba6bc8 --- /dev/null +++ b/platform/linux-generic/arch/powerpc/odp_global_time.c @@ -0,0 +1,15 @@ + +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; +} diff --git a/platform/linux-generic/arch/x86/odp_cpu_arch.c b/platform/linux-generic/arch/x86/odp_cpu_arch.c index 50fbbac66..a20d91734 100644 --- a/platform/linux-generic/arch/x86/odp_cpu_arch.c +++ b/platform/linux-generic/arch/x86/odp_cpu_arch.c @@ -9,7 +9,6 @@ #include #include -#include #include #include @@ -30,74 +29,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; -} - -uint64_t cpu_global_time(void) -{ - return odp_cpu_cycles(); -} - -#define SEC_IN_NS 1000000000ULL - -/* Measure TSC frequency. Frequency information registers are defined for x86, - * but those are often not enumerated. */ -uint64_t cpu_global_time_freq(void) -{ - struct timespec sleep, ts1, ts2; - uint64_t t1, t2, ts_nsec, cycles, hz; - int i; - uint64_t avg = 0; - int rounds = 3; - int warm_up = 1; - - for (i = 0; i < rounds; i++) { - sleep.tv_sec = 0; - - if (warm_up) - sleep.tv_nsec = SEC_IN_NS / 1000; - else - sleep.tv_nsec = SEC_IN_NS / 4; - - if (clock_gettime(CLOCK_MONOTONIC_RAW, &ts1)) { - ODP_DBG("clock_gettime failed\n"); - return 0; - } - - t1 = cpu_global_time(); - - if (nanosleep(&sleep, NULL) < 0) { - ODP_DBG("nanosleep failed\n"); - return 0; - } - - if (clock_gettime(CLOCK_MONOTONIC_RAW, &ts2)) { - ODP_DBG("clock_gettime failed\n"); - return 0; - } - - t2 = cpu_global_time(); - - ts_nsec = (ts2.tv_sec - ts1.tv_sec) * SEC_IN_NS; - ts_nsec += ts2.tv_nsec - ts1.tv_nsec; - - cycles = t2 - t1; - - hz = (cycles * SEC_IN_NS) / ts_nsec; - - if (warm_up) - warm_up = 0; - else - avg += hz; - } - - return avg / (rounds - 1); -} diff --git a/platform/linux-generic/arch/x86/odp_global_time.c b/platform/linux-generic/arch/x86/odp_global_time.c new file mode 100644 index 000000000..3ed243cc6 --- /dev/null +++ b/platform/linux-generic/arch/x86/odp_global_time.c @@ -0,0 +1,77 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "config.h" + +#include + +#include + +#include +#include +#include +#include + +uint64_t cpu_global_time(void) +{ + return odp_cpu_cycles(); +} + +#define SEC_IN_NS 1000000000ULL + +/* Measure TSC frequency. Frequency information registers are defined for x86, + * but those are often not enumerated. */ +uint64_t cpu_global_time_freq(void) +{ + struct timespec sleep, ts1, ts2; + uint64_t t1, t2, ts_nsec, cycles, hz; + int i; + uint64_t avg = 0; + int rounds = 3; + int warm_up = 1; + + for (i = 0; i < rounds; i++) { + sleep.tv_sec = 0; + + if (warm_up) + sleep.tv_nsec = SEC_IN_NS / 1000; + else + sleep.tv_nsec = SEC_IN_NS / 4; + + if (clock_gettime(CLOCK_MONOTONIC_RAW, &ts1)) { + ODP_DBG("clock_gettime failed\n"); + return 0; + } + + t1 = cpu_global_time(); + + if (nanosleep(&sleep, NULL) < 0) { + ODP_DBG("nanosleep failed\n"); + return 0; + } + + if (clock_gettime(CLOCK_MONOTONIC_RAW, &ts2)) { + ODP_DBG("clock_gettime failed\n"); + return 0; + } + + t2 = cpu_global_time(); + + ts_nsec = (ts2.tv_sec - ts1.tv_sec) * SEC_IN_NS; + ts_nsec += ts2.tv_nsec - ts1.tv_nsec; + + cycles = t2 - t1; + + hz = (cycles * SEC_IN_NS) / ts_nsec; + + if (warm_up) + warm_up = 0; + else + avg += hz; + } + + return avg / (rounds - 1); +} From patchwork Mon Sep 18 13:00:10 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: 112917 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3636156qgf; Mon, 18 Sep 2017 06:01:41 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBMd58kBHoHvijftPkdx0/7AH0R23j179CBv0lo4ordL5IeI/TuoA0dfP6FiCvpRXpU3BGJ X-Received: by 10.200.54.240 with SMTP id b45mr48677715qtc.264.1505739701041; Mon, 18 Sep 2017 06:01:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505739701; cv=none; d=google.com; s=arc-20160816; b=Qw3+NZqbG2gVVMRVmNcbqLJ3AZm8GwNHDvtBqkpGXjKxpgRcQjS5UkmcQyrau2begL 9zrACjltZmHv1OGekJBBoKbqHlwMfYJT4m/c5VjeT9vYhJBmE9vkc1nGRWV85yM2mfPv eII/kCiRGRgZPEDBVnXAdtIya1HxRu7vi5/EbUk2Fz8EaitGiF2j6I2yWNkPUix/Vh9w VMZSK0lsox6btOQMKnF4isYvcgpCsp0a0dPYvi5uwycjaBfZjBUzsQ8gKpbo++FXwv9D orU77oViSiPXVilh/+YBknPi1xVffI60Ie7ubv/lGUaTd9N8Hqk1JJEPDHc0T2yZV6g8 fILg== 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=63SlPEiLpJJjcUURuW6TJnwJMj2WoD30EztnRrRM9iU=; b=R4LgSQEvdjC6NiSlG3DI7RVDu6ciVW/YfamLo0Ujcs1cHoKUON01AUGmXi+sHbwv4B /GRD2E2OJHUOndKjLq58UdVIPpmzwpYlbS6U+ptUZx9AKjN6MyIxnKhY692veE8Mp4wO YFVObnjSt+eVH6yxh5Z4NC50F6/ztsq7DlJEwu/0oEcF0Zw0XKJlBiw6lYzoZLMsbxOH AApzfG561I6BfoDKxGqRC26b8v0ZaAm3jXeStbCGkZej9HdzBSakeMEXKKb7Y9dLsBHu nG6DB7mjMDLPm9U+Q6cL2JKtbVH+xNCSlg5ni0Fbgsb+zd5FPT1fFU7ZgI6cWmN7yxAz wAWA== ARC-Authentication-Results: i=1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id p42si6928686qte.537.2017.09.18.06.01.40; Mon, 18 Sep 2017 06:01:41 -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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 882C46074D; Mon, 18 Sep 2017 13:01:40 +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,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 0A56D60D44; Mon, 18 Sep 2017 13:00:37 +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 1F6DF60D3A; Mon, 18 Sep 2017 13:00:32 +0000 (UTC) Received: from forward101j.mail.yandex.net (forward101j.mail.yandex.net [5.45.198.241]) by lists.linaro.org (Postfix) with ESMTPS id 7C8CC60D45 for ; Mon, 18 Sep 2017 13:00:26 +0000 (UTC) Received: from mxback14j.mail.yandex.net (mxback14j.mail.yandex.net [IPv6:2a02:6b8:0:1619::90]) by forward101j.mail.yandex.net (Yandex) with ESMTP id 833E71241FB8 for ; Mon, 18 Sep 2017 16:00:25 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback14j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id FSllaIknrY-0PoKIgh9; Mon, 18 Sep 2017 16:00:25 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id WiH8IrUPsa-0OLWBEWe; Mon, 18 Sep 2017 16:00:24 +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: Mon, 18 Sep 2017 16:00:10 +0300 Message-Id: <1505739611-19678-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505739611-19678-1-git-send-email-odpbot@yandex.ru> References: <1505739611-19678-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 163 Subject: [lng-odp] [PATCH v5 3/4] configure: support compiling with no arch optimizations 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: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 163 (lumag:improve-build-4) ** https://github.com/Linaro/odp/pull/163 ** Patch: https://github.com/Linaro/odp/pull/163.patch ** Base sha: e1c46f8e296a730ed27141a33189185bb7dfd1b1 ** Merge commit sha: a232c0012683b33d1a12d67ce30127ac78ba57e0 **/ configure.ac | 68 +++++++++++++++++--------------------- platform/linux-generic/Makefile.am | 8 ++++- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/configure.ac b/configure.ac index 99bee092f..bea8f4dfd 100644 --- a/configure.ac +++ b/configure.ac @@ -104,45 +104,44 @@ AX_VALGRIND_CHECK ########################################################################## # Which architecture optimizations will we use ########################################################################## -AS_CASE([$host], - [x86*], [ARCH_DIR=x86], - [i686*], [ARCH_DIR=x86], - [mips64*], [ARCH_DIR=mips64], - [powerpc*], [ARCH_DIR=powerpc], - [aarch64*], [ARCH_DIR=aarch64], - [arm*], [ARCH_DIR=arm], - [ARCH_DIR=undefined] -) +AC_ARG_WITH([arch-default], + [AS_HELP_STRING([with-arch-default], [use generic arch files])], + [ARCH_DIR=default + ARCH_ABI=default], +[AS_CASE([$host], + [x86*], [ARCH_DIR=x86 + ARCH_ABI=x86_64-linux], + [i686*], [ARCH_DIR=x86 + ARCH_ABI=x86_32-linux], + [mips64*], [ARCH_DIR=mips64 + ARCH_ABI=mips64-linux], + [powerpc*], [ARCH_DIR=powerpc + ARCH_ABI=power64-linux], + [aarch64*], [ARCH_DIR=aarch64 + ARCH_ABI=arm64-linux], + [arm*], [ARCH_DIR=arm + ARCH_ABI=arm32-linux], + [ARCH_DIR=undefined + ARCH_ABI=undefined] +)]) AC_SUBST([ARCH_DIR]) +AC_SUBST([ARCH_ABI]) ########################################################################## # Warn on the defaults if arch is undefined ########################################################################## -if test "${ARCH_DIR}" = "undefined"; -then - echo "ARCH_DIR is undefined, please add your ARCH_DIR based on host=${host}" - exit 1 -fi +AS_IF([test "${ARCH_DIR}" = "undefined"], + [AC_MSG_ERROR([ARCH_DIR is undefined, please add your ARCH_DIR based on host=${host}])]) -########################################################################## -# Architecture for ABI support -########################################################################## -AS_CASE([$host], - [x86*], [ARCH_ABI=x86_64-linux], - [i686*], [ARCH_ABI=x86_32-linux], - [mips64*], [ARCH_ABI=mips64-linux], - [powerpc*], [ARCH_ABI=power64-linux], - [aarch64*], [ARCH_ABI=arm64-linux], - [arm*], [ARCH_ABI=arm32-linux], - [ARCH_ABI=undefined] -) -AC_SUBST([ARCH_ABI]) +AS_IF([test "${ARCH_ABI}" = "undefined"], + [AC_MSG_ERROR([ARCH_ABI is undefined, please add your ARCH_ABI based on host=${host}])]) -if test "${ARCH_ABI}" = "undefined"; -then - echo "ARCH_ABI is undefined, please add your ARCH_ABI based on host=${host}" - exit 1 -fi +AM_CONDITIONAL([ARCH_IS_DEFAULT], [test "x${ARCH_DIR}" = "xdefault"]) +AM_CONDITIONAL([ARCH_IS_ARM], [test "x${ARCH_DIR}" = "xarm"]) +AM_CONDITIONAL([ARCH_IS_AARCH64], [test "x${ARCH_DIR}" = "xaarch64"]) +AM_CONDITIONAL([ARCH_IS_MIPS64], [test "x${ARCH_DIR}" = "xmips64"]) +AM_CONDITIONAL([ARCH_IS_POWERPC], [test "x${ARCH_DIR}" = "xpowerpc"]) +AM_CONDITIONAL([ARCH_IS_X86], [test "x${ARCH_DIR}" = "xx86"]) ########################################################################## # Set correct pkgconfig version @@ -219,11 +218,6 @@ AM_CONDITIONAL([HAVE_DOXYGEN], [test "x${DOXYGEN}" = "xdoxygen"]) AM_CONDITIONAL([user_guide], [test "x${user_guides}" = "xyes" ]) AM_CONDITIONAL([HAVE_MSCGEN], [test "x${MSCGEN}" = "xmscgen"]) AM_CONDITIONAL([helper_linux], [test x$helper_linux = xyes ]) -AM_CONDITIONAL([ARCH_IS_ARM], [test "x${ARCH_DIR}" = "xarm"]) -AM_CONDITIONAL([ARCH_IS_AARCH64], [test "x${ARCH_DIR}" = "xaarch64"]) -AM_CONDITIONAL([ARCH_IS_MIPS64], [test "x${ARCH_DIR}" = "xmips64"]) -AM_CONDITIONAL([ARCH_IS_POWERPC], [test "x${ARCH_DIR}" = "xpowerpc"]) -AM_CONDITIONAL([ARCH_IS_X86], [test "x${ARCH_DIR}" = "xx86"]) ########################################################################## # Setup doxygen documentation diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 0ebb6f76c..753885208 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -259,7 +259,13 @@ arch_odp_headers = $(srcdir)/arch/x86/odp/api/cpu_arch.h noinst_HEADERS += $(srcdir)/arch/x86/cpu_flags.h endif -noinst_HEADERS += $(srcdir)/arch/default/odp/api/cpu_arch.h +if ARCH_IS_DEFAULT +__LIB__libodp_linux_la_SOURCES += arch/default/odp_cpu_arch.c \ + arch/default/odp_cpu_cycles.c \ + arch/default/odp_global_time.c \ + arch/default/odp_sysinfo_parse.c +arch_odp_headers = $(srcdir)/arch/default/odp/api/cpu_arch.h +endif odpapiinclude_HEADERS += $(arch_odp_headers) From patchwork Mon Sep 18 13:00:11 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: 112920 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3641774qgf; Mon, 18 Sep 2017 06:05:35 -0700 (PDT) X-Google-Smtp-Source: AOwi7QChU/ddQowFkAEi4G2QYbF1/IGrrFOlS+jrr8uSfSWw68iKwus8k7uC/J64erYwBoOt6x/n X-Received: by 10.200.26.52 with SMTP id v49mr17649185qtj.155.1505739930581; Mon, 18 Sep 2017 06:05:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505739930; cv=none; d=google.com; s=arc-20160816; b=iJ2et/6+Mq/wqNDcfNbZZ78N9NrZx3jAA/Zn0AMj0iKK3LnaYRuAP+kRxFjpem/fw+ 0+18Bm3tzQIPe6NMtW/2rpQGfjh/ZkBPRQXgy4JrUSw7sANv0bGvUBoDcY2VNIq0TIcV 9loEJftItsjxv4Tg1alQzxBxgs/pIgraREfS9l3sg+p1t08Vj4ewKS3NQPCHMbky5+PI xrDWSVBYiyFkCCwdgZwIVmOo6oCn54wNepQi0DTaW9lmr0+F7o6ZaaMSus753xwBpp/L sGsC+4GCvfT3TGShkxe00xN/oT0oXRIAE6gJihF9Dqm29c4PBc24yerbmvQErO9ts1eM f7QA== 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=GocNITe81EWQQjDBDUWHn+JEGl9gOpZHjuHrciJVcbE=; b=APc9phXaMJFIKjFIpl+9BVdYat9BIMMieCPbdkCC6pqeIYQDxKhw9u4EO2Q6hWR6vD miTmszDaK8SEPReNSR1X34IaxdimcP3yfkrnbZ/3m6r0O/66rUajLeHEPYWK0wRKkZmW qai06nBEIpQJ9ky1AYSKnlA7wsb11WZuUdlTzy+SloD3S9lNc+vnT+jakrU3stwRd/ie 08tq3SNfhc5FLWzxun0bqWKljQ4EYiw7npkxTO6jr9/bi5pAoZlf+scyNh2KTOUaqfYg IOkmiC8clmX2lOT1fwRFF1o2upHCnPNCf/WDn92qYv5LXx2ZzCZAsIdp0EqR6O5/xEvA jAUw== ARC-Authentication-Results: i=1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id c42si7103892qtd.226.2017.09.18.06.05.30; Mon, 18 Sep 2017 06:05:30 -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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 2541960D92; Mon, 18 Sep 2017 13:05: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.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, 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 0F31760D6B; Mon, 18 Sep 2017 13:01:00 +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 714EC60D50; Mon, 18 Sep 2017 13:00:38 +0000 (UTC) Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [5.45.198.247]) by lists.linaro.org (Postfix) with ESMTPS id AC68D60D2C for ; Mon, 18 Sep 2017 13:00:27 +0000 (UTC) Received: from mxback2g.mail.yandex.net (mxback2g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:163]) by forward104j.mail.yandex.net (Yandex) with ESMTP id 23C39427C4 for ; Mon, 18 Sep 2017 16:00:26 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback2g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id E2r88sUOEh-0QVC6ETT; Mon, 18 Sep 2017 16:00:26 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id WiH8IrUPsa-0PL8XpZh; Mon, 18 Sep 2017 16:00:25 +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: Mon, 18 Sep 2017 16:00:11 +0300 Message-Id: <1505739611-19678-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505739611-19678-1-git-send-email-odpbot@yandex.ru> References: <1505739611-19678-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 163 Subject: [lng-odp] [PATCH v5 4/4] travis: test with default arch 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: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 163 (lumag:improve-build-4) ** https://github.com/Linaro/odp/pull/163 ** Patch: https://github.com/Linaro/odp/pull/163.patch ** Base sha: e1c46f8e296a730ed27141a33189185bb7dfd1b1 ** Merge commit sha: a232c0012683b33d1a12d67ce30127ac78ba57e0 **/ .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 43141f9f1..0e0bbd9a8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,6 +64,7 @@ cache: env: - CONF="" - CONF="--disable-abi-compat" + - CONF="--with-arch-default" - CONF="--enable-schedule-sp" - CONF="--enable-schedule-iquery" - CONF="--enable-dpdk-zero-copy"