qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Patch: Integrator/CP reference clock cycle counter
@ 2009-03-12  7:22 Robert Niemi
  0 siblings, 0 replies; only message in thread
From: Robert Niemi @ 2009-03-12  7:22 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1019 bytes --]

Below is a patch to the integrator/cp implementation, adding support for
CM_REFCNT.
The behaviour is not strictly correct, since the counter should be zeroed
upon reset. But it wraps fairly often so this flaw shouldn't really affect
anyone.
BTW, is this the correct place to submit patches?

/Rob

--- qemu_svn/trunk/hw/integratorcp.c    2009-03-12 07:10:23.000000000 +0100
+++ qemu/hw/integratorcp.c      2009-03-12 07:22:34.000000000 +0100
@@ -14,6 +14,7 @@
 #include "boards.h"
 #include "arm-misc.h"
 #include "net.h"
+#include "qemu-timer.h"

 typedef struct {
     uint32_t flash_offset;
@@ -71,8 +72,7 @@ static uint32_t integratorcm_read(void *
     case 9: /* CM_INIT */
         return s->cm_init;
     case 10: /* CM_REFCT */
-        /* ??? High frequency timer.  */
-        cpu_abort(cpu_single_env, "integratorcm_read: CM_REFCT");
+               return muldiv64(qemu_get_clock(vm_clock), 24000000,
ticks_per_sec);
     case 12: /* CM_FLAGS */
         return s->cm_flags;
     case 14: /* CM_NVFLAGS */

[-- Attachment #2: Type: text/html, Size: 1251 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-03-12  7:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-12  7:22 [Qemu-devel] Patch: Integrator/CP reference clock cycle counter Robert Niemi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).