From patchwork Thu Jul 9 10:46:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: hongbo.zhang@freescale.com X-Patchwork-Id: 50935 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BF7F3228E5 for ; Thu, 9 Jul 2015 10:48:42 +0000 (UTC) Received: by wgfk9 with SMTP id k9sf78173439wgf.1 for ; Thu, 09 Jul 2015 03:48:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:mime-version:subject:precedence :list-id:list-unsubscribe:list-archive:list-post:list-help :list-subscribe:content-type:content-transfer-encoding:errors-to :sender:x-original-sender:x-original-authentication-results :mailing-list; bh=evd0VE/3tdYwvcQz+9ycb36KrCgTt6MlgEVsvGg8IrY=; b=Q8msqTbsvF1BhUp7BebXJHqgyrBUE2kKjWhGO3D+xtx2X3mhtseIgVH4jTgu51F9MB 2AQLYWpyDp66coe46ZqoFll5Un4wCamjiQBS2z73uRDxXorSgA9yxUrkDdesJyKIO7vE jL6jsh3ArhzlMmqKPaYWfuVuYg3Lf0Otj3pqjzCslqVQITBeWt5AG1S7Pa45GZIVP6IR VWcojLAgyaaWRDgBvk/KjUxxHghN4+Wj1IGZFJpA/lB1AmY4WdBhY5+x5otFj2PFP2Xb /FJWL8aWG4q9wIM9eVfiYeIs9A1/1B4KT9aox8sC7PXfLdlFb57TypxwkmJXiSD6fv/k EIhg== X-Gm-Message-State: ALoCoQmcHY8JovkuNl0KcDVoNoDyLkrKtC11CBRqSPmp03HrxCkyImaEnyNIFGYWmZkCU59wb8Dd X-Received: by 10.180.87.201 with SMTP id ba9mr23459177wib.3.1436438922094; Thu, 09 Jul 2015 03:48:42 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.179.39 with SMTP id dd7ls1093667lac.60.gmail; Thu, 09 Jul 2015 03:48:41 -0700 (PDT) X-Received: by 10.152.20.106 with SMTP id m10mr14441501lae.7.1436438921828; Thu, 09 Jul 2015 03:48:41 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id qo3si4451912lbb.122.2015.07.09.03.48.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2015 03:48:41 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbzd8 with SMTP id d8so27300940lbz.0 for ; Thu, 09 Jul 2015 03:48:41 -0700 (PDT) X-Received: by 10.152.5.197 with SMTP id u5mr12977265lau.76.1436438921707; Thu, 09 Jul 2015 03:48:41 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp577288lbb; Thu, 9 Jul 2015 03:48:40 -0700 (PDT) X-Received: by 10.140.48.103 with SMTP id n94mr23354239qga.8.1436438919983; Thu, 09 Jul 2015 03:48:39 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 142si6155628qhr.18.2015.07.09.03.48.39; Thu, 09 Jul 2015 03:48:39 -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; Received: by lists.linaro.org (Postfix, from userid 109) id 069C061FAC; Thu, 9 Jul 2015 10:48:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 4A58761FB2; Thu, 9 Jul 2015 10:47:01 +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 F40F461F6F; Thu, 9 Jul 2015 10:46:52 +0000 (UTC) Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0147.outbound.protection.outlook.com [65.55.169.147]) by lists.linaro.org (Postfix) with ESMTPS id 8D4BA61F6F for ; Thu, 9 Jul 2015 10:46:22 +0000 (UTC) Received: from BY2PR03CA053.namprd03.prod.outlook.com (10.141.249.26) by BY2PR03MB288.namprd03.prod.outlook.com (10.242.37.27) with Microsoft SMTP Server (TLS) id 15.1.207.12; Thu, 9 Jul 2015 10:46:20 +0000 Received: from BN1AFFO11FD037.protection.gbl (2a01:111:f400:7c10::110) by BY2PR03CA053.outlook.office365.com (2a01:111:e400:2c5d::26) with Microsoft SMTP Server (TLS) id 15.1.213.14 via Frontend Transport; Thu, 9 Jul 2015 10:46:20 +0000 Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BN1AFFO11FD037.mail.protection.outlook.com (10.58.52.241) with Microsoft SMTP Server (TLS) id 15.1.201.10 via Frontend Transport; Thu, 9 Jul 2015 10:46:20 +0000 Received: from hongbo.ap.freescale.net (hongbo.ap.freescale.net [10.193.20.67]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t69AkBfg022771; Thu, 9 Jul 2015 03:46:18 -0700 From: To: Date: Thu, 9 Jul 2015 18:46:05 +0800 Message-ID: <1436438768-4258-6-git-send-email-hongbo.zhang@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1436438768-4258-1-git-send-email-hongbo.zhang@freescale.com> References: <1436438768-4258-1-git-send-email-hongbo.zhang@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD037; 1:VLcsvdsKa54hEWTmFhhgXKLVbDl/5sCececL35S4G7lV0wBmvbqr/DZCezRs9PjSzZ0pYrVjGiOc7y03Qn1N8nE3kR/IyzJGh4PaGjCbQLlBRVVRmxaKbQfQ/09LWY+eAM2TOx2Fdh6YrkXqPnEIuZ2639QajZFHZwfjTszPGosbf0m63wy2g7EWDaOgwyRsRoLj8SJcyEY2ey1//RT67dexPLDbBUq0Vee7p2vuFRExpHLZ1LxPpCnfL4BXo0GM/1I++vebWE02OORO6shcjc5kl1i19oYWBZ30H+DgP8djZfAflaJB5v0F71si1g6c X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(339900001)(189002)(199003)(48376002)(86362001)(110136002)(50466002)(105606002)(87936001)(86152002)(6806004)(85426001)(19580395003)(19580405001)(33646002)(50226001)(47776003)(5001960100002)(92566002)(2950100001)(104016003)(50986999)(2351001)(76176999)(62966003)(229853001)(77156002)(5003940100001)(36756003)(189998001)(77096005)(106466001)(46102003)(41533002)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR03MB288; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB288; 2:EJD7dhpT0yqn7QVFqHp5rsLFS4UrF3Pwk1XiCbN3CIMSb8QyqdAAUpTJVya+OpWi; 3:1FpIzjDDoOdStUZhvqUBXnX9a/aZGY4VGCaiaaZAOpTdnIponezYOKGinWg4iIk2vqtq3dnArhZQMntkV7fLVgaoN8CESLJc+MWr9rj2Ybw6pXiNI+8GiXqeVetoDjxUiROZ3LfC5tdjkrYjPME/hb3CVF/hBtL99dEWAYxGAD+Os/ltQoZCJqYr5qUYa3vICfuU3/3PNmNVidPNYVaz0yzJ+6kDgdM7eHsW+QK55yY=; 25:B7IiYdCchZ4fY2KaLAYkkQ4Hl8k7qDRlfn2vouboR4EAmJVWOLpbDBMUb8HyU+YtQY1CxkRdvh9xcT+9DLvxqLzhPEUdqrKjCXuFg/v6+CfO3SnCo46ugYf/jRFS6Wgejsn7Su6cc9iNpGvRBJENUWKMT034lD7ZFtjOKEPKIuGYsKJ4CE3rARF1B99mPy+vNJ081muz0Zw20s11RgU0kk2HQDw4n/L7N6Wj2o0ZG56IVJQFjZpEEUCqDNwhecNEitGJ9vXmX3C9+9xBK+L0EQ==; 20:W85Nu7KAftPyyt6ZmIWpf0Bjp+deYTJCh9JGoHbeyUyRZnaLOUq+xegMjm2EphGm94lThOPkXRWpnMLoRcGY03azFJIbuvauXUYbYLtoE+B096TOKYzsT3BLfHcf/fDIKRmS3xTjRuechhcnHA3IIBCmgYOCGKdoAwN1gEhSQNxHFaWZrnkpKL3X8iNm7SF+JSxFTOfCeeQ/ccYqUIIvKe/qu6XD2D3QqcorPd8sGbywgPydRiDmg3U9fNl+pnMNkYg94t9EDbdhVttUx1rDVJWQoznBDF2sAw5katAGewIfKqva2U8HKFQeStA+LgCEQrh8fdCN19q0Hva6FRyxC8TFIlTB/Z6sLQbRIPWm6KY= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB288; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BY2PR03MB288; BCL:0; PCL:0; RULEID:; SRVR:BY2PR03MB288; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB288; 4:tXc56+8y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=?us-ascii?Q?oFkLjeXBs+rJ3mTCDX4u0nO8398KjAP6CJ86L2DZam0WS2XWzJmYMI9IXkDK?= =?us-ascii?Q?t+wXsfPKRAuiGfaA5jWOkAJzVX+zOX8h90ULlSYKB8NPDBveJShPh+NDv9K3?= =?us-ascii?Q?3vsWh0boyFZBGfbEPXfbObL7PxanG5u/g0zccv98oOxM0RjsMIj0ibxiyLGI?= =?us-ascii?Q?gFf3UYZrYcMMNDEwSLxKpOIhbPfBB8F84aJtTVkbvNsDEE635HRcsHYtmJiw?= =?us-ascii?Q?ixTPLX3x3qxRSpGCI4yjLgFJZdYU/z4RinIbA9gbr/V95i4Y96MIInYB8LZn?= =?us-ascii?Q?pR/77H36NRDSS6gEVlmFxjX2j9wzoL27J0JD3l5KAgyCcLXnoM8zhSdFMKI0?= =?us-ascii?Q?QmzjYvwuWwB0y6zzeBjf7Z89WZTMf0+t3LmvO+FA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB288; 5:NJ39xEOTJWNLE2dNNA5gwLpBj8d01st8nGq2xEiKBajB/W2HINK93etgnPVXbdGy4Cz+RbnCwE5q+bNk7eON+fw9blmqfGsOk3uMA8PinJuOLhcg57jE4Hh32DByu6GSOlGzCOJP2BWFvnEaJJTYaA==; 24:GDU81xecNqgS/UtfPFc7Tfxthn9ElwTmWtnAoYB2AOGeVrTAWI7PtJChm4+ew44po1+bzyB0iJnI1eXR9lvYY6ApJKR3dBzN9EryKuXLdcM=; 20:XNsXmS3QWtYSNs3uM/9TWlouZJuDDN/Vc0Y2QN9UXihzwEYjo68ma1ZsKWq4t9F+8WQF3lDrfhSIHeZGho6aqA== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2015 10:46:20.1228 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR03MB288 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH v3 5/8] linux-generic: sysinfo: add new API to get model string for each CPU X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Hongbo Zhang Previous patch makes varible model_str to array model_str[] to contain data for each CPU on AMP platforms, and then this patch adds new API to get the corresponding model string for each CPU indexed by CPU ID. Signed-off-by: Hongbo Zhang --- include/odp/api/cpu.h | 11 +++++++++++ platform/linux-generic/odp_system_info.c | 11 ++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/include/odp/api/cpu.h b/include/odp/api/cpu.h index 56efe14..c2efe31 100644 --- a/include/odp/api/cpu.h +++ b/include/odp/api/cpu.h @@ -60,6 +60,17 @@ uint64_t odp_cpu_hz_max(void); const char *odp_cpu_model_str(void); /** + * CPU model name of a CPU + * + * Return CPU model name of the specified CPU. + * + * @param id CPU ID + * + * @return Pointer to CPU model name string + */ +const char *odp_cpu_id_model_str(int id); + +/** * @} */ diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c index 225deea..2881695 100644 --- a/platform/linux-generic/odp_system_info.c +++ b/platform/linux-generic/odp_system_info.c @@ -194,6 +194,7 @@ static int cpuinfo_octeon(FILE *file, odp_system_info_t *sysinfo) return 0; } + #elif defined __powerpc__ static int cpuinfo_powerpc(FILE *file, odp_system_info_t *sysinfo) { @@ -382,7 +383,15 @@ uint64_t odp_sys_page_size(void) const char *odp_cpu_model_str(void) { - return odp_global_data.system_info.model_str[0]; + return odp_cpu_id_model_str(0); +} + +const char *odp_cpu_id_model_str(int id) +{ + if (id >= 0 && id < MAX_CPU_NUMBER) + return odp_global_data.system_info.model_str[id]; + else + return NULL; } int odp_sys_cache_line_size(void)