From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58604) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUYos-000319-UO for qemu-devel@nongnu.org; Tue, 02 Aug 2016 08:29:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUYon-0006iK-Em for qemu-devel@nongnu.org; Tue, 02 Aug 2016 08:29:14 -0400 Received: from greensocs.com ([193.104.36.180]:37631) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUYon-0006iF-3I for qemu-devel@nongnu.org; Tue, 02 Aug 2016 08:29:09 -0400 References: <1465835259-21449-1-git-send-email-fred.konrad@greensocs.com> <1465835259-21449-4-git-send-email-fred.konrad@greensocs.com> From: KONRAD Frederic Message-ID: <5005a18c-dc6d-cf29-83e1-949ff62adce2@greensocs.com> Date: Tue, 2 Aug 2016 14:29:45 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC PATCH 03/11] qemu-clk: allow to bound two clocks together List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Edgar Iglesias , Mark Burton , QEMU Developers , Alistair Francis Le 29/07/2016 =C3=A0 15:39, Peter Maydell a =C3=A9crit : > On 13 June 2016 at 17:27, wrote: >> From: KONRAD Frederic >> >> 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 clo= ck. >> >> Signed-off-by: KONRAD Frederic >> --- >> 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_CL= OCK) >> >> +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 >