From patchwork Fri Jan 20 05:21:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wang X-Patchwork-Id: 92026 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp619193qgi; Thu, 19 Jan 2017 21:21:57 -0800 (PST) X-Received: by 10.237.38.197 with SMTP id q63mr11220377qtd.14.1484889717186; Thu, 19 Jan 2017 21:21:57 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id j67si4162856qtb.207.2017.01.19.21.21.56; Thu, 19 Jan 2017 21:21:57 -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 5C4CD62D16; Fri, 20 Jan 2017 05:21:56 +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=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, 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 3F21A62CFC; Fri, 20 Jan 2017 05:21:53 +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 8433462D00; Fri, 20 Jan 2017 05:21:50 +0000 (UTC) Received: from mail-pf0-f175.google.com (mail-pf0-f175.google.com [209.85.192.175]) by lists.linaro.org (Postfix) with ESMTPS id 926A262CF3 for ; Fri, 20 Jan 2017 05:21:49 +0000 (UTC) Received: by mail-pf0-f175.google.com with SMTP id f144so19465627pfa.2 for ; Thu, 19 Jan 2017 21:21:49 -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; bh=yeS4+hog5gS1e++l/TF8FeHF9mgj0Ea3+Iun8mr2Wew=; b=FjgThxyiMh48Dpa2t+xIQ68ztOXqaQv0nWRj8QGQNjhg1Q8Lx2zu/kkSB4Ilij9TUP iALU8MVHqXZlDewxA6b7hkGGYkkazJwX6OdJQ+RcivIdo4CKC3bIkuFYWetKeDlvHZ50 g1vFdOiRYsGvDHVftPZNADrBpBGs8oeKUoE3z96jyL4lJKlCKNLsZM3osR5VsJ1WRZPv jt0X/BDxRmJcKIGV0mxRT3202xQfGBSCPXSqfdXcsRq8ZX5IEpBwo00vXo7Mqn5v+iA9 FVXpOpDE0i8YGRQrFj1K5bpCO5vXjOqIN/haTYdmWVPwwD3b/k+Jqt7okOL0HMbvDz6L XdrQ== X-Gm-Message-State: AIkVDXJPDhZ59EJ//4obfeykZJ12uv9YKfoLDOj55UkYsvckWbAJ1uYHIFKZ4R6FgLj7THd0Ff4= X-Received: by 10.98.102.21 with SMTP id a21mr14274878pfc.29.1484889708639; Thu, 19 Jan 2017 21:21:48 -0800 (PST) Received: from ubuntu.heyii.co (ubuntu.heyii.co. [45.32.66.203]) by smtp.googlemail.com with ESMTPSA id 66sm12701328pgg.47.2017.01.19.21.21.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Jan 2017 21:21:48 -0800 (PST) From: Kevin Wang To: lng-odp@lists.linaro.org Date: Fri, 20 Jan 2017 05:21:44 +0000 Message-Id: <1484889704-14990-1-git-send-email-kevin.wang@linaro.org> X-Mailer: git-send-email 1.9.1 Subject: [lng-odp] [API-NEXT PATCH 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..78d9119 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.