From patchwork Tue May 10 15:08:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 67460 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp2180254qge; Tue, 10 May 2016 08:09:32 -0700 (PDT) X-Received: by 10.50.50.135 with SMTP id c7mr16939839igo.33.1462892972712; Tue, 10 May 2016 08:09:32 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 135si1849360itj.38.2016.05.10.08.09.32; Tue, 10 May 2016 08:09:32 -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 3295361586; Tue, 10 May 2016 15:09:32 +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 3FB1A6163F; Tue, 10 May 2016 15:08:32 +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 56DAE610DE; Tue, 10 May 2016 15:08:28 +0000 (UTC) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com [209.85.215.46]) by lists.linaro.org (Postfix) with ESMTPS id E86B5610E1 for ; Tue, 10 May 2016 15:08:21 +0000 (UTC) Received: by mail-lf0-f46.google.com with SMTP id y84so18498942lfc.0 for ; Tue, 10 May 2016 08:08:21 -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=vUMD+fAOmOxNrY7DtGpzvEEH/jPi+QF8nUsxWa1rs5Y=; b=BZaLZ12U6HylQQPxOJIcJRMOfLzUKIwma3XTog0P/BSFS3Pz8qlLysit7uTSnsQbWb 8+qcZRWSfk4X2p6YxSn0F8OzqcNp6qK005xef6cIR8hxoCQUVYvfkEo4jxB8VAzt1BgV IjmxtP+vH6R5ZcERA2cS82Q2hQ9DRNk1T5UJvxYMfjH3nSZ2784qWm41rRFhMldQIMU7 gURGng2DqmU0B1WTJoKi4zCIEi2HDa/Ix90W+ExDRJYz2AL2mKJDmR7AiIHX64wMW03o SrqINp5+deTwFgvSjiO44HjnKZVXOuUrLpNjLh/8Vt/VmMf2t73ESJt+fjF6o8+XutvW P3Lw== X-Gm-Message-State: AOPr4FWyXPOXmNYGQwQ4/Kwjan/jJFn+72TfzPtRwkp2+llTp8jdeqRkiVUnypj06Vh6XNEpjzI= X-Received: by 10.112.144.105 with SMTP id sl9mr18110294lbb.108.1462892900819; Tue, 10 May 2016 08:08:20 -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 o10sm456150lbp.47.2016.05.10.08.08.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 May 2016 08:08:20 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Tue, 10 May 2016 18:08:04 +0300 Message-Id: <1462892884-9610-3-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 2.7.1.250.gff4ea60 In-Reply-To: <1462892884-9610-1-git-send-email-maxim.uvarov@linaro.org> References: <1462892884-9610-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv2 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 14244c3..0dd2128 100644 --- a/platform/linux-generic/odp_system_info.c +++ b/platform/linux-generic/odp_system_info.c @@ -101,7 +101,7 @@ static int 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; @@ -127,7 +127,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; } @@ -140,7 +140,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; @@ -150,7 +150,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); @@ -202,7 +202,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)