From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5218CECE58E for ; Thu, 17 Oct 2019 15:58:54 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0F8C021848 for ; Thu, 17 Oct 2019 15:58:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DgOCllxV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0F8C021848 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:51750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iL8Au-0007P3-OV for qemu-devel@archiver.kernel.org; Thu, 17 Oct 2019 11:58:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52703) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iL7G7-000154-5E for qemu-devel@nongnu.org; Thu, 17 Oct 2019 11:00:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iL7G5-0004cX-K6 for qemu-devel@nongnu.org; Thu, 17 Oct 2019 11:00:11 -0400 Received: from mail-oi1-x242.google.com ([2607:f8b0:4864:20::242]:38637) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iL7G5-0004c1-Dw for qemu-devel@nongnu.org; Thu, 17 Oct 2019 11:00:09 -0400 Received: by mail-oi1-x242.google.com with SMTP id k10so115079oij.5 for ; Thu, 17 Oct 2019 08:00:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=M5Y5S4bU2xkOzKBGjT0DmAhs+QC4phjwSWTyUm/ZWo4=; b=DgOCllxVk+7vJLGmedLbu/nQL2Z9+Hb+ND/4SVae1h8tWWQueFNLYOMaAARFkLYL55 jhsKA54/5Wdbg3bP/sDljVyiyxKJTN9R2TVC5S9WmL9eSYVpZR9AYgqUrlYDTVa6puKF g+b/FI5ZCfdy/f5eGnbfhqN/HR4c4ts9lGeG/IAOUSfzqxQTAJApkZ/e5jTpbJcA8RTH 8bia4TLBp+W1pUYNuSKxv049R1VnDmGhw/SQMX7tpyuQqLO1RACt5nKxWyk2MqB4Wut6 QnUAT2zueO5vXvcnBQDc+RoGJ3L9+p76BI4Xprpx82/R9AYLtT+QvT6MwB05EaYmooIn tsDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=M5Y5S4bU2xkOzKBGjT0DmAhs+QC4phjwSWTyUm/ZWo4=; b=UNWCHfkao6tOYozZf31V3KteScQBRUdQs/LvG1i5Jjv3PxpaybP41PMip8wl/R1uKS 6LnmnpD2t6fwEInVkP8qG9zKCyq/fK1BK4ITCyyIwZaXmRI9Ffn0Bvo2NwOhmHGobGYR VuAGqWf/7rnyrpD3Hum4tf/wIIeIQpEsAfq8t7NAP5ESqyvqC0LWLE6jlfpI638HSVSf eo1p8OH5Ju1wySTiZRvoi/JFbTcwrvU9phl2FmleCezHzva8EhutSs8YY8OCxqE+B3jn GZMyFs5AOagpbsynZK5Wlf4jWHsA1jeiLqF/nvfKPpXLPqmh2GvDejtJLAZD+hU5K2t/ LtrA== X-Gm-Message-State: APjAAAV8ha41Bw+Mt9lWOtOYNy8vZ6NVJ7dvosWjZA9tQpDYEN4AHOz0 kL3rpUAKl0Cb7aayanej8N6rjFh34OSAqxDFYFA= X-Google-Smtp-Source: APXvYqwlhAh0sKvyLqI7nCmavqIbjFOtTsBOMv/I2tNto28moIFL1Cj0mLBEV4gsN+xS/ZGyiMAIMkRmYIn2cXd5uzY= X-Received: by 2002:aca:4e56:: with SMTP id c83mr3618429oib.53.1571324408479; Thu, 17 Oct 2019 08:00:08 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:340a:0:0:0:0:0 with HTTP; Thu, 17 Oct 2019 08:00:07 -0700 (PDT) In-Reply-To: <20191015162705.28087-4-philmd@redhat.com> References: <20191015162705.28087-1-philmd@redhat.com> <20191015162705.28087-4-philmd@redhat.com> From: Aleksandar Markovic Date: Thu, 17 Oct 2019 17:00:07 +0200 Message-ID: Subject: Re: [PATCH 03/32] mc146818rtc: move structure to header file To: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= Content-Type: multipart/alternative; boundary="00000000000031c31505951c791d" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::242 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , Stefano Stabellini , Eduardo Habkost , "kvm@vger.kernel.org" , Paul Durrant , "Michael S. Tsirkin" , "qemu-devel@nongnu.org" , Igor Mammedov , =?UTF-8?Q?Herv=C3=A9_Poussineau?= , Aleksandar Markovic , "xen-devel@lists.xenproject.org" , Anthony Perard , Paolo Bonzini , Aleksandar Rikalo , Aurelien Jarno , Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --00000000000031c31505951c791d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tuesday, October 15, 2019, Philippe Mathieu-Daud=C3=A9 wrote: > From: Herv=C3=A9 Poussineau > > We are now able to embed a timer in another object. > > Acked-by: Michael S. Tsirkin > Acked-by: Paolo Bonzini > Signed-off-by: Herv=C3=A9 Poussineau > Message-Id: <20171216090228.28505-4-hpoussin@reactos.org> > Signed-off-by: Philippe Mathieu-Daud=C3=A9 > --- > hw/timer/mc146818rtc.c | 30 ------------------------------ > include/hw/timer/mc146818rtc.h | 33 +++++++++++++++++++++++++++++++++ > 2 files changed, 33 insertions(+), 30 deletions(-) > > Reviewed-by: Aleksandar Markovic > diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c > index 6cb378751b..e40b54e743 100644 > --- a/hw/timer/mc146818rtc.c > +++ b/hw/timer/mc146818rtc.c > @@ -71,36 +71,6 @@ > #define RTC_CLOCK_RATE 32768 > #define UIP_HOLD_LENGTH (8 * NANOSECONDS_PER_SECOND / 32768) > > -#define MC146818_RTC(obj) OBJECT_CHECK(RTCState, (obj), TYPE_MC146818_RT= C) > - > -typedef struct RTCState { > - ISADevice parent_obj; > - > - MemoryRegion io; > - MemoryRegion coalesced_io; > - uint8_t cmos_data[128]; > - uint8_t cmos_index; > - int32_t base_year; > - uint64_t base_rtc; > - uint64_t last_update; > - int64_t offset; > - qemu_irq irq; > - int it_shift; > - /* periodic timer */ > - QEMUTimer *periodic_timer; > - int64_t next_periodic_time; > - /* update-ended timer */ > - QEMUTimer *update_timer; > - uint64_t next_alarm_time; > - uint16_t irq_reinject_on_ack_count; > - uint32_t irq_coalesced; > - uint32_t period; > - QEMUTimer *coalesced_timer; > - LostTickPolicy lost_tick_policy; > - Notifier suspend_notifier; > - QLIST_ENTRY(RTCState) link; > -} RTCState; > - > static void rtc_set_time(RTCState *s); > static void rtc_update_time(RTCState *s); > static void rtc_set_cmos(RTCState *s, const struct tm *tm); > diff --git a/include/hw/timer/mc146818rtc.h b/include/hw/timer/ > mc146818rtc.h > index fe6ed63f71..0f1c886e5b 100644 > --- a/include/hw/timer/mc146818rtc.h > +++ b/include/hw/timer/mc146818rtc.h > @@ -1,10 +1,43 @@ > #ifndef MC146818RTC_H > #define MC146818RTC_H > > +#include "qapi/qapi-types-misc.h" > +#include "qemu/queue.h" > +#include "qemu/timer.h" > #include "hw/isa/isa.h" > #include "hw/timer/mc146818rtc_regs.h" > > #define TYPE_MC146818_RTC "mc146818rtc" > +#define MC146818_RTC(obj) OBJECT_CHECK(RTCState, (obj), TYPE_MC146818_RT= C) > + > +typedef struct RTCState { > + ISADevice parent_obj; > + > + MemoryRegion io; > + MemoryRegion coalesced_io; > + uint8_t cmos_data[128]; > + uint8_t cmos_index; > + int32_t base_year; > + uint64_t base_rtc; > + uint64_t last_update; > + int64_t offset; > + qemu_irq irq; > + int it_shift; > + /* periodic timer */ > + QEMUTimer *periodic_timer; > + int64_t next_periodic_time; > + /* update-ended timer */ > + QEMUTimer *update_timer; > + uint64_t next_alarm_time; > + uint16_t irq_reinject_on_ack_count; > + uint32_t irq_coalesced; > + uint32_t period; > + QEMUTimer *coalesced_timer; > + Notifier clock_reset_notifier; > + LostTickPolicy lost_tick_policy; > + Notifier suspend_notifier; > + QLIST_ENTRY(RTCState) link; > +} RTCState; > > ISADevice *mc146818_rtc_init(ISABus *bus, int base_year, > qemu_irq intercept_irq); > -- > 2.21.0 > > > --00000000000031c31505951c791d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Tuesday, October 15, 2019, Philippe Mathieu-Daud=C3=A9 <philmd@redhat.com> wrote:
From: Herv=C3=A9 Poussineau <hpoussin@reactos.org>

We are now able to embed a timer in another object.

Acked-by: Michael S. Tsirkin <mst@redh= at.com>
Acked-by: Paolo Bonzini <pbonzini= @redhat.com>
Signed-off-by: Herv=C3=A9 Poussineau <hpoussin@reactos.org>
Message-Id: <20171216090228.28505-4-hpoussin@reactos.org>
Signed-off-by: Philippe Mathieu-Daud=C3=A9 <philmd@redhat.com>
---
=C2=A0hw/timer/mc146818rtc.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 30 --------= ----------------------
=C2=A0include/hw/timer/mc146818rtc.h | 33 +++++++++++++++++++++++++++++++++
=C2=A02 files changed, 33 insertions(+), 30 deletions(-)


Reviewed-by: A= leksandar Markovic <amarkovic@wavecomp.com>

<= /div>

=C2=A0<= /div>
diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c
index 6cb378751b..e40b54e743 100644
--- a/hw/timer/mc146818rtc.c
+++ b/hw/timer/mc146818rtc.c
@@ -71,36 +71,6 @@
=C2=A0#define RTC_CLOCK_RATE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 32768=
=C2=A0#define UIP_HOLD_LENGTH=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(8 * = NANOSECONDS_PER_SECOND / 32768)

-#define MC146818_RTC(obj) OBJECT_CHECK(RTCState, (obj), TYPE_MC146818_RTC)=
-
-typedef struct RTCState {
-=C2=A0 =C2=A0 ISADevice parent_obj;
-
-=C2=A0 =C2=A0 MemoryRegion io;
-=C2=A0 =C2=A0 MemoryRegion coalesced_io;
-=C2=A0 =C2=A0 uint8_t cmos_data[128];
-=C2=A0 =C2=A0 uint8_t cmos_index;
-=C2=A0 =C2=A0 int32_t base_year;
-=C2=A0 =C2=A0 uint64_t base_rtc;
-=C2=A0 =C2=A0 uint64_t last_update;
-=C2=A0 =C2=A0 int64_t offset;
-=C2=A0 =C2=A0 qemu_irq irq;
-=C2=A0 =C2=A0 int it_shift;
-=C2=A0 =C2=A0 /* periodic timer */
-=C2=A0 =C2=A0 QEMUTimer *periodic_timer;
-=C2=A0 =C2=A0 int64_t next_periodic_time;
-=C2=A0 =C2=A0 /* update-ended timer */
-=C2=A0 =C2=A0 QEMUTimer *update_timer;
-=C2=A0 =C2=A0 uint64_t next_alarm_time;
-=C2=A0 =C2=A0 uint16_t irq_reinject_on_ack_count;
-=C2=A0 =C2=A0 uint32_t irq_coalesced;
-=C2=A0 =C2=A0 uint32_t period;
-=C2=A0 =C2=A0 QEMUTimer *coalesced_timer;
-=C2=A0 =C2=A0 LostTickPolicy lost_tick_policy;
-=C2=A0 =C2=A0 Notifier suspend_notifier;
-=C2=A0 =C2=A0 QLIST_ENTRY(RTCState) link;
-} RTCState;
-
=C2=A0static void rtc_set_time(RTCState *s);
=C2=A0static void rtc_update_time(RTCState *s);
=C2=A0static void rtc_set_cmos(RTCState *s, const struct tm *tm);
diff --git a/include/hw/timer/mc146818rtc.h b/include/hw/timer/mc= 146818rtc.h
index fe6ed63f71..0f1c886e5b 100644
--- a/include/hw/timer/mc146818rtc.h
+++ b/include/hw/timer/mc146818rtc.h
@@ -1,10 +1,43 @@
=C2=A0#ifndef MC146818RTC_H
=C2=A0#define MC146818RTC_H

+#include "qapi/qapi-types-misc.h"
+#include "qemu/queue.h"
+#include "qemu/timer.h"
=C2=A0#include "hw/isa/isa.h"
=C2=A0#include "hw/timer/mc146818rtc_regs.h"

=C2=A0#define TYPE_MC146818_RTC "mc146818rtc"
+#define MC146818_RTC(obj) OBJECT_CHECK(RTCState, (obj), TYPE_MC146818_RTC)=
+
+typedef struct RTCState {
+=C2=A0 =C2=A0 ISADevice parent_obj;
+
+=C2=A0 =C2=A0 MemoryRegion io;
+=C2=A0 =C2=A0 MemoryRegion coalesced_io;
+=C2=A0 =C2=A0 uint8_t cmos_data[128];
+=C2=A0 =C2=A0 uint8_t cmos_index;
+=C2=A0 =C2=A0 int32_t base_year;
+=C2=A0 =C2=A0 uint64_t base_rtc;
+=C2=A0 =C2=A0 uint64_t last_update;
+=C2=A0 =C2=A0 int64_t offset;
+=C2=A0 =C2=A0 qemu_irq irq;
+=C2=A0 =C2=A0 int it_shift;
+=C2=A0 =C2=A0 /* periodic timer */
+=C2=A0 =C2=A0 QEMUTimer *periodic_timer;
+=C2=A0 =C2=A0 int64_t next_periodic_time;
+=C2=A0 =C2=A0 /* update-ended timer */
+=C2=A0 =C2=A0 QEMUTimer *update_timer;
+=C2=A0 =C2=A0 uint64_t next_alarm_time;
+=C2=A0 =C2=A0 uint16_t irq_reinject_on_ack_count;
+=C2=A0 =C2=A0 uint32_t irq_coalesced;
+=C2=A0 =C2=A0 uint32_t period;
+=C2=A0 =C2=A0 QEMUTimer *coalesced_timer;
+=C2=A0 =C2=A0 Notifier clock_reset_notifier;
+=C2=A0 =C2=A0 LostTickPolicy lost_tick_policy;
+=C2=A0 =C2=A0 Notifier suspend_notifier;
+=C2=A0 =C2=A0 QLIST_ENTRY(RTCState) link;
+} RTCState;

=C2=A0ISADevice *mc146818_rtc_init(ISABus *bus, int base_year,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 qemu_irq intercept_irq);
--
2.21.0


--00000000000031c31505951c791d--