From patchwork Wed Feb 8 02:37:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wang X-Patchwork-Id: 93598 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp2485014qgi; Tue, 7 Feb 2017 18:38:19 -0800 (PST) X-Received: by 10.55.192.196 with SMTP id v65mr17869290qkv.40.1486521499200; Tue, 07 Feb 2017 18:38:19 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id s65si4501068qtd.192.2017.02.07.18.38.18; Tue, 07 Feb 2017 18:38:19 -0800 (PST) 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; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id C630962FB6; Wed, 8 Feb 2017 02:38: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=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, 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 6123362DFC; Wed, 8 Feb 2017 02:38:11 +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 41BAE62DFC; Wed, 8 Feb 2017 02:38:06 +0000 (UTC) Received: from mail-pf0-f181.google.com (mail-pf0-f181.google.com [209.85.192.181]) by lists.linaro.org (Postfix) with ESMTPS id D526D60F4E for ; Wed, 8 Feb 2017 02:37:14 +0000 (UTC) Received: by mail-pf0-f181.google.com with SMTP id y143so37954403pfb.0 for ; Tue, 07 Feb 2017 18:37:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9FchMrv2VA1aB1TA2wnMKCfNJDOZWgVVHQHXMglTWMg=; b=aHZa5LrdNk47Xslzeb+jbofOX2ga5/zOiulSXLfLt39r0Lr5skBnO/yTPJ3qeGBYoD 1+MzpgKRZyHAvIT/374+sfLcvA6Dq1rCAMc0O8B1MGPXBXPlffSZWIi1FP5KKtCadV// V96x9Kp1zMbnrT3mtMV5TP4R+gy/HEKKLhDzJS8BEymeQ0IQ4Z8/87yYTeLoqOxHrBTC 3dhJM+9mi893U7vPNOznOruADDGnOie7f7XklC3TNOKla2OYeUOyp55zwtXSieG7aTZk LTR3bVVSPE+UGXX68NXpx9XlRXLdu4CI27OgtlXH/eA7vv9ERbIP6MPDusbU3/jeTDcc naJQ== X-Gm-Message-State: AIkVDXIoEOMhvl+Hi2ocpkjBdYbS5UWV5SbnvTQKxCzPmUy/ociiVLEtUx5HKv6Ou0gn38l5NJo= X-Received: by 10.99.152.10 with SMTP id q10mr23936597pgd.192.1486521434114; Tue, 07 Feb 2017 18:37:14 -0800 (PST) Received: from ubuntu.heyii.co (ubuntu.heyii.co. [45.32.66.203]) by smtp.googlemail.com with ESMTPSA id i82sm14714084pfk.52.2017.02.07.18.37.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Feb 2017 18:37:13 -0800 (PST) From: Kevin Wang To: lng-odp@lists.linaro.org Date: Wed, 8 Feb 2017 02:37:01 +0000 Message-Id: <1486521424-11172-2-git-send-email-kevin.wang@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1486521424-11172-1-git-send-email-kevin.wang@linaro.org> References: <1486521424-11172-1-git-send-email-kevin.wang@linaro.org> Subject: [lng-odp] [API-NEXT PATCHv4 1/4] api: timer: add odp_timer_capability() api X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Currently, user needs to decide the timer resolution before creating a timer pool. But sometimes it will cause timer overrun as the system can't support such high resolution. So a new API is required to expose the timer capability to the user. Signed-off-by: Kevin Wang --- include/odp/api/spec/timer.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) -- 1.9.1 diff --git a/include/odp/api/spec/timer.h b/include/odp/api/spec/timer.h index 75f9db9..e8d85b7 100644 --- a/include/odp/api/spec/timer.h +++ b/include/odp/api/spec/timer.h @@ -108,6 +108,27 @@ typedef struct { } odp_timer_pool_param_t; /** + * Timer capability + */ +typedef struct { + uint64_t res_ns; /**< Timeout resolution in nanoseconds */ +} odp_timer_capability_t; + +/** + * Query Timer interface capabilities + * + * Outputs Timer interface capabilities on success. + * + * @param clk_src Clock source for timers + * @param[out] capa Pointer to capability structure for output + * + * @retval 0 on success + * @retval <0 on failure + */ +int odp_timer_capability(odp_timer_clk_src_t clk_src, + odp_timer_capability_t *capa); + +/** * Create a timer pool * * The use of pool name is optional. Unique names are not required.