All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Hervé Poussineau" <hpoussin@reactos.org>
To: Aurelien Jarno <aurelien@aurel32.net>,
	Yongbok Kim <yongbok.kim@mips.com>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org
Cc: "Hervé Poussineau" <hpoussin@reactos.org>
Subject: [Qemu-devel] [PATCH v2 03/15] mc146818rtc: move structure to header file
Date: Sat, 16 Dec 2017 22:29:52 +0100	[thread overview]
Message-ID: <20171216213004.30393-4-hpoussin@reactos.org> (raw)
In-Reply-To: <20171216213004.30393-1-hpoussin@reactos.org>

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

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
---
 hw/timer/mc146818rtc.c         | 30 ------------------------------
 include/hw/timer/mc146818rtc.h | 29 +++++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 30 deletions(-)

diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c
index 7764be25ec..73d1ce21de 100644
--- a/hw/timer/mc146818rtc.c
+++ b/hw/timer/mc146818rtc.c
@@ -62,36 +62,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_RTC)
-
-typedef struct RTCState {
-    ISADevice parent_obj;
-
-    MemoryRegion 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;
-
 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 7c8e64b203..d7b2aa6b13 100644
--- a/include/hw/timer/mc146818rtc.h
+++ b/include/hw/timer/mc146818rtc.h
@@ -5,6 +5,35 @@
 #include "hw/timer/mc146818rtc_regs.h"
 
 #define TYPE_MC146818_RTC "mc146818rtc"
+#define MC146818_RTC(obj) OBJECT_CHECK(RTCState, (obj), TYPE_MC146818_RTC)
+
+typedef struct RTCState {
+    ISADevice parent_obj;
+
+    MemoryRegion 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 *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq);
 void rtc_set_memory(ISADevice *dev, int addr, int val);
-- 
2.11.0

  parent reply	other threads:[~2017-12-16 21:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-16 21:29 [Qemu-devel] [PATCH 00/15] piix4: cleanup and improvements Hervé Poussineau
2017-12-16 21:29 ` [Qemu-devel] [PATCH v2 01/15] fdc: move object structures to header file Hervé Poussineau
2017-12-16 21:29 ` [Qemu-devel] [PATCH v2 02/15] serial/parallel: " Hervé Poussineau
2017-12-16 21:29 ` Hervé Poussineau [this message]
2017-12-16 21:29 ` [Qemu-devel] [PATCH v2 04/15] mc146818rtc: always register rtc to rtc list Hervé Poussineau
2017-12-16 21:29 ` [Qemu-devel] [PATCH v2 05/15] piix4: rename some variables in realize function Hervé Poussineau
2017-12-16 21:29 ` [Qemu-devel] [PATCH v2 06/15] piix4: add Reset Control Register Hervé Poussineau
2017-12-16 21:29 ` [Qemu-devel] [PATCH v2 07/15] piix4: add a i8259 interrupt controller as specified in datasheet Hervé Poussineau
2017-12-16 21:29 ` [Qemu-devel] [PATCH v2 08/15] piix4: add a i8257 dma " Hervé Poussineau
2017-12-16 21:29 ` [Qemu-devel] [PATCH v2 09/15] piix4: add a i8254 pit " Hervé Poussineau
2017-12-16 21:29 ` [Qemu-devel] [PATCH v2 10/15] piix4: add a i8042 keyboard/mouse " Hervé Poussineau
2017-12-16 21:30 ` [Qemu-devel] [PATCH v2 11/15] piix4: add a floppy controller, 1 parallel port and 2 serial ports Hervé Poussineau
2017-12-16 21:30 ` [Qemu-devel] [PATCH v2 12/15] piix4: add a mc146818rtc controller as specified in datasheet Hervé Poussineau
2017-12-16 21:30 ` [Qemu-devel] [PATCH v2 13/15] piix4: add a speaker " Hervé Poussineau
2017-12-16 21:30 ` [Qemu-devel] [PATCH v2 14/15] piix4: rename PIIX4 object to piix4-isa Hervé Poussineau
2017-12-17  1:14   ` Philippe Mathieu-Daudé
2017-12-16 21:30 ` [Qemu-devel] [PATCH v2 15/15] piix4: we can now instanciate a PIIX4 with -device Hervé Poussineau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171216213004.30393-4-hpoussin@reactos.org \
    --to=hpoussin@reactos.org \
    --cc=aurelien@aurel32.net \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yongbok.kim@mips.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.