From patchwork Tue Sep 15 13:55:34 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: 53663 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by patches.linaro.org (Postfix) with ESMTPS id C468422A0D for ; Tue, 15 Sep 2015 14:04:43 +0000 (UTC) Received: by wicmn1 with SMTP id mn1sf8647894wic.1 for ; Tue, 15 Sep 2015 07:04:43 -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=TiNV6cMEXWr4i5EyPmn1/SoAIEqFTQDeDQUEV9j7xT8=; b=lLaWDClGUCyNzKISOYOCkRWqNLoAZv5TvJO8xpXJO1reSilK6akvJRM+Jvyd/cgeJ5 o+Vl9y/To0U5ctwNTWCbH4FLzQ+lIRAb6UJ+ZOOF/bqpMxCqfLBbag2E4dImACOzVIVX hNyyHlub1NELLMQaNmnkREoj5y5dsNdcwdYQZ6jO+uOJI94oLtr13wLefNz+e2evVYwc 8WWXsZiapdtrdij0o630sgMXp98B4Bqcgy4D6V3N5LU3fOBk+bY68B4FEYb4dL9NjQuh vQF0MnpXe7mL/JWFGojOkws3kh80oPeJBCn9e+A2jDuZaRzbMeYvU8X9wn5itCEaCQWd dlZQ== X-Gm-Message-State: ALoCoQnyuj8MnSW4CrW1XGKsX7Pjx8QcYFaAdvqyIcyRvhoIhb6BYkrfnCj/YxdZYl/rbxLyyboz X-Received: by 10.112.63.165 with SMTP id h5mr4396130lbs.18.1442325883007; Tue, 15 Sep 2015 07:04:43 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.198.234 with SMTP id jf10ls804724lac.60.gmail; Tue, 15 Sep 2015 07:04:42 -0700 (PDT) X-Received: by 10.152.21.196 with SMTP id x4mr15960557lae.86.1442325882761; Tue, 15 Sep 2015 07:04:42 -0700 (PDT) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id pp10si13834944lbc.132.2015.09.15.07.04.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Sep 2015 07:04:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by lahg1 with SMTP id g1so78823867lah.1 for ; Tue, 15 Sep 2015 07:04:42 -0700 (PDT) X-Received: by 10.152.21.196 with SMTP id x4mr15960521lae.86.1442325882525; Tue, 15 Sep 2015 07:04:42 -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 w3csp1825213lbq; Tue, 15 Sep 2015 07:04:41 -0700 (PDT) X-Received: by 10.50.61.148 with SMTP id p20mr6140998igr.81.1442325881321; Tue, 15 Sep 2015 07:04:41 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id n2si12255754ige.66.2015.09.15.07.04.40; Tue, 15 Sep 2015 07:04:41 -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 AA42261D14; Tue, 15 Sep 2015 14:04:40 +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 4C23162C10; Tue, 15 Sep 2015 13:57:44 +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 1FABD619B3; Tue, 15 Sep 2015 13:57:36 +0000 (UTC) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0148.outbound.protection.outlook.com [157.56.110.148]) by lists.linaro.org (Postfix) with ESMTPS id D66A862C10 for ; Tue, 15 Sep 2015 13:56:16 +0000 (UTC) Received: from BY2PR03CA039.namprd03.prod.outlook.com (10.141.249.12) by CY1PR0301MB1274.namprd03.prod.outlook.com (10.161.214.22) with Microsoft SMTP Server (TLS) id 15.1.268.17; Tue, 15 Sep 2015 13:56:15 +0000 Received: from BN1BFFO11FD041.protection.gbl (2a01:111:f400:7c10::1:125) by BY2PR03CA039.outlook.office365.com (2a01:111:e400:2c5d::12) with Microsoft SMTP Server (TLS) id 15.1.268.17 via Frontend Transport; Tue, 15 Sep 2015 13:56:15 +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 BN1BFFO11FD041.mail.protection.outlook.com (10.58.144.104) with Microsoft SMTP Server (TLS) id 15.1.262.18 via Frontend Transport; Tue, 15 Sep 2015 13:56:14 +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 t8FDtiXY031670; Tue, 15 Sep 2015 06:56:08 -0700 From: To: Date: Tue, 15 Sep 2015 21:55:34 +0800 Message-ID: <1442325342-13806-10-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; BN1BFFO11FD041; 1:abILmFfJFyaMmUtNi4cXv78GzdHQGITiOTXb2mdhHh3B10xuBARNNLR/CgTO0O46dSK4gYVTI1g2kI31qkcaEWm5pXHZ7piKqQ1pBUXaBxzP7CavMrw4lR3h/t+c1dMbC68usI5S1tNNJyn8rMbZklnh7ZICkdhAmBDeKY7Xcof3RZCcPuvhX3126tJoVWp8AjVN58KU6qAjZBrn7lvvCpSSUlCt75OBkeo+1Dr/Bk2DU7apBE9o/Zpm32zhxoxuJaOBBR6gjaQVoQjkEzUN74JX2MAfzzHaOrPdxrAsQVO5jpHF3j5zLGPgiMd4txgHrRwctrLXtJNIdIhD3sB6Q3XtVi+5NxzR8amAr+kQdMkbjL25tgOfRua9IUC1dqd9IfvsVERDXIl8lJo3LN06BQ== X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(76176999)(229853001)(2351001)(50986999)(69596002)(50466002)(105606002)(106466001)(85426001)(46102003)(86362001)(86152002)(50226001)(87936001)(6806004)(19580395003)(19580405001)(48376002)(2950100001)(36756003)(92566002)(104016003)(33646002)(110136002)(5001960100002)(77156002)(62966003)(5003940100001)(68736005)(5001920100001)(189998001)(11100500001)(5007970100001)(77096005)(5001860100001)(81156007)(5001830100001)(4001540100001)(64706001)(97736004)(47776003)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR0301MB1274; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1274; 2:yDajGAF5gq8Jxv/TbLwbtBozSEgnQeOKZ1uQLwJYuiCjgI2X7/7bRxIO2v1P2FKDzVIlth6Mwrz8OCVbeavrhiZnyr/H7Hxy8xwNTyubSTVhCpc4ZXXmalr86cQtRpTBXCOYw0cYFd0UnIum6R4OCa7SQh/DOSggCQ92D8rs5tI=; 3:etGqPp60qnVhAHr6lYArE1WLHuoVuOuEN5nFFXPH6uGuemNuOruSIkaZS6llyioax/Jh46DWm6OhRMuvquMrMHTvDsjv9gZbVbQtYK/ciczT4hb7BeKbeBnjgwsp2ZaZSQSjZozuIxz9oFYbsNBr5vfaFdwRDAPA3KW3R3smb+N07SmLgv0cwO5GXUly49dXM2biCr5rKg1pLSmP58880W90AytogQ1SwA0eLMwGQVo=; 25:7mLtOY6OVWEBptKdpsHPRMm76P7Hwm7IdS/pCh5TzcoW9Xj68XW4K7FRs+cOPyiq1nsE5oAB1/WK3cjTGir7Q1ciCCyRUOJmVF6IYLL7TP8dARrxPTaEMu5ts16e6TS5jxsXuZw/ZgnUzbJL/ghTWa8Y+JycfljWDSI4fmrowrB0T3iPB/cTNxX1tICwR95Zz2NkCjBpF3963elppDD/Fd1vLU4MRNjso/MZxj+MhKLyksH28ejkb5Czmg6MMa2C1RP/NkRKXFsX6Gd24LUlLw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB1274; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1274; 20:1+81HPJPuB7bB6Mgdi1zk3Q0AGjZopryL3VtmJG6z7IbIO43Z6t/hM5vk+6DCOPwdDBPnByFkWX2I6eWqjNiQdYKhu0yqV5rqmqUZXZI60KrPePtezgNQos/6ppDhfYpv5tz+EIffcSt/UN6zJ9Qwhvo5o14GgBu8Ec0xijjf1jjfR56e45cGg6NIFsz3KpoDqQeaiflUFw0K815hjHNTKLVY58ig+avhOzb7LAz0j+rgdOM1RDTTnM+tLgMr5F2cgww234gjcDwPHM9uUQEiCU4PeVBPJmHrZKxwJAGwXtHNP+DbUZNpJoRctqVFyLOnjNSC6BFnlfW7J4xzpe+gjzXLfvX3pacjNLjUTk5Txw=; 4:APX4XpU/D8LEE0Aep2g+gQx0STokF1tzMq8f520z6QtVjc0OceMD1KruUHExlzns0iDCypIgUo6OitL7f+eoO9bEKtYIJQOtYREeIBo8y6rwbuS9fE3jGLgl6FZjckF9TGeBhRV4nLdFpEQfGjFKlNP1tXkvnfrezZj6KNDzUC6HC4F7pizJuDlPuD7AZnqw5hc8t4FFTuIh9/vgIzXoxFgrHhRy4G9pMWv5HnZzlUdwQOl4rGlgm/rnaLaEJ+guniXtVMPueyxBZj7FPWuklohjtRZAQHHGHKOAsdB92LsXokyvfbRvm50Tp0mIcdxhf2jJU9p82uaWUQtftDxUR7cyMVZ+aZt+x+wTvWR/jgHoJ5P5ZH/cafZ+H/YXm5qq X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(520075)(520078)(520058)(8121501046)(5005006)(3002001); SRVR:CY1PR0301MB1274; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0301MB1274; X-Forefront-PRVS: 070092A9D3 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB1274; 23:YTARr76sdJjNzbKs2PwC8rtr29zxuS4XKuYdKuZ?= =?us-ascii?Q?wOs38xRkz6+SYU/GbSCgShYT/9xTWbRfLSMfDw82/IUtlWlDRa+4UaRiVhwp?= =?us-ascii?Q?V554AJZwBnRFuPnjSJN/Obke9CRd/L924vEYbk60CvciGxRvpGgsn/UicXn9?= =?us-ascii?Q?9RYK2+2UFq9sfa/XkHdVFzbjuB2F0iOanyvuo8qf+SIc7gXQtC60CuOSd53v?= =?us-ascii?Q?qctzcaLUT4TLh2n69x4KNMQjg5WO5WnW9A6Xa/o01U3inwffZK9jze01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eArAlQHkrrYRgeUL5OW3xfIcOBQsh07Hu09Q6Z08ovx?= =?us-ascii?Q?ZWGoZ9mAi87mHGpIZHkQuM+NdddqPHkB2p9r0LVD3L3WxB/7PSIMbolaJsbG?= =?us-ascii?Q?P5sioGHL4iw1jQmX4M+ASOUK0TkAZuioo8EDvK05tPBQ5Mg8zgnLWgbuvoJW?= =?us-ascii?Q?yOnPf4AqpYRXQ0FTm/XqCM0I=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1274; 5:xDUlVnFIk0mRoW+Qzy0f2xWZ8af+jzVhdsQ7Jdj9ndItwCHWmHSzvCXgqroOH4kHTp5cA/LXVjHZkk6qX4zWOEC7LwZMg1Hw8hVPJwAk2cultOnT1mKbzLcIfUde4HxMq1vMbk87z46hmfN/dvgYPQ==; 24:NaoKHZoIPOqYmuo3nZsCRso7BNB0yrSwFDEU8bHsaNcww8fRG0rAz/EeakOOjGEM2DvLSznEyTichG5K160y0Ic1gzO6H+0SMDJ/1i5xzso=; 20:BSj6QLrFnVz23R14VD2fEpwXBLRcGNIi2yShhqySn3Zaa6Y/EUgxHl8m/7vtw0lvjeYNdizVmcQoah6rr1ASlQ== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2015 13:56:14.3404 (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: CY1PR0301MB1274 X-Topics: patch Cc: petri.savolainen@nokia.com, stuart.haslam@arm.com Subject: [lng-odp] [API NEXT PATCH v5 09/17] api: sysinfo: add new API to get per-CPU current frequency 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.215.48 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 odp_cpu_hz() is adapted to return the current frequency, this patch adds sibling version odp_cpu_hz_id() to return current frequency of CPU specified by parameter CPU ID. Signed-off-by: Hongbo Zhang --- include/odp/api/cpu.h | 11 +++++++++++ platform/linux-generic/odp_system_info.c | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/include/odp/api/cpu.h b/include/odp/api/cpu.h index 4ec59b4..89d7e42 100644 --- a/include/odp/api/cpu.h +++ b/include/odp/api/cpu.h @@ -73,6 +73,17 @@ const char *odp_cpu_model_str_id(int id); uint64_t odp_cpu_hz(void); /** + * Current CPU frequency of a CPU (in Hz) + * + * Returns current frequency of specified CPU + * + * @param id CPU ID + * + * @return CPU frequency in Hz + */ +uint64_t odp_cpu_hz_id(int id); + +/** * Maximum CPU frequency in Hz * * Returns maximum frequency of this CPU diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c index ed61d36..aa32801 100644 --- a/platform/linux-generic/odp_system_info.c +++ b/platform/linux-generic/odp_system_info.c @@ -425,6 +425,11 @@ uint64_t odp_cpu_hz(void) return arch_cpu_hz_current(id); } +uint64_t odp_cpu_hz_id(int id) +{ + return arch_cpu_hz_current(id); +} + uint64_t odp_cpu_hz_max(void) { return odp_cpu_hz_max_id(0);