[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: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [RFC PATCH 03/11] qemu-clk: allow to bound two clocks together |
Date: |
Fri, 29 Jul 2016 14:39:22 +0100 |
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.
> + void *opaque;
> + qemu_clk_on_rate_update_cb cb;
> + QLIST_HEAD(, ClkList) bound;
> } *qemu_clk;
thanks
-- PMM
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [RFC PATCH 03/11] qemu-clk: allow to bound two clocks together,
Peter Maydell <=