From patchwork Tue Aug 11 07:33:56 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: 52288 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by patches.linaro.org (Postfix) with ESMTPS id D4A4222919 for ; Tue, 11 Aug 2015 07:56:05 +0000 (UTC) Received: by lbck9 with SMTP id k9sf17931332lbc.0 for ; Tue, 11 Aug 2015 00:56:04 -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:spamdiagnosticoutput :spamdiagnosticmetadata:cc: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=alUHV+XNFDGiDDUIjE4jkbjLQG3iA6qMVyv/9QatAFU=; b=DSYVMC+SSuNUilYbOp0rAii/xq56Su8lSEy1cvZYlAT4hw9PWO/+UCKvfAvy+0rwgc n46mZwOQrcGYeSpmSWszZtEVZxIyOXR1bnLfU5HkFAtoSMpTpzPmPL7SE8vFsp81CSr3 Cag5+7SzflnU3/wnDnW9CBlsIkURQws0guCMN0xfTOwm+Z4BduFxlbVnYUDFhHyRCJTv +KgiwYO7NHXiwZbqpZsI6KC8C7W/9yNzVuRLjfOuLMHIQ1pPWtARAcIrIyFF2HIw2S+1 FShMYzdCW2i04eyJc71SRlFvIaHr3L2Bq/uXvzJrsGZ3iBlwi+Ta+MrNJisDRLoJQbAZ YOZg== X-Gm-Message-State: ALoCoQnACnXFNk/43ST0c/4bA06cWVe7E3+xp71j3av1wI4H+lK/M20c5J6z6gvDCibvbXV1WLpP X-Received: by 10.194.188.104 with SMTP id fz8mr7594251wjc.1.1439279764792; Tue, 11 Aug 2015 00:56:04 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.80 with SMTP id v16ls117105laz.62.gmail; Tue, 11 Aug 2015 00:56:04 -0700 (PDT) X-Received: by 10.152.10.148 with SMTP id i20mr24498158lab.63.1439279764396; Tue, 11 Aug 2015 00:56:04 -0700 (PDT) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id de10si747717lac.92.2015.08.11.00.56.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Aug 2015 00:56:04 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by lbcbn3 with SMTP id bn3so13945162lbc.2 for ; Tue, 11 Aug 2015 00:56:04 -0700 (PDT) X-Received: by 10.112.145.169 with SMTP id sv9mr24932243lbb.73.1439279763951; Tue, 11 Aug 2015 00:56:03 -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.7.198 with SMTP id l6csp2354494lba; Tue, 11 Aug 2015 00:56:02 -0700 (PDT) X-Received: by 10.55.55.129 with SMTP id e123mr26725718qka.23.1439279762503; Tue, 11 Aug 2015 00:56:02 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id f198si1965864qhe.13.2015.08.11.00.56.01; Tue, 11 Aug 2015 00:56:02 -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 A5C9762058; Tue, 11 Aug 2015 07:56:01 +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 5FAF06205A; Tue, 11 Aug 2015 07:53:41 +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 2CE8662042; Tue, 11 Aug 2015 07:53:33 +0000 (UTC) Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0125.outbound.protection.outlook.com [207.46.100.125]) by lists.linaro.org (Postfix) with ESMTPS id B623062058 for ; Tue, 11 Aug 2015 07:53:05 +0000 (UTC) Received: from BY2PR03CA008.namprd03.prod.outlook.com (10.255.93.25) by CY1PR0301MB1275.namprd03.prod.outlook.com (10.161.214.23) with Microsoft SMTP Server (TLS) id 15.1.225.19; Tue, 11 Aug 2015 07:53:04 +0000 Received: from BN1AFFO11FD037.protection.gbl (10.255.93.4) by BY2PR03CA008.outlook.office365.com (10.255.93.25) with Microsoft SMTP Server (TLS) id 15.1.225.19 via Frontend Transport; Tue, 11 Aug 2015 07:53:03 +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.243.9 via Frontend Transport; Tue, 11 Aug 2015 07:53:03 +0000 Received: from hongbo.ap.freescale.net (hongbo.ap.freescale.net [10.193.20.23]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t7B7qjK7024123; Tue, 11 Aug 2015 00:53:00 -0700 From: To: Date: Tue, 11 Aug 2015 15:33:56 +0800 Message-ID: <1439278439-11386-7-git-send-email-hongbo.zhang@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439278439-11386-1-git-send-email-hongbo.zhang@freescale.com> References: <1439278439-11386-1-git-send-email-hongbo.zhang@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD037; 1:/3mi2lskw55OR9eXVMPmqHflTsXZQtN/eK6xHp4FsK0Fh1O+eMOYrHhf0JoJkooCRfkXjKI8FBeuB/iWkfLAI2e1SSsQblLyO2/H55rBA9PU3QcHVPhhPGuj9parZV4WWdWoCqPNIKvLdWwEm3JpI/K42PqO2msty7IxIqrtKXJ42pSneoywymx7xW4tFohrSRaSsayTr40PSbUuEBAmzK5hSoR5qNUC3R4nt0mwL3yzart72ykw4POUTNzLjRZyLB14AoClrJEOFpE75xNWqXNpt62hN+jIVAeiXKF13BBFmsHDVaxMd3c4a8sJ8O8OxJcimlpWFS+M4xDE0qGvQ8OH3EqAPSBAZd5yNMzgs8KoadaO92A0WyDY0gN1Dp7g4iWJrV8C+D2g09TX+5W99w== X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(3050300001)(339900001)(189002)(199003)(6806004)(5001830100001)(575784001)(86362001)(77096005)(19580395003)(33646002)(64706001)(19580405001)(2351001)(77156002)(50466002)(229853001)(104016003)(62966003)(85426001)(68736005)(86152002)(87936001)(46102003)(76176999)(97736004)(36756003)(189998001)(92566002)(106466001)(5001960100002)(47776003)(81156007)(5003940100001)(105606002)(2950100001)(4001540100001)(50986999)(48376002)(110136002)(69596002)(5001860100001)(50226001)(41533002)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR0301MB1275; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics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8cYDGs2tOWjSYvMeDCTPveO7miL2vey4iISCAxmYIE1Kz7W8XvtHKsowPR8XVOnCUWolY5YXTxk1gbfsvCgq34y2+Osnn6xjZSs=; 4:rdfPn0CqwLd7PaM+JkT5tLtIYoLsKii8EgXlFdCFRP2r4ke8bdufevOa8en7K8Yb+JDrkGiHtuUMRnE+uNTxTf4QYuVJfjp4x59MjELwV8CX1+yEVWjsV2hdblYO3zLM64OZg2XYNBYqzP042CzIqCQwK3Fvas2kRjWnV12zZeMEES7iEV8jaGIzFhzMMNHlEGGOd6/CBoP/esZE5Bn78Zy3S3Py3OSbqPSe+Gc/ix+8kJwywJ2xKsQmCOdpJQX3PW9dGsZ30FYazUe07Ojxi0sJk0ij/Cqu19arydWA8SM= 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:CY1PR0301MB1275; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0301MB1275; X-Forefront-PRVS: 066517B35B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB1275; 23:syUr6jW7v4onCc3JQiKZot+x662xDc6bKanec6b?= =?us-ascii?Q?N6tVtq4QyRGQLXPbjGW/EXm7BCDphSO2ExLoeKfyapP5b6Wz7cP2rynLTqqI?= =?us-ascii?Q?Y7yw6BrmfalxX4U8q3qVn7XQshu2wU/g7nibvGNcke6JOgiYse5B8ezKkZqO?= =?us-ascii?Q?RrumiOaabqVlTerosUzDZgam6QpnGre/e4WA9sS8Y5jWGBCU+tgoIrnk8qzH?= =?us-ascii?Q?4GiBRmn6oMaKRfGYFhNFrhnrslU7Zi1ZD3NweXdvF1e/bnwuAwmm58qTN1yq?= =?us-ascii?Q?bLUubkc4PRKZSOZ/2iwGbNCOVWiQfvjObHlg87VLQPfzVAO4Nd+Bav/izt7W?= =?us-ascii?Q?X6eDegI+POnmolQsAIAd+lHrn51oHPxhT2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?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1275; 5:ChAeUJ2FYft+4IqwiWskRdHidDn+jKOObi65uB8F1vVaxTKV0m5cs5xuVYVQYRlB0wbCvbAQujxFg7Dqt8i1+yybg8TLuIuIRUgsG/vQOWR0J5v23zGOhKwefpkFOiQnSOBF5DKA3I83dz+R2JR9hg==; 24:Tj35UIcMyeU20Ov9eCo+j3D/Z0yBdbBocSnTfGwIOTveEZXhpyHmyuxGti/wjX+t6V4KBxumNSIOSHlpUOTZqeaeHAs6CidsVOnfO/gKVFY=; 20:RQjoCSKTnBRDBK0ivWEvQKfk3/0loXE9m/7Gyr/paDSjlQy1tVv1TKtaJSo4GyPj/82xLsJrIKNNwLRikRRdMQ== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2015 07:53:03.3858 (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: CY1PR0301MB1275 X-Topics: patch Cc: stuart.haslam@arm.com, petri.savolainen@nokia.com Subject: [lng-odp] [API-NEXT PATCH v4 06/10] 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.182 as permitted sender) smtp.mailfrom=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 9d0aaf5..8f4d11b 100644 --- a/include/odp/api/cpu.h +++ b/include/odp/api/cpu.h @@ -58,6 +58,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 d78fd3e..a279061 100644 --- a/platform/linux-generic/odp_system_info.c +++ b/platform/linux-generic/odp_system_info.c @@ -195,6 +195,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) { @@ -383,7 +384,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)