From patchwork Thu Sep 17 13:10:06 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: 53808 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by patches.linaro.org (Postfix) with ESMTPS id 6148C22E57 for ; Thu, 17 Sep 2015 13:33:21 +0000 (UTC) Received: by lamf6 with SMTP id f6sf7270378lam.1 for ; Thu, 17 Sep 2015 06:33:20 -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=hO/s/1l5Pj7+Nlorakp7LSL4j2cvtAv7lMH6DhPnqHGxLoC/ZAExe8ojIUgjZ4iCMd 9wNdmvrEDtf7Z4X55IKXVo+5uZZKsnA/Nscvj6MtbaB9KcB2qDIEum5znkwGUf7Ky606 8yEjrXGd3poyrIZpzwyivIjCJIWY/omBAeQlAf10aJ9VIgaAC3oG40uQaq3h4QBjyTlB npxNNqaeiGxl0tsqh9weLpR201euDz7R3oa46jo2mQj+Ik47XNFCmKD1AZW+mYyeruaD syGnVCoBAEutFRthxfs7sMLSlXxj1FwB59Yt5+8Dvdpr/ErNEopwlCXvAKlg/y2jQQc+ olQw== X-Gm-Message-State: ALoCoQn3A+JRDkb2ofU+0HpX4D7v8a7j+xQttI8ClhIDPDiRaDsQTgBKiTBNx7LnZg7/9NQfhOhG X-Received: by 10.194.93.198 with SMTP id cw6mr3327193wjb.3.1442496800285; Thu, 17 Sep 2015 06:33:20 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.219.35 with SMTP id pl3ls80005lac.16.gmail; Thu, 17 Sep 2015 06:33:20 -0700 (PDT) X-Received: by 10.112.63.67 with SMTP id e3mr18686324lbs.92.1442496800134; Thu, 17 Sep 2015 06:33:20 -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 n10si2167212lbp.73.2015.09.17.06.33.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2015 06:33:19 -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 lanb10 with SMTP id b10so11191718lan.3 for ; Thu, 17 Sep 2015 06:33:19 -0700 (PDT) X-Received: by 10.112.51.142 with SMTP id k14mr33944514lbo.76.1442496799852; Thu, 17 Sep 2015 06:33:19 -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 w3csp3074598lbq; Thu, 17 Sep 2015 06:33:18 -0700 (PDT) X-Received: by 10.55.19.201 with SMTP id 70mr49506835qkt.103.1442496798814; Thu, 17 Sep 2015 06:33:18 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id j3si2594911qge.93.2015.09.17.06.33.18; Thu, 17 Sep 2015 06:33:18 -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 34BD361AF3; Thu, 17 Sep 2015 13:33:18 +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 8B67562D7C; Thu, 17 Sep 2015 13:26:13 +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 8DCBC62D58; Thu, 17 Sep 2015 13:26:00 +0000 (UTC) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0112.outbound.protection.outlook.com [157.56.110.112]) by lists.linaro.org (Postfix) with ESMTPS id EB87662D5D for ; Thu, 17 Sep 2015 13:24:46 +0000 (UTC) Received: from BN3PR0301MB1266.namprd03.prod.outlook.com (10.161.209.146) by BN3PR0301MB0849.namprd03.prod.outlook.com (10.160.154.147) with Microsoft SMTP Server (TLS) id 15.1.268.17; Thu, 17 Sep 2015 13:24:46 +0000 Received: from DM2PR03CA0027.namprd03.prod.outlook.com (10.141.96.26) by BN3PR0301MB1266.namprd03.prod.outlook.com (10.161.209.146) with Microsoft SMTP Server (TLS) id 15.1.268.17; Thu, 17 Sep 2015 13:24:45 +0000 Received: from BY2FFO11OLC011.protection.gbl (2a01:111:f400:7c0c::133) by DM2PR03CA0027.outlook.office365.com (2a01:111:e400:2428::26) with Microsoft SMTP Server (TLS) id 15.1.274.16 via Frontend Transport; Thu, 17 Sep 2015 13:24:44 +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 BY2FFO11OLC011.mail.protection.outlook.com (10.1.15.22) with Microsoft SMTP Server (TLS) id 15.1.274.4 via Frontend Transport; Thu, 17 Sep 2015 13:24:43 +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 t8HDOGbm005200; Thu, 17 Sep 2015 06:24:41 -0700 From: To: Date: Thu, 17 Sep 2015 21:10:06 +0800 Message-ID: <1442495411-12362-10-git-send-email-hongbo.zhang@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442495411-12362-1-git-send-email-hongbo.zhang@freescale.com> References: <1442495411-12362-1-git-send-email-hongbo.zhang@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC011; 1:9exlOSKJ8MSwuehvFAa2FIhAsGyMK5qcGGCzN6uFVtogX1Zd9h+CF+KCsgOdq7+J4QcblaViW622mBOxOHi5eXiqmPL9VJigwj49BPMjRMz9oFwhWsIfyplETAm3wrThEg79LS9GULzod2LQJIYyVeBFhK8eHIvOcKMXQrRcpqfta/D8EpjePlKXpYdENY8gk084WXhB39nXakaGmZcOGFIqVM7SN8sOMs2z/hPmfQqpmNde/amqPU6fxxeMwEEoFJbpvQqSoXm0BJylp56j2JISgW3645dyteyUAVbP/7JUtmmFj6ePad21BmwnMRipDARIQeIE3ppNq9CGqFsuV7XyJAh9mq+4v93ZV1pAK8qlo7SixMKT3+1PoJhvGKW06gsYm0x5e+Ut4EW6SgEWig== 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)(105606002)(48376002)(2351001)(6806004)(229853001)(19580395003)(5001860100001)(76176999)(92566002)(5007970100001)(50466002)(106466001)(104016003)(33646002)(5001830100001)(36756003)(50986999)(110136002)(19580405001)(77096005)(50226001)(85426001)(86362001)(77156002)(64706001)(46102003)(189998001)(69596002)(5003940100001)(87936001)(68736005)(47776003)(81156007)(2950100001)(97736004)(4001540100001)(5001960100002)(86152002)(62966003)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:BN3PR0301MB1266; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BN3PR0301MB1266; 2:TX//51mCqQLWkrRn8DNb0DdUu3OzwroiW81b9MtmC3uZZFA7PP6LCHW8IPoM0oem0vHQddu57lDzpLx6vM33WCH4twikstter52Ksq5Y81ZoBB9/MsVhhKzGA7bwBFVTdiIQEK1EBaiKtIRCwvt9arkV6oHVO5MASOhrd+uVoVs=; 3:kZXTgKl2EUGsfkS6i4Q+pP9drbZ4bouVCpg+kTc894piMcc0nIDXgLjctSTzQcLpgJr+pBleYLtn7yHxB80cqFbVOqP2CW8hXXGDzOQQ2bVA8hDm+D0YqJKRwQh+DsfMyj30xE+r6xOY0PxiHEdz5qUueOBsdeLF0iBAL+ALpLLz6A+Vout7gK7eebx+dJ0qEXHXejBVzqNP8GLEBsVl8LItjpjWO+7Mi2Y9DU7l+44=; 25:GLR1KJk3iwVQurP2Uo74VJ0P4Jth+aSz+sPa9FZnZiBDOwnQKpf1ohE/gyZbFNmbR0bJlv9OWB0/lkF55Xrf680xQF1dgmZToqeEkB7eAuPyIGHjFaTNDf8gxiDRfDx6BLvO9i3Vvx3PRin8MeqlBQhSSiDCf+KovhuYgzfpLy0c5yNy5u9eOmyWd8AnvoL/VRR4uNfs2CpidxxcymbrNx6995IBRE1Z+s7uqYXhMYIK3XHEwJcahWsfWX1eU1bUXE3Zmpri0/kxSV0TXF2gUg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0301MB1266; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0301MB1266; 20:bIakBzBXU+malysDJnnkoCylh+ABuc1O17mAkJjj/evq3+pFXu6Go8St40dBnMfEB2AfpgIotmFKhUPkLTWC8AKHR+/mEQ95/Bll5yluvgo5Dr2JoWHKlvQ25/kjsikPufw5HcBQl5KaJcKKtDkdlQm7Bsung3xN6nNubkOfkwksbSFdIWGXh3a0RIcRvbPTHna8KzTZbXLLZ4k+1KOeB89xuKObkZinZqO2mbqAJrSAeS00W1iSebCG4J1/FwqqoGlUnhoZG/hTtsNu1gW3Nn49ZwY8yYuTyofy2ybWz45Ngt8Xog6g5GyF1d2ScTyJWC4hfzQPpiZiobbpLLF273LuLHDCKA6/8aQrpHM9xRY=; 4:OKJ0hvYed/GZc9Q2qQZbhtj/mgF5TBzpqJslwAMalqFjiW6PtmS/1YvVSFtWhg9Z5PiOu+AwABd2a7kSv0A6Y7Egw2kwy79oUGK86frB02pd1ZRGX+lNKOPomaXKZkk1Tg4zFe9lIBTh60CI1KYx+8xbXXLhfzSqIZub1PRVH0EHQtqiv923T8wt3Pg+7j8ZjcjDNDPQLc5Fxl2NZ3bIL6Gd/FmAiA1gZpeJInPB5Bn+hwkmp9q5rc6FTOlK6ViL09RFyr9JbfN0qJl7um+t40sJYywVTspFChseV9S+nCIG3l4Q5JgBtWx2gPpUtlFfzaMO1ALHOxAC7x0SFpFOwQlK69Fd2cXMxRirGMVQ3Zc= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(8121501046)(520078)(520075)(3002001); SRVR:BN3PR0301MB1266; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0301MB1266; X-Forefront-PRVS: 07025866F6 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0301MB1266; 23:/2Mva6YyCFIix9SS74UvZT53Ew4bt3+g2Ft5Rjl?= =?us-ascii?Q?1zhBKCelCh2CP130z/7Huod+RRUCVrCD4iYwesPefnSC/nnEEgMIWskuz8up?= =?us-ascii?Q?o3AvYGJes5jpw5uikwFd+BL1stoeAWT4iZIFOwYY7jEjZqiCDV9yzYj2na1f?= =?us-ascii?Q?F61cPfiw5q/+rWhM1USjiFu2ly4E+XS/F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3G183Ys4Gm9vmn4SmXnsZsuh9eZVkJLGDUr3CENahp7qA+FtbmZl?= =?us-ascii?Q?Q0SWHO60lWP2IkFwfBtBBUAc18uak8yf8A+IDlrggp4yzO3DnB7oNM6ktAvL?= =?us-ascii?Q?5B9nCMAKn9EIW6CCc6IbseEdZa8eOGj0XZQ7fvYVr/lR9AjnUGoUxOAnm9OZ?= =?us-ascii?Q?KgdkE7bY4w9B6OWhc4x0=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0301MB1266; 5:hVvhrG4nCgVy9EObI2x1G6KM1Ggzcvdc1gy6Rd2Exsly52XAu+0hXRzNsOgiyXhYE81q9hi+AZ5Fw3dNcd5C71xNwRNfojncoe1Azuzlv9GPvK+0Rz69UF915y/GiaB0LdbmePq6t9HC9jSPk4Vpsg==; 24:6HH8TNul2YStBSf1vJWLAznclif1LlPO3cZvpYuOP+I4oYt76hzGhD0yMC6BQTPBMYgneAVVUgMhgLJOJhSthmR77hBKCEfTKNQSwbxjBmw=; 20:D4ggeVpc1WnpyOlIA+ouS0zVcFzHTPogu/kiRcCTWgch7sO5/UJS73ZNwrqnHHddtAAPgmsdT/K2fmCElx1m9Q== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2015 13:24:43.7521 (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: BN3PR0301MB1266 X-Microsoft-Exchange-Diagnostics: 1; BN3PR0301MB0849; 2:IeIwrAiH3vv3g8dVZBFDIFUaP/EF86CZKq+29MgHUDFOO8cy2t2ZT/tVNNvAMHoOeldsywmh8z8TKcDnM5j0RYKZAvjmzLP5z07QSQVU9Caby60RwqWJusqODDFx4IeFttfypLNCdiZPBzrCb2EzJY+uP+/zo1eO10Rhv2hkKsc=; 23:qeoIhur8wx8Y9QEBCcWVVTPANJtiBSyGNM11OOiwJ/0r18T3p/puLIIUQwEN/f5AYaBSZHztFhn6gqWZrLms45++GjgEzCGxaNUJJZy53Qa3WHK/b0Xe5WFYbqBuP7+XIe+L+UEXZcxxmzzsbiAjBtm9kY6NP9w7qH34yVdehCGUNHU+ciAjrIEhdBKixR83 X-OriginatorOrg: freescale.com X-Topics: patch Cc: petri.savolainen@nokia.com, stuart.haslam@arm.com Subject: [lng-odp] [API NEXT PATCH v6 09/14] api: cpu: 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.46 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);