From patchwork Wed May 11 13:02:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 67514 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp213295qge; Wed, 11 May 2016 06:04:15 -0700 (PDT) X-Received: by 10.55.137.68 with SMTP id l65mr3356119qkd.194.1462971855018; Wed, 11 May 2016 06:04:15 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 11si5022729qku.24.2016.05.11.06.04.14; Wed, 11 May 2016 06:04:15 -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 8E5046163B; Wed, 11 May 2016 13:04:14 +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 BB68061649; Wed, 11 May 2016 13:03: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 EF8AC6163E; Wed, 11 May 2016 13:03:07 +0000 (UTC) Received: from mail-lf0-f43.google.com (mail-lf0-f43.google.com [209.85.215.43]) by lists.linaro.org (Postfix) with ESMTPS id 60BDB61606 for ; Wed, 11 May 2016 13:03:00 +0000 (UTC) Received: by mail-lf0-f43.google.com with SMTP id j8so48412418lfd.2 for ; Wed, 11 May 2016 06:03:00 -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=V5X7gW2YlwOg5mJUZx02+rm+SW/jWrNb7As9NZPpoSk=; b=AJLPcQPYRfk4TkXONM3ZOWxsKrjpx7ISkHsJVpxaOQGwVgXRPdxwSxJDjwwTu+JyAt SHf3F533IQfP3sgmJLo+lhG1kGvS8qKQ6WXxAO7NIkj2MaPUi1QtQEphPTvd0nzI5jGG 1vJmP42pAwy7YQrzZ37f7PkNFfeKW+LQ4xh6FtkSNeusJTTP8zEADj9seN938ZWWctM5 fmuFOt7wL0G2OkSlvFCnBK0B0Q2wPaugrHVTzMGVSvdsFrcuOKUzSttbgmiE1vyUgOEu en4b+b1mRL392x96k/2MtBQFf6O8P0ra8hzBSjdeFg75ydvxcpYA03T9UYmkMkYLzcYn U5rg== X-Gm-Message-State: AOPr4FWXhPOAYQeB7BhJFYklawcpZbpcAApqQNXfroynChAeKL9P3Xs7qB2GkPa3FR8oR4DEtsE= X-Received: by 10.25.18.102 with SMTP id h99mr1482166lfi.127.1462971779279; Wed, 11 May 2016 06:02:59 -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 92sm1296970lfw.25.2016.05.11.06.02.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 May 2016 06:02:58 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Wed, 11 May 2016 16:02:50 +0300 Message-Id: <1462971770-16409-3-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 2.7.1.250.gff4ea60 In-Reply-To: <1462971770-16409-1-git-send-email-maxim.uvarov@linaro.org> References: <1462971770-16409-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv3 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 ff422f6..4801b7d 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)