From patchwork Thu Jan 21 19:03:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 8084441 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 67AAA9F6FA for ; Thu, 21 Jan 2016 19:08:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C237A20390 for ; Thu, 21 Jan 2016 19:08:12 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2D16E20384 for ; Thu, 21 Jan 2016 19:08:12 +0000 (UTC) Received: from localhost ([::1]:49379 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMKaZ-0004wc-Ff for patchwork-qemu-devel@patchwork.kernel.org; Thu, 21 Jan 2016 14:08:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMKXN-0007X8-Hj for qemu-devel@nongnu.org; Thu, 21 Jan 2016 14:04:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMKXI-0001Cv-7M for qemu-devel@nongnu.org; Thu, 21 Jan 2016 14:04:53 -0500 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]:35363) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMKXH-0001Cq-VD; Thu, 21 Jan 2016 14:04:48 -0500 Received: by mail-lf0-x241.google.com with SMTP id c134so2839419lfb.2; Thu, 21 Jan 2016 11:04:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=QkhP8k1Opv+JA53f0t4rI5ieQisnq8wqD6P4Le2sO/Q=; b=B/4zqVTZAgu4Z80Jr8DowX2mO/oq+biFKzG6jfvTVp4k427WmllYPKSlOEdHt2MZ9G Tup8GfV62ovsoZHS5nLzGGQSnJjOU7Qo4sz8hlgjsQuk8F0T3C7iecy0RnajF5m9IRIK tKMOily4ftpbVWlvJ+XYYZDmYR7WT0RL/IBwrBERJv8j2tT1c+1v+QfPr8Gr6XdPE+on aKJwV8DL8LmMx58D4F2c/JCzGXMBl/1/yffS9MezBl6Y9ahByhMr8IAV4jBVKgIYXcAZ D/tpmigjJ3K0RlhIO2fzLIYpk6q9MLDZt8cqsqDWUtDUfPZK3cUzdhB9jQq9hu7dvFdu 2AtQ== 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:in-reply-to :references:in-reply-to:references; bh=QkhP8k1Opv+JA53f0t4rI5ieQisnq8wqD6P4Le2sO/Q=; b=doyQobnWBtLg6Sa2BMGz97Mv0P2YPGis6TfE9kFOB6Hrk8Dh/mGO0EYtrT3iWqc7Q0 yAfWjDN5BlKDer01X/zRKOzHL8RRzYV318rm0hG1Qy6LIjOotOVpd9Rtt1B3Uw0pISln vzfKdVX94ZXqXBN/G+TBA0hPKH3z7oux2LxdsrOEEJVCDK8Vzmnfh2OGqB/PmuseeGF+ Ly+zcVA3JvRRZOmQ0z6LoAyav/8KOMxn/ScZO3NTygni8s/Ht1G08IrwJWIc4kwgZYoC FtmToyFUv2gTlwN72rrk9FAuqUWxwBZUBMXAtMVADb+U0WkazUResTwriWGegI4jqK83 Ozqw== X-Gm-Message-State: ALoCoQmKqrNLLcuswLloVv2GQQXbW0Pkyf7Na1J75Jrq0Lf9/mSw7AUN4YIhL0ZSKkFGX3lAAF8/zm4wyc6NVs5FL2O89aLo+A== X-Received: by 10.25.153.130 with SMTP id b124mr16317554lfe.81.1453403087125; Thu, 21 Jan 2016 11:04:47 -0800 (PST) Received: from localhost.localdomain (ppp46-138-151-163.pppoe.spdop.ru. [46.138.151.163]) by smtp.gmail.com with ESMTPSA id m21sm382496lfe.29.2016.01.21.11.04.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Jan 2016 11:04:46 -0800 (PST) From: Dmitry Osipenko To: QEMU Developers , qemu-arm@nongnu.org Date: Thu, 21 Jan 2016 22:03:48 +0300 Message-Id: X-Mailer: git-send-email 2.7.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::241 Cc: Peter Maydell , Peter Crosthwaite Subject: [Qemu-devel] [PATCH v11 5/7] hw/ptimer: Introduce ptimer_get_limit X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently ptimer users are used to store copy of the limit value, because ptimer doesn't provide facility to retrieve the limit. Let's provide it. Signed-off-by: Dmitry Osipenko Reviewed-by: Peter Crosthwaite --- hw/core/ptimer.c | 5 +++++ include/hw/ptimer.h | 1 + 2 files changed, 6 insertions(+) diff --git a/hw/core/ptimer.c b/hw/core/ptimer.c index a85d1ae..142cc64 100644 --- a/hw/core/ptimer.c +++ b/hw/core/ptimer.c @@ -224,6 +224,11 @@ void ptimer_set_limit(ptimer_state *s, uint64_t limit, int reload) } } +uint64_t ptimer_get_limit(ptimer_state *s) +{ + return s->limit; +} + const VMStateDescription vmstate_ptimer = { .name = "ptimer", .version_id = 1, diff --git a/include/hw/ptimer.h b/include/hw/ptimer.h index 8ebacbb..e397db5 100644 --- a/include/hw/ptimer.h +++ b/include/hw/ptimer.h @@ -19,6 +19,7 @@ typedef void (*ptimer_cb)(void *opaque); ptimer_state *ptimer_init(QEMUBH *bh); void ptimer_set_period(ptimer_state *s, int64_t period); void ptimer_set_freq(ptimer_state *s, uint32_t freq); +uint64_t ptimer_get_limit(ptimer_state *s); void ptimer_set_limit(ptimer_state *s, uint64_t limit, int reload); uint64_t ptimer_get_count(ptimer_state *s); void ptimer_set_count(ptimer_state *s, uint64_t count);