From patchwork Mon May 16 18:52:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 67913 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp1685598qge; Mon, 16 May 2016 11:53:07 -0700 (PDT) X-Received: by 10.140.100.178 with SMTP id s47mr29918458qge.76.1463424787726; Mon, 16 May 2016 11:53:07 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 61si15340072qgi.106.2016.05.16.11.53.07; Mon, 16 May 2016 11:53:07 -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 5E2EC6174C; Mon, 16 May 2016 18:53:07 +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 E73EE61750; Mon, 16 May 2016 18:52:20 +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 12DBB61754; Mon, 16 May 2016 18:52:13 +0000 (UTC) Received: from mail-lf0-f53.google.com (mail-lf0-f53.google.com [209.85.215.53]) by lists.linaro.org (Postfix) with ESMTPS id 17C9D61733 for ; Mon, 16 May 2016 18:52:11 +0000 (UTC) Received: by mail-lf0-f53.google.com with SMTP id m64so120378482lfd.1 for ; Mon, 16 May 2016 11:52:11 -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=IvTGx5uXp6aphQnJJIO9bES2yvTshGf+CYAdUinawCU=; b=TdMCk5GrYBtXadE1/TbWeIAlwdUTTA/aTCYNYLGR6xAAxVyO04cIIBOTipvFewhTeH 5pkmlcuQM36NAv9zgDX8kK+MQYIRn0rlzCYydGnyPtphyETSeu9aVrskutQnYZGUSPw+ 4pvmNWLxMSisl87PfUInaOG7dQgUbvrGADHV+fk4Zrjao4NTylBKU5qXg/QDNhzWUIfa w2o39is5W4hDyVHJG0cZ2gS84Ru+4y/QHWFix6d7rdp/oiDeeerGr+/ATQebD/CxnuN7 tnN64TbkgAfmX/O0SXjCyB6xi+2v31wfHlkmEGL7LEUNYS0fG7lEwCcLCptudY1Le1bQ 0NJw== X-Gm-Message-State: AOPr4FWGvXWvRvq2qRSuRy3lQTDNtx6lzmsLV7/WwR9cVDPmA7+lM/VhyEiO0Mdz6RDLjhdh8mQ= X-Received: by 10.25.212.205 with SMTP id l196mr12310696lfg.69.1463424730006; Mon, 16 May 2016 11:52:10 -0700 (PDT) Received: from localhost.localdomain (ppp91-77-173-31.pppoe.mtu-net.ru. [91.77.173.31]) by smtp.gmail.com with ESMTPSA id oq7sm4587325lbb.47.2016.05.16.11.52.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 May 2016 11:52:09 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Mon, 16 May 2016 21:52:00 +0300 Message-Id: <1463424720-32215-3-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 2.7.1.250.gff4ea60 In-Reply-To: <1463424720-32215-1-git-send-email-maxim.uvarov@linaro.org> References: <1463424720-32215-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv4 2/2] linux-generic: drop odp_ prefix for internal cpuinfo 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" A little bit code clean up to drop odp_ prefix from internal things and rename huge_pages to default_huge_pages internal struct. Signed-off-by: Maxim Uvarov --- platform/linux-generic/arch/default/odp_sysinfo_parse.c | 2 +- platform/linux-generic/arch/mips64/odp_sysinfo_parse.c | 2 +- platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c | 2 +- platform/linux-generic/arch/x86/odp_sysinfo_parse.c | 2 +- platform/linux-generic/include/odp_internal.h | 8 ++++---- platform/linux-generic/odp_system_info.c | 10 +++++----- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/platform/linux-generic/arch/default/odp_sysinfo_parse.c b/platform/linux-generic/arch/default/odp_sysinfo_parse.c index 4dcd6d1..53e2aae 100644 --- a/platform/linux-generic/arch/default/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/default/odp_sysinfo_parse.c @@ -8,7 +8,7 @@ #include #include -int odp_cpuinfo_parser(FILE *file ODP_UNUSED, odp_system_info_t *sysinfo) +int cpuinfo_parser(FILE *file ODP_UNUSED, system_info_t *sysinfo) { int i; diff --git a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c index d45b420..407264b 100644 --- a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c @@ -7,7 +7,7 @@ #include #include -int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo) +int cpuinfo_parser(FILE *file, system_info_t *sysinfo) { char str[1024]; char *pos; diff --git a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c index 95200ee..3b88d55 100644 --- a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c @@ -7,7 +7,7 @@ #include #include -int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo) +int cpuinfo_parser(FILE *file, system_info_t *sysinfo) { char str[1024]; char *pos; diff --git a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c index c1e05c0..96127ec 100644 --- a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c @@ -7,7 +7,7 @@ #include #include -int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo) +int cpuinfo_parser(FILE *file, system_info_t *sysinfo) { char str[1024]; char *pos; diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index 28a4fc4..19ab40a 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -30,19 +30,19 @@ extern __thread int __odp_errno; typedef struct { uint64_t cpu_hz_max[MAX_CPU_NUMBER]; - uint64_t huge_page_size; + uint64_t default_huge_page_size; uint64_t page_size; int cache_line_size; int cpu_count; char cpu_arch_str[128]; char model_str[MAX_CPU_NUMBER][128]; -} odp_system_info_t; +} system_info_t; struct odp_global_data_s { pid_t main_pid; odp_log_func_t log_fn; odp_abort_func_t abort_fn; - odp_system_info_t system_info; + system_info_t system_info; odp_cpumask_t control_cpus; odp_cpumask_t worker_cpus; int num_cpus_installed; @@ -126,7 +126,7 @@ int _odp_int_name_tbl_term_global(void); void _odp_flush_caches(void); -int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo); +int cpuinfo_parser(FILE *file, system_info_t *sysinfo); uint64_t odp_cpu_hz_current(int id); #ifdef __cplusplus diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c index 8e95e05..fca35ce 100644 --- a/platform/linux-generic/odp_system_info.c +++ b/platform/linux-generic/odp_system_info.c @@ -98,7 +98,7 @@ static uint64_t default_huge_page_size(void) /* * Analysis of /sys/devices/system/cpu/ files */ -static int systemcpu(odp_system_info_t *sysinfo) +static int systemcpu(system_info_t *sysinfo) { int ret; @@ -124,7 +124,7 @@ static int systemcpu(odp_system_info_t *sysinfo) return -1; } - sysinfo->huge_page_size = default_huge_page_size(); + sysinfo->default_huge_page_size = default_huge_page_size(); return 0; } @@ -137,7 +137,7 @@ int odp_system_info_init(void) { FILE *file; - memset(&odp_global_data.system_info, 0, sizeof(odp_system_info_t)); + memset(&odp_global_data.system_info, 0, sizeof(system_info_t)); odp_global_data.system_info.page_size = ODP_PAGE_SIZE; @@ -147,7 +147,7 @@ int odp_system_info_init(void) return -1; } - odp_cpuinfo_parser(file, &odp_global_data.system_info); + cpuinfo_parser(file, &odp_global_data.system_info); fclose(file); @@ -199,7 +199,7 @@ uint64_t odp_cpu_hz_max_id(int id) uint64_t odp_sys_huge_page_size(void) { - return odp_global_data.system_info.huge_page_size; + return odp_global_data.system_info.default_huge_page_size; } uint64_t odp_sys_page_size(void)