qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH 03/11] qemu-clk: allow to bound two clocks t


From: KONRAD Frederic
Subject: Re: [Qemu-devel] [RFC PATCH 03/11] qemu-clk: allow to bound two clocks together
Date: Tue, 2 Aug 2016 14:29:45 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0



Le 29/07/2016 à 15:39, Peter Maydell a écrit :
On 13 June 2016 at 17:27,  <address@hidden> wrote:
From: KONRAD Frederic <address@hidden>

This introduces the clock binding and the update part.
When the qemu_clk_rate_update(qemu_clk, int) function is called:
   * The clock callback is called on the qemu_clk so it can change the rate.
   * The qemu_clk_rate_update function is called on all the driven clock.

Signed-off-by: KONRAD Frederic <address@hidden>
---
  include/qemu/qemu-clock.h | 65 +++++++++++++++++++++++++++++++++++++++++++++++
  qemu-clock.c              | 56 ++++++++++++++++++++++++++++++++++++++++
  2 files changed, 121 insertions(+)

diff --git a/include/qemu/qemu-clock.h b/include/qemu/qemu-clock.h
index a2ba105..677de9a 100644
--- a/include/qemu/qemu-clock.h
+++ b/include/qemu/qemu-clock.h
@@ -27,15 +27,29 @@
  #include "qemu/osdep.h"
  #include "qom/object.h"

+typedef float (*qemu_clk_on_rate_update_cb)(void *opaque, float rate);
+
  #define TYPE_CLOCK "qemu-clk"
  #define QEMU_CLOCK(obj) OBJECT_CHECK(struct qemu_clk, (obj), TYPE_CLOCK)

+typedef struct ClkList ClkList;
+
  typedef struct qemu_clk {
      /*< private >*/
      Object parent_obj;
      char *name;            /* name of this clock in the device. */
+    float in_rate;         /* rate of the clock which drive this pin. */
+    float out_rate;        /* rate of this clock pin. */
I'm rather dubious that we should be using floats here.
Almost nothing in our hardware emulation uses float or double.

We probably can use uint64_t here?

Thanks,
Fred

+    void *opaque;
+    qemu_clk_on_rate_update_cb cb;
+    QLIST_HEAD(, ClkList) bound;
  } *qemu_clk;
thanks
-- PMM





reply via email to

[Prev in Thread] Current Thread [Next in Thread]