Message ID | 1436438768-4258-7-git-send-email-hongbo.zhang@freescale.com |
---|---|
State | New |
Headers | show
Return-Path: <patchwork-forward+bncBDPILVOKSELBBKVD7GWAKGQE3DJCPFI@linaro.org> 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 45528228E5 for <linaro@patches.linaro.org>; Thu, 9 Jul 2015 10:49:15 +0000 (UTC) Received: by wgjx7 with SMTP id x7sf77694624wgj.3 for <linaro@patches.linaro.org>; Thu, 09 Jul 2015 03:49:14 -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=dASnD++bFUzFnmnn27n1RtlZ/6/CBMPtLmj8egmN1xY=; b=XEm0l1vkjqUS4Y5YpKT9VBKjOBUOM8M4nq5a2egPFMZrYE6m6jd9OS8z0roU35Xh0b SLc9ZwjE5r9t+voUfHob61GBGxWNCecDqTRzBgDGNOZGCLfKl4bXL+jW2ZJnW9uLT56E qi8LhYt8oFq7y+2VmIjLo4ePtJCg1zk3h5q3ymQyCRDBIe2N0YS29JJJa2CFndFFMa27 KBr1K3tFILbzIdVKGawg14juYIazcH9u5P+ChIbwXodnWPhB4K/8H/iWXi1cavas49NL EgCeYe+5A00IH5UW9EostJcNbqlxOXY2eOjq6GsiliaejOdtQBQ1HXmfpSEw65et/vjl DDbQ== X-Gm-Message-State: ALoCoQk+GqzhF4w2d53jHDdNCP1ZMMgfU4cKctd7UqVDTs4TgGIdhvgq8+5vdeTpySGuCB+eyreA X-Received: by 10.112.85.69 with SMTP id f5mr7659663lbz.23.1436438954608; Thu, 09 Jul 2015 03:49:14 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.200 with SMTP id u8ls5507lau.55.gmail; Thu, 09 Jul 2015 03:49:14 -0700 (PDT) X-Received: by 10.152.219.3 with SMTP id pk3mr14151265lac.114.1436438954488; Thu, 09 Jul 2015 03:49:14 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id yo1si4441394lbb.167.2015.07.09.03.49.14 for <patchwork-forward@linaro.org> (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2015 03:49:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by laar3 with SMTP id r3so244092125laa.0 for <patchwork-forward@linaro.org>; Thu, 09 Jul 2015 03:49:14 -0700 (PDT) X-Received: by 10.112.55.207 with SMTP id u15mr14070797lbp.88.1436438954341; Thu, 09 Jul 2015 03:49:14 -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 hn6csp577551lbb; Thu, 9 Jul 2015 03:49:13 -0700 (PDT) X-Received: by 10.140.231.19 with SMTP id b19mr23629063qhc.22.1436438953070; Thu, 09 Jul 2015 03:49:13 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 9si6100090qhf.117.2015.07.09.03.49.11; Thu, 09 Jul 2015 03:49:13 -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 D072F61FBB; Thu, 9 Jul 2015 10:49:11 +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 9DC1B61FC3; Thu, 9 Jul 2015 10:47:06 +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 BE55E61F8B; Thu, 9 Jul 2015 10:46:53 +0000 (UTC) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0113.outbound.protection.outlook.com [157.56.111.113]) by lists.linaro.org (Postfix) with ESMTPS id 3D4A261FBD for <lng-odp@lists.linaro.org>; Thu, 9 Jul 2015 10:46:23 +0000 (UTC) Received: from BN3PR0301CA0084.namprd03.prod.outlook.com (10.160.152.180) by BLUPR03MB601.namprd03.prod.outlook.com (10.255.124.38) with Microsoft SMTP Server (TLS) id 15.1.207.19; Thu, 9 Jul 2015 10:46:21 +0000 Received: from BN1AFFO11FD049.protection.gbl (2a01:111:f400:7c10::110) by BN3PR0301CA0084.outlook.office365.com (2a01:111:e400:401e::52) with Microsoft SMTP Server (TLS) id 15.1.213.14 via Frontend Transport; Thu, 9 Jul 2015 10:46:22 +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 BN1AFFO11FD049.mail.protection.outlook.com (10.58.53.64) with Microsoft SMTP Server (TLS) id 15.1.190.9 via Frontend Transport; Thu, 9 Jul 2015 10:46:21 +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 t69AkBfh022771; Thu, 9 Jul 2015 03:46:20 -0700 From: <hongbo.zhang@freescale.com> To: <lng-odp@lists.linaro.org> Date: Thu, 9 Jul 2015 18:46:06 +0800 Message-ID: <1436438768-4258-7-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; BN1AFFO11FD049; 1:iIayLKSkymfGUvkVzAuEKkH7DrdOsfSGn80Gpqh91KzHGimlcolXIcjxhTCbv+Gk68cfxFkz8yPJgFNhdHUfARk84DvtXqSNpDp4lYWwlPXA6Vzt5Iy8X9dpkFPcvicMMbLbv/r3pslcCOLlneEJMmAbNEQmZyHiQ4Q6ncdYADXlF3XlyhRo3RL/VaX8Xy9fqh9m7Tdyt16XVdiNcqRhVaFi8sacvdevapgWsC1YRB/BUlYk0wJFNMLXA2V0OI9Bdiv7SLnEU/+RuFViZzoW890f3Jet4tjUpYpkpMHmjAGw0qL4ImnbkidESJL/Q4n/ X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(339900001)(199003)(189002)(86152002)(19580395003)(19580405001)(86362001)(50226001)(6806004)(85426001)(87936001)(77156002)(77096005)(2950100001)(92566002)(62966003)(105606002)(46102003)(50986999)(76176999)(110136002)(5001960100002)(189998001)(50466002)(47776003)(48376002)(229853001)(2351001)(104016003)(106466001)(33646002)(36756003)(5003940100001)(41533002)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR03MB601; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:sfv; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB601; 2:WyCtzcB4ks+u7UvceRUFbKIdNbL4D2Fheiv0tGpJjVjV0bgEGdr36GBMwEeyaitG; 3:57+kLqPRYuuNggQhTzbOsl0nJG+JF9T4DGnH3+i9LFhO41uwh8DTsQtzoRujECJ3oCTJnpL1+7PI1LulvKM7BbaO748SjDfUJPcm4/tH6u2CiO809SkLJ2zw3BihjVITPsfOakwVqStQ/Mwtp2hagXkmJkOG611w/Cjo+2v0yACDSrL21M7cRdGKLNZvSPhKhl8iDWhMbLlbubw8iQDrCDgVLHhMgZ8jV3fDphY7qGA=; 25:DIp6nZRtkl2e3qrFuoeU+F6pIqvOqIxO5CDEQm1h+OsKRtS6GqrDfqnunZaksy150TGnd4lhNMbf023idCE9qjRFOVWv8i3itHIKMk63ARa5Tpr8CTbVtu1rqj+d8ciwQP3LpNMVv08rO7h8SkuhmqjNHC3I6SnJhUYhKcT5RQOYdl2i0EFobC88HhD3sJmSzDo4ODclR5JSCpULkSxm+FqnqHZbr0E3DXWnNuWBdPMgi6FKIHiNCsQEel0TpnYOjR4GbLy9u2qQAAfDxlQTjg==; 20:F8nKTVFCJLn6BYE+w+pIlgqT29r1vstC1fhC6XFXXq2IK0kTIWRxTbsS8itCYpxjvbBa0dN3Sag1IxbcfIIAHOD/GtsVCmdiyLVYoPxLAxQqM1fzjMkas5LSN3Zosr8kFQ4QgouQxnJUsydseIvbfQFg4xVEFYeTucMWxNZRVx+/3lHeOp/0zVI+0Y9j9FtFytTSYk6TzGgBLhaxLP3zb3MUsig59yPOQ6Lgai6OliLJg4mhCv+e0DaTAJug5jKgNwVqlzhBAZMTy1vFVCVoUcJUXavC9Z2ShQf5KKppZ+l9Oby4uyN9lX/rtHPbRPOkYusAzGQgop9y29rAOGZlPsBbxU1xdRS9IfzLdYP2TLo= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB601; X-Microsoft-Antispam-PRVS: <BLUPR03MB6015265D820CDF20DBAEF028E900@BLUPR03MB601.namprd03.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BLUPR03MB601; BCL:0; PCL:0; RULEID:; SRVR:BLUPR03MB601; X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB601; 4:k6r1izJXNk0q+QFzU3z6xif194uPLKgI2cCF0VyWkESylPa9MWVmoY5C+PgHftVPQyx3nmc29KtKxCKUM1BxsdRrIGQ8yEDkGvCb69JzhYUQ0cbIQuznrkhE5+LioVT39pG9nAKtedfF9I/kcpntUfvFIs20WII8OdhTOKglZiHScwbBiLxJxiRPCqGJRYSKppT+uB3daudlsQDsWN8T9L1I0PfTVG//Oi2BaQtztyUkDg++jQauY6c1tnukgnI48sOymEgs3AzNhnhRHWa+m6al6CdetfXImWZnteAo/1A= X-Forefront-PRVS: 0632519F33 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR03MB601; 23:RaL1whyKE5+NiHZuVmDu3SkyiupDQ6h2aTRAZ6Vyh6?= =?us-ascii?Q?Foj8kNB1CAGnR0+JiiLX69w+dgH+foQxpYTO4yrcPnUjlPOtorOScTMsuWRP?= =?us-ascii?Q?ouZ6DLE1ymny/JvIJv03GCL9hGAx1ilkcutdJxjOw+L74Wg7PVlIT1Dl4BgZ?= =?us-ascii?Q?te+UjtYHM+4NXHW8wHSIZ5HdKSlkqg5FHG0WfANk2VhNSNtonNZ12xkSvpWI?= =?us-ascii?Q?OSHUaWAmIEec73pd3FUrf2B7G71UBMD6CS75CuJO5dQjdp7eDM/fRhH4y2fw?= =?us-ascii?Q?SjymfMOao+yhgg06T5E7JoPhzAv3NjPohPKkipex1OTn3OayRPV63mT/jzC4?= =?us-ascii?Q?3oz+T8NIf6BwIedv+EWEjjHbUqFc4r8+mLYZ+wytlg64L3DBVrHS0PBLaJuY?= =?us-ascii?Q?pvRiS5tes46MwbP3Dd3vCd5b+/wnJ2HHAwNOsAiLAhysuaA/r6ojGWKMl1Y5?= =?us-ascii?Q?ZzhZD8481//0ubH2+u8zAI5yff+QhCiTI1iwVVf3InIQwsmYDl+kkDnmPVmx?= =?us-ascii?Q?tkILlwWXt/tMZ5ijaZYXTDCqK5y1L5qjtiGaM3p60CukI2nTzAWm+eLSnHsl?= =?us-ascii?Q?/R0Isv2OgoSRjUB0iRR8E1vshyEHEQ2fVR7m/9PHItAiUZdhPo0tJJ2ZP+1H?= =?us-ascii?Q?tInz2lu0gXiiv+hA+MCJvVXtDlTg9rHdr7EP2ETSnxv1CQnPADqpQAihvNdA?= =?us-ascii?Q?uyRm9ILcPEDs3ma6ubPDAkuApXqm2AzpLP3+aTMhNethmEg3yDt8gfHH7fHx?= =?us-ascii?Q?JHGq5wgMkDxvNhlhMFXfte2zpfJkx3a7qHqAoDoYfLFcHXoizw2Figw77DHd?= =?us-ascii?Q?CWakbuXegtoxYY6nxSKGGFOLK74w/pFgzwwVMzQQ2T/tCN3n7nvdQdV3ykC5?= =?us-ascii?Q?vntoDvG7Vf+hBP2WVNGrSxWnln6VH9/Utrr10RAsFWnp2u3XqNsDvC7m0Qmc?= =?us-ascii?Q?qJ0mp05xI22cNn29msWWQ3uWq/TOY39EDEu/cAbw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB601; 5:H0HPY2LW3tGHODiu5z5E7ybtVtREmi22hNuLF/QqVDtJzwIFMGSE++YOud4akZmxk7ax+22XMOxGDWnZ5jSB3SbuhehvLIT3+Q98+TwQE+q7ubXWxQjVWp0ExQ9Ny5Hh+TpeFzqcLY4Omf+SpAlxgw==; 24:mF1rYPoB33Qes5V71Pahnh0TwK36J3V2a5cmovtl294IeYUGu3hSZ4/xxBkOyO8QKH2UdnunnmTMY7J8MHC6XVIGaOUzLSVrP18FgV5VXXQ=; 20:MtgqKLHma8ByV2CZFR23eUFqgHVMX9VPoyZw1G6BcxDzdr1K/w/Vh7onE8dUgo1D7ZS+UwIM51PX+CjG5YEz0A== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2015 10:46:21.9682 (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: BLUPR03MB601 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH v3 6/8] linux-generic: sysinfo: add new API to get max frequency for each CPU 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.46 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 |
diff --git a/include/odp/api/cpu.h b/include/odp/api/cpu.h index c2efe31..3ecef1f 100644 --- a/include/odp/api/cpu.h +++ b/include/odp/api/cpu.h @@ -53,6 +53,17 @@ int odp_cpu_count(void); uint64_t odp_cpu_hz_max(void); /** + * Maximum CPU frequency of a CPU (in Hz) + * + * Returns maximum frequency of the specified CPU + * + * @param id CPU ID + * + * @return CPU frequency in Hz + */ +uint64_t odp_cpu_id_hz_max(int id); + +/** * CPU model name * * @return Pointer to CPU model name string diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c index 2881695..00d009c 100644 --- a/platform/linux-generic/odp_system_info.c +++ b/platform/linux-generic/odp_system_info.c @@ -368,7 +368,15 @@ int odp_system_info_init(void) */ uint64_t odp_cpu_hz_max(void) { - return odp_global_data.system_info.cpu_hz[0]; + return odp_cpu_id_hz_max(0); +} + +uint64_t odp_cpu_id_hz_max(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)