[Qemu-devel] [PATCH] add a simple 24mhz clock for the versatile

2007-03-30 Thread Jason Wessel
This patch implements a simple 24mhz clock for the versatile board such that functions in the linux kernel can make use of these stamps. An example user of this is the printk time stamps when using the time parameter on the kernel boot line. signed-off-by: [EMAIL PROTECTED] Cheers, Jason.

Re: [Qemu-devel] [PATCH] add a simple 24mhz clock for the versatile

2007-03-30 Thread Paul Brook
+        uint64_t now = qemu_get_clock(vm_clock); +        return (uint32_t)(now*.024); We should be able to do this without resorting to floating point arithmetic. Paul

Re: [Qemu-devel] [PATCH] add a simple 24mhz clock for the versatile

2007-03-30 Thread Jonathan Kalbfeld
If you're ok you can shift it left 4 bits, then add half that result then shift right 10 bits. Of course, you'll only get 23.4Mhz that way :-) jonathan On 3/30/07, Paul Brook [EMAIL PROTECTED] wrote: + uint64_t now = qemu_get_clock(vm_clock); + return (uint32_t)(now*.024); We should be

RE: [Qemu-devel] [PATCH] add a simple 24mhz clock for the versatile

2007-03-30 Thread Wessel, Jason
30, 2007 12:50 PM To: qemu-devel@nongnu.org Subject: Re: [Qemu-devel] [PATCH] add a simple 24mhz clock for the versatile If you're ok you can shift it left 4 bits, then add half that result then shift right 10 bits. Of course, you'll only

Re: [Qemu-devel] [PATCH] add a simple 24mhz clock for the versatile

2007-03-30 Thread andrzej zaborowski
On 31/03/07, Wessel, Jason [EMAIL PROTECTED] wrote: uint64_t now = qemu_get_clock(vm_clock); return (uint32_t)((now*3)/125); The optimizer should fix this up with no floating point ops. Adding to the bikeshed discussion (www.bikeshed.com) this is still not correct as vm_clock is to be used