From patchwork Tue Dec 29 08:56:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongbo Zhang X-Patchwork-Id: 59035 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2161852lbb; Tue, 29 Dec 2015 01:01:53 -0800 (PST) X-Received: by 10.140.102.11 with SMTP id v11mr70556846qge.39.1451379713328; Tue, 29 Dec 2015 01:01:53 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 47si28163112qga.86.2015.12.29.01.01.52; Tue, 29 Dec 2015 01:01:53 -0800 (PST) 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; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id CF171616EB; Tue, 29 Dec 2015 09:01:52 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=UBwLpkZo; dkim-adsp=none (unprotected policy); dkim-atps=neutral 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.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, 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 D7C7D61725; Tue, 29 Dec 2015 08:58:09 +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 9699C61707; Tue, 29 Dec 2015 08:58:04 +0000 (UTC) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by lists.linaro.org (Postfix) with ESMTPS id 3134861707 for ; Tue, 29 Dec 2015 08:56:56 +0000 (UTC) Received: by mail-pa0-f46.google.com with SMTP id uo6so99699037pac.1 for ; Tue, 29 Dec 2015 00:56:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2k+IHsPzOjq02TthnEjjEczAEbbA8L1YVBVEZIcUrIw=; b=UBwLpkZo04h11XvW28VRg9YlFTaNBsCSwW1i8sQAcmb/riqJjq3xR00sTAXq5nukbR rDIU2hjIAjtyFdcYdBGj+CnFWA7/rhUspvgSSKt/5s8/HiSteXQtJkWWSKn0V+rm/NZ5 TX6dtgzjtzqm1Hg103E38LVQSCFVm/EiO3teU= 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=2k+IHsPzOjq02TthnEjjEczAEbbA8L1YVBVEZIcUrIw=; b=Tm7RAcyneMKt+A5uj/HZz+VBhMHfQHfOMuf+j/Kg00mDoxYJ+wYHg4wzElhsaEKhq4 EDZh+6XXPtHmZmg4/lnwEhTTfkQsaJbal3TdpWZRW/oC9db/XQfdI44UNM7dibRZX0YE aLG0VCHKtG548k6QjpR6oY0Htg1k/nO9JLWjttJsUwk6bEtIxdX23xt+p5JoiothIjtU 0k054BUmU/ryXfU9t76TwCqm6NLcjOBZk5xIbNy1Gz1kof+CUiyuY9qqRTxWULyduGeU l5+u5bmy8UlH4wqNvK4RnyVEMnpNTo6rUbwpbfHEHXifU70GtY8UNArV3QD/FSt9pknl NUlg== X-Gm-Message-State: ALoCoQmiec96FXnS+8WaDd0fj4gzsqtiU36EILW9uFmkt1ea7lMarjY/lM+8GmrCBL4wcMLMJwcmcyB6BykF7G549NFT19fojQ== X-Received: by 10.66.55.39 with SMTP id o7mr83282868pap.13.1451379415594; Tue, 29 Dec 2015 00:56:55 -0800 (PST) Received: from ubuntu1504.ap.freescale.net (gate-zmy3.freescale.com. [192.88.167.1]) by smtp.gmail.com with ESMTPSA id p83sm81609266pfi.96.2015.12.29.00.56.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 29 Dec 2015 00:56:55 -0800 (PST) From: hongbo.zhang@linaro.org To: lng-odp@lists.linaro.org Date: Tue, 29 Dec 2015 16:56:25 +0800 Message-Id: <1451379388-7533-8-git-send-email-hongbo.zhang@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1451379388-7533-1-git-send-email-hongbo.zhang@linaro.org> References: <1451379388-7533-1-git-send-email-hongbo.zhang@linaro.org> X-Topics: Architecture patch Subject: [lng-odp] [PATCH v2 API-NEXT 06/11] linux-generic: sysinfo: move ARM system info codes to default arch 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: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Hongbo Zhang This patch moves the ARM system info codes into the general arch file, ARM sysinfo isn't implemented now and there is no need to create specific arch file for it, but this can serve as the default implementaton instead. Signed-off-by: Hongbo Zhang --- platform/linux-generic/Makefile.am | 1 + .../linux-generic/arch/linux/odp_sysinfo_parse.c | 20 ++++++++++++++++++++ platform/linux-generic/odp_system_info.c | 15 +-------------- 3 files changed, 22 insertions(+), 14 deletions(-) create mode 100644 platform/linux-generic/arch/linux/odp_sysinfo_parse.c diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index bb0faf0..9bc96ff 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -163,6 +163,7 @@ __LIB__libodp_la_SOURCES = \ EXTRA_DIST = \ arch/linux/odp_cpu_cycles.c \ + arch/linux/odp_sysinfo_parse.c \ arch/mips64/odp_cpu_cycles.c \ arch/mips64/odp_sysinfo_parse.c \ arch/x86/odp_cpu_cycles.c \ diff --git a/platform/linux-generic/arch/linux/odp_sysinfo_parse.c b/platform/linux-generic/arch/linux/odp_sysinfo_parse.c new file mode 100644 index 0000000..ba792b2 --- /dev/null +++ b/platform/linux-generic/arch/linux/odp_sysinfo_parse.c @@ -0,0 +1,20 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include +#include +#include + +int odp_cpuinfo_parser(FILE *file ODP_UNUSED, +odp_system_info_t *sysinfo ODP_UNUSED) +{ + return 0; +} + +uint64_t odp_cpu_hz_current(int id ODP_UNUSED) +{ + return -1; +} diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c index 8a151eb..158a6b9 100644 --- a/platform/linux-generic/odp_system_info.c +++ b/platform/linux-generic/odp_system_info.c @@ -109,20 +109,7 @@ static int huge_page_size(void) /* * HW specific /proc/cpuinfo file parsing */ -#if defined __arm__ || defined __aarch64__ - -static int odp_cpuinfo_parser(FILE *file ODP_UNUSED, -odp_system_info_t *sysinfo ODP_UNUSED) -{ - return 0; -} - -static uint64_t odp_cpu_hz_current(int id ODP_UNUSED) -{ - return -1; -} - -#elif defined __powerpc__ +#if defined __powerpc__ static int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo) { char str[1024];