From patchwork Thu Sep 17 13:10:01 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: 53802 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by patches.linaro.org (Postfix) with ESMTPS id 3FF7422E57 for ; Thu, 17 Sep 2015 13:27:22 +0000 (UTC) Received: by wicmn1 with SMTP id mn1sf7604842wic.1 for ; Thu, 17 Sep 2015 06:27:21 -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=C6CYxupsyPtk3vZ3f/ccLxyTXDaP1w9r285qmMNQX/E=; b=EYMyfUI9gcW+LgxvnUMcm28Jw2iTCh731bpXctjGwfP5YOMFwHpv3ZzHb+NMR3ykYy qTNaeAQCBr53Xz8qxUq9qC/XL2eYrEG1Wi+c+U/Aacm4gGWWe+vmzJwrFElzp4s9xPlp NrjNF6TjCJMFRjV5kwkyLdC3J6C8cyc1sf4TwBA57aXVL5KSvQVfs2Z7YKf7ezS1zhGc of8wa4UQYY8WdoViARaTtVdj+bY9MVV4yZ78af08374hJKLIE53bEPtZRooD1oSbAsfM vPft5IzL2/lKAzfhjUErVL8yLPhRGZJdQzwur3wRT2B6qk2XnmORzI+Li8kDMA+4ozut dp7Q== X-Gm-Message-State: ALoCoQkugyx+jDHVqs180XGBqgjG5+GVxRqxy+N7de1ubVmJMLpzjmdGFUuZk40tOPApVGMyabXB X-Received: by 10.180.105.98 with SMTP id gl2mr3124924wib.0.1442496441585; Thu, 17 Sep 2015 06:27:21 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.20.134 with SMTP id n6ls77410lae.104.gmail; Thu, 17 Sep 2015 06:27:21 -0700 (PDT) X-Received: by 10.152.179.40 with SMTP id dd8mr10731558lac.119.1442496441430; Thu, 17 Sep 2015 06:27:21 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id mu6si2147020lbc.88.2015.09.17.06.27.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2015 06:27:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by lahg1 with SMTP id g1so11278797lah.1 for ; Thu, 17 Sep 2015 06:27:21 -0700 (PDT) X-Received: by 10.112.168.66 with SMTP id zu2mr36199994lbb.29.1442496441281; Thu, 17 Sep 2015 06:27:21 -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 w3csp3071366lbq; Thu, 17 Sep 2015 06:27:20 -0700 (PDT) X-Received: by 10.140.234.212 with SMTP id f203mr47866308qhc.10.1442496439995; Thu, 17 Sep 2015 06:27:19 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id h78si2587642qhc.45.2015.09.17.06.27.19; Thu, 17 Sep 2015 06:27:19 -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 668F762D52; Thu, 17 Sep 2015 13:27:19 +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 302B562C25; Thu, 17 Sep 2015 13:25:15 +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 176D062D62; Thu, 17 Sep 2015 13:25:07 +0000 (UTC) Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0124.outbound.protection.outlook.com [207.46.100.124]) by lists.linaro.org (Postfix) with ESMTPS id 76AB962C25 for ; Thu, 17 Sep 2015 13:24:33 +0000 (UTC) Received: from BN3PR0301CA0047.namprd03.prod.outlook.com (10.160.152.143) by DM2PR0301MB1278.namprd03.prod.outlook.com (10.160.221.147) with Microsoft SMTP Server (TLS) id 15.1.262.15; Thu, 17 Sep 2015 13:24:32 +0000 Received: from BL2FFO11FD022.protection.gbl (2a01:111:f400:7c09::192) by BN3PR0301CA0047.outlook.office365.com (2a01:111:e400:401e::15) with Microsoft SMTP Server (TLS) id 15.1.274.16 via Frontend Transport; Thu, 17 Sep 2015 13:24:31 +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 BL2FFO11FD022.mail.protection.outlook.com (10.173.161.101) with Microsoft SMTP Server (TLS) id 15.1.274.4 via Frontend Transport; Thu, 17 Sep 2015 13:24:30 +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 t8HDOGbh005200; Thu, 17 Sep 2015 06:24:28 -0700 From: To: Date: Thu, 17 Sep 2015 21:10:01 +0800 Message-ID: <1442495411-12362-5-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; BL2FFO11FD022; 1:iaiJNEoalzc9shvslR2HWkVitE4DrW7vmjp3pP/nI5qc9R0xGj2TmZlvSmdQu+x8w6TWq5HL/O7fZ1czdqTe8MEhJ8F6HgaFN0p07v4BijQdetHw2Z4QKAJ4Qbmky/qJQ88BlRNIsTl7X663PF96vimNvvUo6bMkl7RIXLJcoPR3t0nYZh2SsVwe749jQ3oPehT8PapUVQ7SGzV7W2ep6d79vvbdTJ9+uszGNSXZmVsm0ky9Rk88qfjpEAtclqXoPJXErWQBTT5dNq2eZ2vsx1ZmHAF7iYgpEWxQjTrT3U5aoT7JwMV7JJ2OMut8iBnNVqLhkmxPuibkGq80ny/OZJAy2A7f+G5WKrEbAU7u/54xrlU5qfMUgE7UTm00svoMmXp75/th2OYJMsveYm5Rbw== X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(979002)(6009001)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(81156007)(76176999)(4001540100001)(5007970100001)(86152002)(47776003)(48376002)(69596002)(189998001)(5001860100001)(575784001)(64706001)(87936001)(5001830100001)(97736004)(36756003)(106466001)(46102003)(110136002)(5001960100002)(5003940100001)(33646002)(62966003)(19580405001)(104016003)(77156002)(92566002)(85426001)(105606002)(50466002)(77096005)(50986999)(50226001)(229853001)(6806004)(2351001)(19580395003)(2950100001)(68736005)(86362001)(217873001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR0301MB1278; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB1278; 2:jNN+g1Wmt88zBoY2h3mDKAZZxWN0crw/9nIvbTK+uTEVLI3c/lYotCE8vD9aZ5ApvUWw7WHwbl+XTA7SJpf3Ep5rt6GqeWUKCjRmyXru9swEDNErbYaQy2uI8PfWmVyN1tarPqUi9unSK+SipQWlUjixF/svTmZq4eb/P42o/p8=; 3:F8YEVzSBPoivd7BrdmUjf0htLsVbUO23HVQk28y6iciFv0UE+jfDq2apjkRIzkMmOr2AVLn7X8cFVP5CvxM8Su0kFRFtTVM6XzADS4pa4kvwRW1CV7rJ+STlQNDil3O1xCtkQ5H6hw3Dy+77WweDi+cAf970wieqKNPyW9dTXj5mM6iGC2o1m9Cl7PlGyIUpFlXQjNSlrkypcLPn/KMbsvhnDPmx/f6MxuFHmEsEBJI=; 25:I7gpHRj/uGpT1J9Z7n3RhPP2dYHnXNPJomTGT6ohFIeV3c+kIagcHL2TMUSsyxiFrUk5PPMP4mLEj6eFs2ARs+w7mi/qCLKQurUkeF2gb6Z502CLb25JxIGFgqVF0e5+rRtWue9V+bshTxC0dKAwlZbRUKEsmD8L7TGNo5UdMmLdAlENHVVmtTK2lka70BgoYDtRg2GsO9RzUmxIrnisIdU9RnNDx/YRwaDxgftjNnzcYf8fjtkSlhIn4ynSn15DuBYYBbhHn1gdpLr007PXSQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB1278; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB1278; 20:a3OMZzaoNYHPqRUAUqh6eco4N38AVYZ9j2TzPv8qu0vdKgxmxmfvlykKAA8ByTlWzHZHEAt44RRcnJtzueHokdKh60C1+8ENlv702FmMXZ/e0gLhpAtp5xx2+vYnNkVxDhwWniFMMn0uaTXPOGU9AhGsFk4pr8/hh5DiJbZ8fcEOmc+T9ybNqtOgd93IIcRToefqoJbb20MV3U2HvuNwHK4i64kJvZzLV4dKsz7hBKgfVhgKL0dsJsAiEirKvFgrP7KuG9ANJUtGJVqm5kGiFCaHl+2nB56jrH6L/Bp5+lWMoh4Rsn9QKfUp51GnjX/V9p0yPo5u5AWTRG+UfYQS4go0zsjfXgTMYS7b4ltGzDw=; 4:4qefKsHfrNfcmUH3vo+dQTnX3dkK8F00+T/cRspsCNjlZMEIPamGGdOevQ6soQ+Sfab/SIsYsPkAP6/8kGzxOzoe8kkrx+zuV94wDbC2IKbV989Vu6ohRKyV44VKZnAhej4KsHnpuYCMIbXxOqGOUZV+THGLM/aJlpDRhbQ1A1FCABczWIsPSEby0UQNnC+KE9ME1FW20xf8qcfxPQQvTel3WiKTidsFpow/k4SaaojyR5yi1G9rerTr37vIhTcMWrdfjcCaixoioFpW6X0+9CHREIi3XNIv48bjUk/eNr7h6YYURk+EGIOZYri2moXjlUGJ0PkNIxNivioYaaJZhZHhGzykco8F4frjdKGorD/SYsjoyUIIogVoYzKiSxqL X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(520058)(8121501046)(520078)(520075)(5005006)(3002001); SRVR:DM2PR0301MB1278; BCL:0; PCL:0; RULEID:; SRVR:DM2PR0301MB1278; X-Forefront-PRVS: 07025866F6 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB1278; 23:Aki08GSPpGV8KMu1hUNjljNj8XGQHx6hDJMlGM/?= =?us-ascii?Q?7ldjbQHkCNY2Q2Aq5Jk/FENZLvKSxlxu98Yh7AGonAf6kiej0aaKtqd3e8ji?= =?us-ascii?Q?Aaeml2s8BeUFlA11I2b9XT2C8KE3BfTXkvZ2KklXYuyHhC3uRQgc2f6wLoFf?= =?us-ascii?Q?ECX7/oUqDgMo46xlDvCw5K2VTkI8i2QTpBsaYZDwDUALBrBfxxEZt1mzIjcU?= =?us-ascii?Q?ixU21s/tDdGv/88860SInHYMPc+CKqHJ4yq8dK899YAWj3eKC73+7oWmf9z7?= =?us-ascii?Q?tf9MSx+sFSOyeOH2hSXBOsCTlE8WZJUAFLrb+GhJIrRGtOKrjWsX4yYXRr7Y?= =?us-ascii?Q?BSmvdIFpSVjqdg8jByadEkX7uaF+20g0ik++i5U1iRrqq4QLswnL4bpthZZ7?= =?us-ascii?Q?lunBwIp8v0bafUxOSRhWApw7W8ms5lZq6t5e3YlCUfQtabpMKBS9Z5snNcC4?= =?us-ascii?Q?auyWBRWFgCyqSk7hH1nXZM0resBl8WI7zE98iH8iYq33kWakcBzIVf3cveLX?= =?us-ascii?Q?CaUgToXGlCRMpnBA/dhZrefq9ofriugbRgLFgSa051zTyYLv/9B9GWlMNtmm?= =?us-ascii?Q?oQJAxDin6EFE9RcUjcJEipMDMlR/OOaX7d/GphfCRJHqBBjuyrSoLMZPxYvn?= =?us-ascii?Q?9dCzBHIcPiWprbBO+PnVpGRR7yGDdH0kUjYD5/O1RVxuJdsrGGSqbVnLOe7i?= =?us-ascii?Q?Cl16dNT9un/kiCnM52aUq2vmKigZpsgAfTGrhy9RPZT2VUSwqWvpW8gviZ6s?= =?us-ascii?Q?LoiSgB6cAm5ZjfaKKiHDFrepYnuEifixsG2ISuchWDVeXEPDG41IGtYotnR7?= =?us-ascii?Q?jSgX7tgrvcgGyPoUbiZ/t4RYr40TfANU4Ax7LB0jH70Nk1NzVtbE1y7Azzcx?= =?us-ascii?Q?8ErvDz0Ip2rtBHtLAtYVlmxigxk+/StGCrOKZd8fTd3fmzVHOKK3P4T4MBL5?= =?us-ascii?Q?2jbQFgY2Ga6wpuLIgDnsxotFbI+4cS0/37gGkgo9kn4YwxZXwkWhSLNlXWPl?= =?us-ascii?Q?+OJXw4NQKhUlnKyhmKVkxht6uOn5c11Ty8wneEAXHh0/jKyLOpGpnclFi+bM?= =?us-ascii?Q?EKYGY3KWE+tJz0EITYMoBtTfoHWrmVO/hW+ldXI33tLLVFUfMtYoiT3+lHnC?= =?us-ascii?Q?/NCAHRCQzWNow31KH4iQnMY6tbrQdOEwJPLb/pl4DNl8zRD1cunsv1ph4bXA?= =?us-ascii?Q?5+UcVkQsI1rYU+K/08PBOZMtpKdpxr88KqetQ6mtgOV1mK5eBXG7rHVvm3F6?= =?us-ascii?Q?0VhP6tjyb14vjs3YCU6AvngNRoEF9+3qA1pvxuyyfmUJGFT+1VQg4ckuqhMH?= =?us-ascii?Q?KGi9kYX4keza06fCQozFz7LpslcRk9b6k24jOkkUEGx3wlN+INVaXrTyq/lZ?= =?us-ascii?Q?b1mjiaQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB1278; 5:PWVWyCM5n7AAPW0N1ul508x9x8wLtyJOL7z5e8QIPKHJ5EAQobRJkkC5KKjVzGKWVhnd9mUiM7/5BpGY2uIJguLTG+MsDd4PI+0+Ei70UwYDHvI0MslU691niatxRMO5pV2Gxg//ZUqVbZ10z6E+1Q==; 24:sGfHIK4ppitwbB2gQ+aIrfjDscD0MD3wwRTTEnhlGelVoV1QemQyqnTZ2jGMyenAGhsz/a3lvK/x0gofCZeuhU5FWBgat+Lakv+rwz6QvkQ=; 20:9SvEYXXe80qby6MjgfA3A3PSx01VGW/arGruFqvCe+avDGyr+XIXt7bG4jlS/22UGO27hWx0Yp87EwLou5FmKA== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2015 13:24:30.9974 (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: DM2PR0301MB1278 X-Topics: patch Cc: petri.savolainen@nokia.com, stuart.haslam@arm.com Subject: [lng-odp] [API NEXT PATCH v6 04/14] api: sysinfo: move CPU Hz API to cpu.h 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.42 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 The legacy odp_sys_cpu_hz() is moved to cpu.h then accordingly renamed to odp_cpu_hz(), and all the calling functions are also updated. Signed-off-by: Hongbo Zhang --- example/classifier/odp_classifier.c | 2 +- example/generator/odp_generator.c | 2 +- example/ipsec/odp_ipsec.c | 2 +- example/packet/odp_pktio.c | 2 +- example/timer/odp_timer_test.c | 4 ++-- include/odp/api/cpu.h | 9 +++++++++ include/odp/api/system_info.h | 7 ------- platform/linux-generic/arch/linux/odp_time_cycles.c | 2 +- platform/linux-generic/odp_system_info.c | 2 +- platform/linux-generic/odp_time.c | 4 ++-- test/api_test/odp_common.c | 2 +- test/performance/odp_atomic.c | 2 +- test/performance/odp_l2fwd.c | 2 +- test/performance/odp_scheduling.c | 2 +- test/validation/system/system.c | 6 +++--- test/validation/system/system.h | 2 +- 16 files changed, 27 insertions(+), 25 deletions(-) diff --git a/example/classifier/odp_classifier.c b/example/classifier/odp_classifier.c index 021d4dc..8f3c37f 100644 --- a/example/classifier/odp_classifier.c +++ b/example/classifier/odp_classifier.c @@ -746,7 +746,7 @@ static void print_info(char *progname, appl_args_t *appl_args) "CPU count: %i\n" "\n", odp_version_api_str(), odp_cpu_model_str(), - odp_sys_cpu_hz(), odp_sys_cache_line_size(), + odp_cpu_hz(), odp_sys_cache_line_size(), odp_cpu_count()); printf("Running ODP appl: \"%s\"\n" diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 9f9511f..9dd7f3e 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -1063,7 +1063,7 @@ static void print_info(char *progname, appl_args_t *appl_args) "Cache line size: %i\n" "CPU count: %i\n" "\n", - odp_version_api_str(), odp_cpu_model_str(), odp_sys_cpu_hz(), + odp_version_api_str(), odp_cpu_model_str(), odp_cpu_hz(), odp_sys_cache_line_size(), odp_cpu_count()); printf("Running ODP appl: \"%s\"\n" diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index ee43c3f..5050d8e 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -1534,7 +1534,7 @@ static void print_info(char *progname, appl_args_t *appl_args) "Cache line size: %i\n" "CPU count: %i\n" "\n", - odp_version_api_str(), odp_cpu_model_str(), odp_sys_cpu_hz(), + odp_version_api_str(), odp_cpu_model_str(), odp_cpu_hz(), odp_sys_cache_line_size(), odp_cpu_count()); printf("Running ODP appl: \"%s\"\n" diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c index 92bb243..c48364b 100644 --- a/example/packet/odp_pktio.c +++ b/example/packet/odp_pktio.c @@ -650,7 +650,7 @@ static void print_info(char *progname, appl_args_t *appl_args) "Cache line size: %i\n" "CPU count: %i\n" "\n", - odp_version_api_str(), odp_cpu_model_str(), odp_sys_cpu_hz(), + odp_version_api_str(), odp_cpu_model_str(), odp_cpu_hz(), odp_sys_cache_line_size(), odp_cpu_count()); printf("Running ODP appl: \"%s\"\n" diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index bee4be7..67f8742 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -350,7 +350,7 @@ int main(int argc, char *argv[]) printf("---------------\n"); printf("ODP API version: %s\n", odp_version_api_str()); printf("CPU model: %s\n", odp_cpu_model_str()); - printf("CPU freq (hz): %"PRIu64"\n", odp_sys_cpu_hz()); + printf("CPU freq (hz): %"PRIu64"\n", odp_cpu_hz()); printf("Cache line size: %i\n", odp_sys_cache_line_size()); printf("Max CPU count: %i\n", odp_cpu_count()); @@ -446,7 +446,7 @@ int main(int argc, char *argv[]) return -1; } - printf("CPU freq %"PRIu64" Hz\n", odp_sys_cpu_hz()); + printf("CPU freq %"PRIu64" Hz\n", odp_cpu_hz()); printf("Cycles vs nanoseconds:\n"); ns = 0; cycles = odp_time_ns_to_cycles(ns); diff --git a/include/odp/api/cpu.h b/include/odp/api/cpu.h index 78c3ffc..b63a2e9 100644 --- a/include/odp/api/cpu.h +++ b/include/odp/api/cpu.h @@ -53,6 +53,15 @@ int odp_cpu_count(void); const char *odp_cpu_model_str(void); /** + * Current CPU frequency in Hz + * + * Returns current frequency of this CPU + * + * @return CPU frequency in Hz + */ +uint64_t odp_cpu_hz(void); + +/** * @} */ diff --git a/include/odp/api/system_info.h b/include/odp/api/system_info.h index 1cd883f..bde3a60 100644 --- a/include/odp/api/system_info.h +++ b/include/odp/api/system_info.h @@ -24,13 +24,6 @@ extern "C" { */ /** - * CPU frequency in Hz - * - * @return CPU frequency in Hz - */ -uint64_t odp_sys_cpu_hz(void); - -/** * Huge page size in bytes * * @return Huge page size in bytes diff --git a/platform/linux-generic/arch/linux/odp_time_cycles.c b/platform/linux-generic/arch/linux/odp_time_cycles.c index 4dc0764..035afdf 100644 --- a/platform/linux-generic/arch/linux/odp_time_cycles.c +++ b/platform/linux-generic/arch/linux/odp_time_cycles.c @@ -27,7 +27,7 @@ uint64_t odp_time_cycles(void) if (ret != 0) ODP_ABORT("clock_gettime failed\n"); - hz = odp_sys_cpu_hz(); + hz = odp_cpu_hz(); sec = (uint64_t) time.tv_sec; ns = (uint64_t) time.tv_nsec; diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c index ed6b515..8e903b0 100644 --- a/platform/linux-generic/odp_system_info.c +++ b/platform/linux-generic/odp_system_info.c @@ -374,7 +374,7 @@ int odp_system_info_init(void) * Public access functions ************************* */ -uint64_t odp_sys_cpu_hz(void) +uint64_t odp_cpu_hz(void) { return odp_global_data.system_info.cpu_hz[0]; } diff --git a/platform/linux-generic/odp_time.c b/platform/linux-generic/odp_time.c index a08833d..11e852a 100644 --- a/platform/linux-generic/odp_time.c +++ b/platform/linux-generic/odp_time.c @@ -22,7 +22,7 @@ uint64_t odp_time_diff_cycles(uint64_t t1, uint64_t t2) uint64_t odp_time_cycles_to_ns(uint64_t cycles) { - uint64_t hz = odp_sys_cpu_hz(); + uint64_t hz = odp_cpu_hz(); if (cycles > (UINT64_MAX / GIGA)) return (cycles/hz)*GIGA; @@ -33,7 +33,7 @@ uint64_t odp_time_cycles_to_ns(uint64_t cycles) uint64_t odp_time_ns_to_cycles(uint64_t ns) { - uint64_t hz = odp_sys_cpu_hz(); + uint64_t hz = odp_cpu_hz(); if (ns > (UINT64_MAX / hz)) return (ns/GIGA)*hz; diff --git a/test/api_test/odp_common.c b/test/api_test/odp_common.c index f927ea6..8d05efe 100644 --- a/test/api_test/odp_common.c +++ b/test/api_test/odp_common.c @@ -42,7 +42,7 @@ void odp_print_system_info(void) printf("---------------\n"); printf("ODP API version: %s\n", odp_version_api_str()); printf("CPU model: %s\n", odp_cpu_model_str()); - printf("CPU freq (hz): %"PRIu64"\n", odp_sys_cpu_hz()); + printf("CPU freq (hz): %"PRIu64"\n", odp_cpu_hz()); printf("Cache line size: %i\n", odp_sys_cache_line_size()); printf("CPU count: %i\n", odp_cpu_count()); printf("CPU mask: %s\n", str); diff --git a/test/performance/odp_atomic.c b/test/performance/odp_atomic.c index 29efd1b..74d4f3a 100644 --- a/test/performance/odp_atomic.c +++ b/test/performance/odp_atomic.c @@ -338,7 +338,7 @@ void odp_print_system_info(void) printf("---------------\n"); printf("ODP API version: %s\n", odp_version_api_str()); printf("CPU model: %s\n", odp_cpu_model_str()); - printf("CPU freq (hz): %"PRIu64"\n", odp_sys_cpu_hz()); + printf("CPU freq (hz): %"PRIu64"\n", odp_cpu_hz()); printf("Cache line size: %i\n", odp_sys_cache_line_size()); printf("CPU count: %i\n", odp_cpu_count()); printf("CPU mask: %s\n", str); diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c index 7621948..91138bc 100644 --- a/test/performance/odp_l2fwd.c +++ b/test/performance/odp_l2fwd.c @@ -669,7 +669,7 @@ static void print_info(char *progname, appl_args_t *appl_args) "Cache line size: %i\n" "CPU count: %i\n" "\n", - odp_version_api_str(), odp_cpu_model_str(), odp_sys_cpu_hz(), + odp_version_api_str(), odp_cpu_model_str(), odp_cpu_hz(), odp_sys_cache_line_size(), odp_cpu_count()); printf("Running ODP appl: \"%s\"\n" diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c index c93dd44..72be34d 100644 --- a/test/performance/odp_scheduling.c +++ b/test/performance/odp_scheduling.c @@ -879,7 +879,7 @@ int main(int argc, char *argv[]) printf("---------------\n"); printf("ODP API version: %s\n", odp_version_api_str()); printf("CPU model: %s\n", odp_cpu_model_str()); - printf("CPU freq (hz): %"PRIu64"\n", odp_sys_cpu_hz()); + printf("CPU freq (hz): %"PRIu64"\n", odp_cpu_hz()); printf("Cache line size: %i\n", odp_sys_cache_line_size()); printf("Max CPU count: %i\n", odp_cpu_count()); diff --git a/test/validation/system/system.c b/test/validation/system/system.c index 0a0aa00..7f751a3 100644 --- a/test/validation/system/system.c +++ b/test/validation/system/system.c @@ -75,11 +75,11 @@ void system_test_odp_sys_huge_page_size(void) CU_ASSERT(0 < page); } -void system_test_odp_sys_cpu_hz(void) +void system_test_odp_cpu_hz(void) { uint64_t hz; - hz = odp_sys_cpu_hz(); + hz = odp_cpu_hz(); CU_ASSERT(0 < hz); } @@ -90,7 +90,7 @@ CU_TestInfo system_suite[] = { _CU_TEST_INFO(system_test_odp_cpu_model_str), _CU_TEST_INFO(system_test_odp_sys_page_size), _CU_TEST_INFO(system_test_odp_sys_huge_page_size), - _CU_TEST_INFO(system_test_odp_sys_cpu_hz), + _CU_TEST_INFO(system_test_odp_cpu_hz), CU_TEST_INFO_NULL, }; diff --git a/test/validation/system/system.h b/test/validation/system/system.h index 2043a54..d05f104 100644 --- a/test/validation/system/system.h +++ b/test/validation/system/system.h @@ -16,7 +16,7 @@ void system_test_odp_sys_cache_line_size(void); void system_test_odp_cpu_model_str(void); void system_test_odp_sys_page_size(void); void system_test_odp_sys_huge_page_size(void); -void system_test_odp_sys_cpu_hz(void); +void system_test_odp_cpu_hz(void); /* test arrays: */ extern CU_TestInfo system_suite[];