From patchwork Tue Feb 7 09:03: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: 93522 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp2139695obz; Tue, 7 Feb 2017 01:03:28 -0800 (PST) X-Received: by 10.55.221.79 with SMTP id n76mr12575247qki.276.1486458208213; Tue, 07 Feb 2017 01:03:28 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id p129si2467453qkc.253.2017.02.07.01.03.27; Tue, 07 Feb 2017 01:03:28 -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 E0C6462DC2; Tue, 7 Feb 2017 09:03:27 +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 115976090A; Tue, 7 Feb 2017 09:03:23 +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 B68B060DC9; Tue, 7 Feb 2017 09:03:19 +0000 (UTC) Received: from mail-pf0-f172.google.com (mail-pf0-f172.google.com [209.85.192.172]) by lists.linaro.org (Postfix) with ESMTPS id 094E56090A for ; Tue, 7 Feb 2017 09:03:05 +0000 (UTC) Received: by mail-pf0-f172.google.com with SMTP id 189so31709149pfu.3 for ; Tue, 07 Feb 2017 01:03:05 -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=9FchMrv2VA1aB1TA2wnMKCfNJDOZWgVVHQHXMglTWMg=; b=b26DbeGm6Ba0bZKphD4LHmz8p7HLDOh6ZFfFPTZzPW2vzoS6Na7kskDWrYxOlOlGpE Mg2lfK4gNjB0mQErjICWuotFJ/rG/cwhoXGhUjTevNLaqGf5os0vp6MBzMuFijdo9dsl JXxq6we2uvfqQGI6KmQgNurfkX7Glcctlsug69h6hQ/DMbOga5GpasW7RbJ8m5lnXY8T QixcOXqvN9drYWZX4GYDtd2Jj9Z3xGUu8m+3t59t/36UEyE87MSq+sugPk/tmG8YPFPI jCh252nTgfbboqwdMsxiRrV8TftAWJXL0/FV9F/1WC/FiRuLDT5P8qcQijphFJjJxJm3 rU9w== X-Gm-Message-State: AIkVDXKfmWPBrts/VC2nq+SAMgQhoX+V3bDr+b5/jS35dvOKy1jIgergeK4hFe6NyAFXsudM8BA= X-Received: by 10.99.168.76 with SMTP id i12mr18809839pgp.73.1486458184208; Tue, 07 Feb 2017 01:03:04 -0800 (PST) Received: from ubuntu.heyii.co (ubuntu.heyii.co. [45.32.66.203]) by smtp.googlemail.com with ESMTPSA id d124sm9101375pga.30.2017.02.07.01.03.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Feb 2017 01:03:03 -0800 (PST) From: Kevin Wang To: lng-odp@lists.linaro.org Date: Tue, 7 Feb 2017 09:03:01 +0000 Message-Id: <1486458181-31808-1-git-send-email-kevin.wang@linaro.org> X-Mailer: git-send-email 1.9.1 Subject: [lng-odp] [API-NEXT PATCHv3 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.