Message ID | 1442325342-13806-8-git-send-email-hongbo.zhang@freescale.com |
---|---|
State | New |
Headers | show
Return-Path: <patchwork-forward+bncBDPILVOKSELBBTWJ4CXQKGQEUQXRTQI@linaro.org> X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by patches.linaro.org (Postfix) with ESMTPS id D76C022A0D for <linaro@patches.linaro.org>; Tue, 15 Sep 2015 14:01:50 +0000 (UTC) Received: by wisv5 with SMTP id v5sf8613554wis.0 for <linaro@patches.linaro.org>; Tue, 15 Sep 2015 07:01:50 -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=t3TnuhbbWOO460Q5X/p+8vqZ7hl9h4O021ES3Y4hDmo=; b=G89VZVf/07ky7SOT0Xh9WD6FJ3J7nFASeyd8Xcou4ID4+3Nu87Xzj0hcq5IP4B4N/5 tIS/aoxbQ7iSD83KxKsyZc7zOCpEn/e4K3Gsa0DtjFh+S9Zb3pvggRvuZ/IPZbDfOuA5 LBFX7rMRcYceUDCKgIKnvcoo/L7XCbEGXdmHnl9HrXH0LdKiyqDi6A6vaFjjktyAV5rR XzUVWGOK0iEVdaa5M3BAkES5jr59x1MmHoV4DnOr/oCwBz35e9JhCyhE2WN7YwLtQLQL inel1Z+OSZORFrnbInoYN61mIRKPMOEvoJxxgKKA79c6Nc8SmNireCJWVi6KN7EgGcXC APaw== X-Gm-Message-State: ALoCoQnPLozgOK/ouInPfE0camFEI78dZXM0T1ogJp0OitJRBO0AjkYOfCvVInVASsMSMUYE2TP1 X-Received: by 10.152.29.10 with SMTP id f10mr2067157lah.1.1442325710124; Tue, 15 Sep 2015 07:01:50 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.10.7 with SMTP id e7ls698414lab.70.gmail; Tue, 15 Sep 2015 07:01:50 -0700 (PDT) X-Received: by 10.152.8.233 with SMTP id u9mr21418129laa.8.1442325709999; Tue, 15 Sep 2015 07:01:49 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id wd1si9018906lbb.91.2015.09.15.07.01.49 for <patchwork-forward@linaro.org> (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Sep 2015 07:01:49 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by lamp12 with SMTP id p12so107012707lam.0 for <patchwork-forward@linaro.org>; Tue, 15 Sep 2015 07:01:49 -0700 (PDT) X-Received: by 10.112.135.9 with SMTP id po9mr16415804lbb.56.1442325709598; Tue, 15 Sep 2015 07:01:49 -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.59.35 with SMTP id w3csp1823158lbq; Tue, 15 Sep 2015 07:01:48 -0700 (PDT) X-Received: by 10.107.166.139 with SMTP id p133mr34471042ioe.113.1442325698761; Tue, 15 Sep 2015 07:01:38 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id z6si12236334ign.61.2015.09.15.07.01.37; Tue, 15 Sep 2015 07:01:38 -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 336D461B2E; Tue, 15 Sep 2015 14:01:37 +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=-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 [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 4DA0F61200; Tue, 15 Sep 2015 13:57:35 +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 4875A62CE5; Tue, 15 Sep 2015 13:57:32 +0000 (UTC) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0145.outbound.protection.outlook.com [157.56.111.145]) by lists.linaro.org (Postfix) with ESMTPS id 29E5B619B3 for <lng-odp@lists.linaro.org>; Tue, 15 Sep 2015 13:56:09 +0000 (UTC) Received: from DM2PR03CA0046.namprd03.prod.outlook.com (10.141.96.45) by BY2PR03MB489.namprd03.prod.outlook.com (10.141.142.14) with Microsoft SMTP Server (TLS) id 15.1.262.15; Tue, 15 Sep 2015 13:56:06 +0000 Received: from BN1BFFO11FD023.protection.gbl (2a01:111:f400:7c10::1:132) by DM2PR03CA0046.outlook.office365.com (2a01:111:e400:2428::45) with Microsoft SMTP Server (TLS) id 15.1.268.17 via Frontend Transport; Tue, 15 Sep 2015 13:56:06 +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 BN1BFFO11FD023.mail.protection.outlook.com (10.58.144.86) with Microsoft SMTP Server (TLS) id 15.1.262.18 via Frontend Transport; Tue, 15 Sep 2015 13:56:06 +0000 Received: from hongbo.ap.freescale.net (hongbo.ap.freescale.net [10.193.20.3]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t8FDtiXW031670; Tue, 15 Sep 2015 06:56:03 -0700 From: <hongbo.zhang@freescale.com> To: <lng-odp@lists.linaro.org> Date: Tue, 15 Sep 2015 21:55:32 +0800 Message-ID: <1442325342-13806-8-git-send-email-hongbo.zhang@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442325342-13806-1-git-send-email-hongbo.zhang@freescale.com> References: <1442325342-13806-1-git-send-email-hongbo.zhang@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD023; 1:xL5jtOO8l5h8SoWrKGEo/ik7Lrxuh4gwCsZQNz8HbN+9c5D+i+AGuMZf8zHmOZUwGyThrVO4LsLehCt0JLdGH3sqU2lR2UElj/9UbXXO1k8ndE9+O6BPkZH0Hu5/4fFLjxl2CrBf85F4WfBkxF69nQygoutzIhgOP/XzO4+mguft8tenmGjzmCrINo2NLeoAOo7nl8TloY4h18oBz1EbFY+yAkzwgQIoUOTExgsZBX5NLDZkCYdlCaUEjfh4RuCS0f5H65pyxsSsCNhEbTH3Y7sfjEF2kd+FhYi9rPA/dLPORweN+X9pjuaypq1liZykuqfA1SU0sntqpFUvqvzRFWGAk8qBK/58tj/7t+P2i9FinI09CLaeYXJvvLCzjsXV7Px6ihiVeraFaOR7E+nUrA== X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(19580395003)(106466001)(4001540100001)(64706001)(2950100001)(189998001)(81156007)(47776003)(92566002)(97736004)(5003940100001)(48376002)(36756003)(11100500001)(50466002)(105606002)(2351001)(229853001)(85426001)(76176999)(50986999)(50226001)(19580405001)(69596002)(77096005)(87936001)(62966003)(46102003)(68736005)(77156002)(33646002)(86152002)(110136002)(6806004)(5007970100001)(104016003)(86362001)(5001830100001)(5001860100001)(5001960100002)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR03MB489; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB489; 2:+yb+hCSq3k9WYQ+T9NWd8qfsJlE9vPMPnZDbQRq0ikSCkW8tS9f5RJcbRP9XL8ewwmPPhhfA/QH/vGllKQvDzH7BKW3uoo/HpMqSJyjwgLgPJlKygUxNhzaWOHWF7TpWA8miq67TsVj9Rsavw8k+yeW3Uy2StPRL3pPx7NmWPMQ=; 3:DSNJfHhQLTEx2Tx75N0NGdpPcrdde6tRq1AdcHL37HdufOBX339qsqXes1uA1E+q7BtIrptqmI3AgQh+lmbhSrjV7cHdwhvCSq5vm3qrCO5Js/uwYAHIyld0d5cqWspcOkCZxOC5rH0BAnWNcbhVrWEXGjQN4mxYqrfQ8ULFCC/MoJ5ZJVFBXjNb/EqwiU7hfljQZW15m806M5RP5A6D8kF2qUZpi5h4epDc0OA1xFw=; 25:zzZPPcJUIalS/r7cZxbcTVS4kuChVwhxpSyiO3JhOAQXoivkyYSzldMcYX2VjLmzVxTrsU2h0UPJw3A66OQ5XT8l2qtSXm8RBei5BfnIpfQN5iM59MI4LrYaBtgJQ4L+mt9w8f9zv60EgDAuGLPn9dCHwE88FC5vYcIPHUYcGMe+d11w7NTvMRY1wO8nLW/ZdlEDLelTsE4CpbhmmGTpGaKy/TP7NcnL2pkJgQGFLxhFArsSE1mfzmhc97/SBUw4lyf9F5WTHxkOn44XbSOktg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB489; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB489; 20:5jvXEk301ciJI9nDXDSkOTfnrHLer7y063ZETEu7f1lFGMTpAFj7akDIoE1W+VJsDXxQ5dUAnb2QUT5JNquQzpAuBFGkYoBLgjWPQP3n/pMYIzgyGOMh5+O8MNWVu5GoeS2D6ynU+neZDaHghoVc8LSjnGZrV9Bdk3bCHYzSzRSQg+UYIf6JTw38e62j2EybBpbJ3x6uAPHeUBMX9EoBBUxrMpsAS8dDAF7VVvjPNjSvyUqJYL56rT0WDSlEjF5eusNiLrJogD+8sXAc+qmFFy68/pHkAa6gwenCFHa6bA8W+iGlBFhwNNILX/CF9J/nne2jqaCYmYLEFu7gBTNDDhFkR5ooFN/RxNwewdCG+MQ=; 4:YovLk77z4bzt69+uLdYuusG3uzVTJmJolYGhG9k8zQEHucHw4Q4UU1PgUoW+Wc2EHAbex7ZO9QPbUJk295dcQU/sh/VSeVhY4+aNvyeC+c44lrzRaXRXMsjqi3FXreqxoDbO9ylubKRFKNOgP+5fBeeq89A1jgTzdmY68GjmmcpgJGjRB5f36HfZ3ByLfCPaAtyF0oC1nsrstYji53wMkbT25Ng62hH8m2b9NVcxXoJTsekzbPC/t6cFF87VbvtYfD/TprwGZ/ldMBUwj1r8SID103l0GeRjVjMP7ZssjsndTisiIjFYhDnyB1//ZLSynC+6yYvAkPVtwKpFnLzOpEIVANL4boQxjq2rQHVg/oC5XdwloJz0+BfU4yf4vdF8 X-Microsoft-Antispam-PRVS: <BY2PR03MB489FCB9D56F38A980F1F4128E5C0@BY2PR03MB489.namprd03.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(520075)(8121501046)(520058)(5005006)(520078)(3002001); SRVR:BY2PR03MB489; BCL:0; PCL:0; RULEID:; SRVR:BY2PR03MB489; X-Forefront-PRVS: 070092A9D3 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR03MB489; 23:LR1iAAikOMhMz4/RNZ6JmxnKMLzT0eoRfoITlIHtsZ?= =?us-ascii?Q?OmNdm0TYqwThZqiWJnt4ElPDxqgriQaOJUi4E/LnKPn/LFcFAt/UKJaAGH7J?= =?us-ascii?Q?UGbVtkQaB2WHtycQfnuF9suuPJpffdKpFGLG+WyRUVSaet30a7Xmuz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YtOx11RV4xPIlS7pNTonvOKPsFmKjx4e61LNgyp5iJ?= =?us-ascii?Q?QKljoH04vK55Sm+tf8Y8qFXFabhC99Fwio1Auxpvt2P8ubSzQ9zwdCRXiWPx?= =?us-ascii?Q?ixybmZPHd8U9LI6jgH3tk+uSilPadXOoN81/2SgJtf3ILkiOP/eRH51Y6HD6?= =?us-ascii?Q?Byi3paJiR3FQyDOgtv369NQEfvpwK4TUtHXcXWmZ6EHMA4kEkYp51wuCkQJN?= =?us-ascii?Q?UgRoJ5P6rYz8fReFeE74JsKwVZrd/gq+rqIL1V?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB489; 5:TuEQp6bZ9ypvVqqh5lDx37aA4GCTmLLaX+EawHYQKpMIhVAe72z4XFp+s498EuiA8P+OPAddp/zcc8XumpPUNogmqoKSpnd8Y5AgCcKnD6QNPAzZJRkczJlCrdwmFrJSvVYM32uizSeoQSDtacKrqg==; 24:+P1OjVWbXzRs3myGx6Mm9/+4lsaQQSCBrLRGEBExVpM5BR6Qata3b1h5C9q1tj+U0Bt7wA7bGfwyelGn012XcRYZZur4vO6U2wlOSz4qZWo=; 20:Kd1TqHeUXkfl8qHtk16xrP1aDNZJjdXkadWQnkAo0gbBv3IZTTGjC+f02+Asm8yAK8U2BjK7l2rT6jTG7Rzx3Q== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2015 13:56:06.2199 (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: BY2PR03MB489 X-Topics: patch Cc: petri.savolainen@nokia.com, stuart.haslam@arm.com Subject: [lng-odp] [API NEXT PATCH v5 07/17] api: sysinfo: add new API to get per-CPU max frequency X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: <patchwork-forward.linaro.org> List-Unsubscribe: <mailto:googlegroups-manage+836684582541+unsubscribe@googlegroups.com>, <http://groups.google.com/a/linaro.org/group/patchwork-forward/subscribe> List-Archive: <http://groups.google.com/a/linaro.org/group/patchwork-forward/> List-Post: <http://groups.google.com/a/linaro.org/group/patchwork-forward/post>, <mailto:patchwork-forward@linaro.org> List-Help: <http://support.google.com/a/linaro.org/bin/topic.py?topic=25838>, <mailto:patchwork-forward+help@linaro.org> List-Subscribe: <https://lists.linaro.org/mailman/listinfo/lng-odp>, <mailto:lng-odp-request@lists.linaro.org?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" <lng-odp-bounces@lists.linaro.org> 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.215.50 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 |
diff --git a/include/odp/api/cpu.h b/include/odp/api/cpu.h index 93d3e7f..4ec59b4 100644 --- a/include/odp/api/cpu.h +++ b/include/odp/api/cpu.h @@ -82,6 +82,17 @@ uint64_t odp_cpu_hz(void); uint64_t odp_cpu_hz_max(void); /** + * Maximum CPU frequency of a CPU (in Hz) + * + * Returns maximum frequency of specified CPU + * + * @param id CPU ID + * + * @return CPU frequency in Hz + */ +uint64_t odp_cpu_hz_max_id(int id); + +/** * @} */ diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c index 43bfcc0..8532fa0 100644 --- a/platform/linux-generic/odp_system_info.c +++ b/platform/linux-generic/odp_system_info.c @@ -373,7 +373,15 @@ uint64_t odp_cpu_hz(void) uint64_t odp_cpu_hz_max(void) { - return odp_global_data.system_info.cpu_hz[0]; + return odp_cpu_hz_max_id(0); +} + +uint64_t odp_cpu_hz_max_id(int id) +{ + if (id >= 0 && id < MAX_CPU_NUMBER) + return odp_global_data.system_info.cpu_hz[id]; + else + return -1; } uint64_t odp_sys_huge_page_size(void)