From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIq77-0001MD-N3 for qemu-devel@nongnu.org; Mon, 11 Jan 2016 22:59:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aIq73-0001c5-JO for qemu-devel@nongnu.org; Mon, 11 Jan 2016 22:59:21 -0500 From: Peter Crosthwaite Date: Mon, 11 Jan 2016 19:59:13 -0800 Message-ID: <20160112035913.GH3308@pcrost-box> References: <112f8a3527ada5a92ec851b5c6c2d8e5b84d6d0b.1452359845.git.digetx@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <112f8a3527ada5a92ec851b5c6c2d8e5b84d6d0b.1452359845.git.digetx@gmail.com> Subject: Re: [Qemu-devel] [PATCH v10 6/7] hw/ptimer: Introduce ptimer_get_limit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dmitry Osipenko Cc: Peter Maydell , Peter Crosthwaite , qemu-arm@nongnu.org, QEMU Developers On Sat, Jan 09, 2016 at 08:39:54PM +0300, Dmitry Osipenko wrote: > 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 Fair call. One less piece of duped state for the VMSDs. Reviewed-by: Peter Crosthwaite Regards, Peter > --- > 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 42e44f9..0201d1b 100644 > --- a/hw/core/ptimer.c > +++ b/hw/core/ptimer.c > @@ -235,6 +235,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); > -- > 2.6.4 >