From patchwork Thu Jan 19 07:42:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wang X-Patchwork-Id: 91840 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp156579qgi; Wed, 18 Jan 2017 23:42:25 -0800 (PST) X-Received: by 10.36.160.70 with SMTP id o67mr7082534ite.50.1484811745173; Wed, 18 Jan 2017 23:42:25 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id f32si3752655ioj.67.2017.01.18.23.42.24; Wed, 18 Jan 2017 23:42:25 -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 8FBF960D32; Thu, 19 Jan 2017 07:42:24 +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 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 B3E4160C2A; Thu, 19 Jan 2017 07:42:20 +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 86F0C60CC6; Thu, 19 Jan 2017 07:42:18 +0000 (UTC) Received: from mail-pf0-f180.google.com (mail-pf0-f180.google.com [209.85.192.180]) by lists.linaro.org (Postfix) with ESMTPS id 86F2D60BEE for ; Thu, 19 Jan 2017 07:42:17 +0000 (UTC) Received: by mail-pf0-f180.google.com with SMTP id y143so11494972pfb.0 for ; Wed, 18 Jan 2017 23:42:17 -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=xdpVINexvQyt5Opb5ZNOF5wcLCSOAIHA3lQKNZS8ClI=; b=muiANZbu+prCVKOmTmk0yTOAUiPCk/Ex4qcCMPjUc8f5FQztuovDnqUV5fqyQe1jel xUC7LvwpHrWI6siLQ1uJu5QCqP1BZRY598kCC57NWRjoDgspajLNmtf4js09LMdgO7rQ fjWbHnEgz87M/oIth2AWgfwLYXUXP2f4F40QJVaVoGSBtgsWszqrW53/FcOSeLwQOru6 xVieyZ1GoCozpnilbxtdJRn1TkLfiUK/p3TAEIRxzDg4QDNaGGWS9EeF11DcCfo3SSii nnRC5Le9u8n5PU0LBgMdUkY48dCcUBpVOpVsd+pujc6R68rlxK3zyJXBWiARnrxDfA9l MA6Q== X-Gm-Message-State: AIkVDXKXaFdic1jgpwe6vEhxJPoPRkur+j2d6Ykxx+AiAA2LVPk9ZOKMMNowHjb78HD7/WDLECU= X-Received: by 10.84.211.7 with SMTP id b7mr11093639pli.82.1484811736863; Wed, 18 Jan 2017 23:42:16 -0800 (PST) Received: from ubuntu.heyii.co (ubuntu.heyii.co. [45.32.66.203]) by smtp.googlemail.com with ESMTPSA id a24sm6016944pfh.33.2017.01.18.23.42.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Jan 2017 23:42:16 -0800 (PST) From: Kevin Wang To: lng-odp@lists.linaro.org Date: Thu, 19 Jan 2017 07:42:13 +0000 Message-Id: <1484811733-22802-1-git-send-email-kevin.wang@linaro.org> X-Mailer: git-send-email 1.9.1 Subject: [lng-odp] [PATCH 1/2] api: New API to support timer capacity 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 capacity to the user. --- 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.