From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hqwos-0002Sv-W7 for qemu-devel@nongnu.org; Wed, 23 May 2007 15:48:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hqwor-0002Qn-3Y for qemu-devel@nongnu.org; Wed, 23 May 2007 15:48:26 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hqwoq-0002Qa-U2 for qemu-devel@nongnu.org; Wed, 23 May 2007 15:48:24 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Hqwoq-0003L5-Ck for qemu-devel@nongnu.org; Wed, 23 May 2007 15:48:24 -0400 From: Paul Brook Subject: Re: [Qemu-devel] Timers Date: Wed, 23 May 2007 20:48:15 +0100 References: <200705230107.00962.paul@codesourcery.com> <200705231818.59906.paul@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200705232048.16793.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel@nongnu.org On Wednesday 23 May 2007, Blue Swirl wrote: > On 5/23/07, Paul Brook wrote: > > On Wednesday 23 May 2007, Blue Swirl wrote: > > > On 5/23/07, Paul Brook wrote: > > > > I get fed up of having to re-implement a simple countdown timer for > > > > every new board, so I've added a simple periodic timer implementation > > > > to cvs (ptimer.c). Currently only the Arm PrimeCell based boards use > > > > this, but I've a few other uses in the pipeline. > > > > > > Nice idea! On Sparc the timer can be configured to work in 64-bit > > > mode, so could the ptimer_get/set_count be changed to use 64-bit > > > values? > I made the API change and converted Sparc timers. Looks like it works > (guest clock runs normally), though there are the following messages > on startup: > FIXME: ptimer_set_limit with running timer > > Comments? Did I break something? Code looks reasonable to me. The FIXME means you're changing the timer parameters after starting the timer. I didn't check whether this does anything sensible (this may depend on the device), hence the message. It probably needs some attention when reload == 1 && s->enabled. Note that save/restore is not implemented. You may wish to implement this before applying your changes. This doesn't effect the Arm targets because they can't save/restore at all. Paul