From patchwork Tue Oct 25 00:27:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Brooks X-Patchwork-Id: 80281 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp333419qge; Mon, 31 Oct 2016 14:50:57 -0700 (PDT) X-Received: by 10.237.47.4 with SMTP id l4mr21399507qtd.129.1477950657158; Mon, 31 Oct 2016 14:50:57 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id d18si15712636qkg.286.2016.10.31.14.50.56; Mon, 31 Oct 2016 14:50:57 -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; 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 dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id D200A617CD; Mon, 31 Oct 2016 21:50: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=1.5 required=5.0 tests=BAYES_00, DATE_IN_PAST_96_XX, 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 8D837617D2; Mon, 31 Oct 2016 21:50:51 +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 6F6E1617D2; Mon, 31 Oct 2016 21:50:48 +0000 (UTC) Received: from mail-oi0-f47.google.com (mail-oi0-f47.google.com [209.85.218.47]) by lists.linaro.org (Postfix) with ESMTPS id 8A76C6177B for ; Mon, 31 Oct 2016 21:50:47 +0000 (UTC) Received: by mail-oi0-f47.google.com with SMTP id v84so94390572oie.3 for ; Mon, 31 Oct 2016 14:50:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=MmToWHk/IiHYk13q5Zo9X0das5mwDElgJwZ2tvpY/O4=; b=JzW3a4EozXEU5ich+ibORnWN9k0PNo+Tweia1fqZjSwE4EnxlYF6dfhDr3pHS3v8dF Ub3P5+yAqcWMPMDCHZ4gg868SSr0CU79FBQN35zUk0UFnyjbA9Gy1K3zYPFsm5UbTZmU vlFr544HuD+O+oZqZg0U2RvbOp7o6aH5UYsdWxLluPcGTlUtcvuF4olPCpZZmiBfBZa7 qhF6fjhnejoorcFIfb6Q7XWhtQaYz6HalNoT+CuwTTLXXEQlwsRg0vHM6vo5jpjuwMZx wDnNN9imyALWZkQhX4zXjew1zWI4Js69xjz7DmPUrbW3NWZUtKQhspWIz1nCDeJkMhdw HTEA== X-Gm-Message-State: ABUngveNwJqpFhqgCFDTT1efdzqunlFEsRh+Ejb4f7TPY7YkPg00wNBESOBZWSWGJ4AhipcDfWk= X-Received: by 10.202.89.66 with SMTP id n63mr3559494oib.65.1477950646999; Mon, 31 Oct 2016 14:50:46 -0700 (PDT) Received: from vm-arch-01.localdomain (68-248-140-212.lightspeed.austtx.sbcglobal.net. [68.248.140.212]) by smtp.gmail.com with ESMTPSA id w22sm177107otw.31.2016.10.31.14.50.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Oct 2016 14:50:46 -0700 (PDT) From: Brian Brooks To: lng-odp@lists.linaro.org Date: Mon, 24 Oct 2016 19:27:49 -0500 Message-Id: <20161025002752.11939-1-brian.brooks@linaro.org> X-Mailer: git-send-email 2.10.1 X-Topics: timers Subject: [lng-odp] [RFC 1/4] timer: add odp_timer_pool_res() 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" Signed-off-by: Brian Brooks --- include/odp/api/spec/timer.h | 9 +++++++++ platform/linux-generic/odp_timer.c | 5 +++++ test/common_plat/validation/api/timer/timer.c | 2 ++ 3 files changed, 16 insertions(+) -- 2.10.1 diff --git a/include/odp/api/spec/timer.h b/include/odp/api/spec/timer.h index 3f8fdd4..540da44 100644 --- a/include/odp/api/spec/timer.h +++ b/include/odp/api/spec/timer.h @@ -191,6 +191,15 @@ int odp_timer_pool_info(odp_timer_pool_t tpid, odp_timer_pool_info_t *info); /** + * Get resolution from timer pool + * + * @param tpid Timer pool identifier + * + * @return Timeout resolution in nanoseconds + */ +uint64_t odp_timer_pool_res(odp_timer_pool_t tpid); + +/** * Allocate a timer * * Create a timer (allocating all necessary resources e.g. timeout event) from diff --git a/platform/linux-generic/odp_timer.c b/platform/linux-generic/odp_timer.c index ee4c4c0..d4b30b2 100644 --- a/platform/linux-generic/odp_timer.c +++ b/platform/linux-generic/odp_timer.c @@ -837,6 +837,11 @@ int odp_timer_pool_info(odp_timer_pool_t tpid, return 0; } +uint64_t odp_timer_pool_res(odp_timer_pool_t tpid) +{ + return tpid->param.res_ns; +} + uint64_t odp_timer_pool_to_u64(odp_timer_pool_t tpid) { return _odp_pri(tpid); diff --git a/test/common_plat/validation/api/timer/timer.c b/test/common_plat/validation/api/timer/timer.c index 0007639..a8321f3 100644 --- a/test/common_plat/validation/api/timer/timer.c +++ b/test/common_plat/validation/api/timer/timer.c @@ -529,6 +529,8 @@ void timer_test_odp_timer_all(void) CU_ASSERT(tpinfo.param.max_tmo == MAX); CU_ASSERT(strcmp(tpinfo.name, NAME) == 0); + CU_ASSERT(odp_timer_pool_res(tp) == RES); + LOG_DBG("Timer pool handle: %" PRIu64 "\n", odp_timer_pool_to_u64(tp)); LOG_DBG("#timers..: %u\n", NTIMERS); LOG_DBG("Tmo range: %u ms (%" PRIu64 " ticks)\n", RANGE_MS,