From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sbi8h-0001Kg-OF for qemu-devel@nongnu.org; Mon, 04 Jun 2012 21:00:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sbi8f-0002ru-DG for qemu-devel@nongnu.org; Mon, 04 Jun 2012 21:00:51 -0400 Received: from mail-pz0-f45.google.com ([209.85.210.45]:39431) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sbi8e-0002oW-Sc for qemu-devel@nongnu.org; Mon, 04 Jun 2012 21:00:49 -0400 Received: by mail-pz0-f45.google.com with SMTP id v2so7118161dad.4 for ; Mon, 04 Jun 2012 18:00:48 -0700 (PDT) Sender: fluxion From: Michael Roth Date: Mon, 4 Jun 2012 20:00:09 -0500 Message-Id: <1338858018-17189-9-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1338858018-17189-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1338858018-17189-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 08/17] rtc: move RTCState declaration to header List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, quintela@redhat.com, owasserm@redhat.com, yamahata@valinux.co.jp, pbonzini@redhat.com, akong@redhat.com, afaerber@suse.de We need these definitions in a header file since the generated visitors need to know the struct definitions to do their job. This also reduces the amount of code we need to feed into the QIDL compiler once we annotate it. Signed-off-by: Michael Roth --- hw/mc146818rtc.c | 27 +-------------------------- hw/mc146818rtc_state.h | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 26 deletions(-) create mode 100644 hw/mc146818rtc_state.h diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c index 3777f85..7490d28 100644 --- a/hw/mc146818rtc.c +++ b/hw/mc146818rtc.c @@ -25,6 +25,7 @@ #include "qemu-timer.h" #include "sysemu.h" #include "mc146818rtc.h" +#include "mc146818rtc_state.h" #ifdef TARGET_I386 #include "apic.h" @@ -47,32 +48,6 @@ #define RTC_REINJECT_ON_ACK_COUNT 20 -typedef struct RTCState { - ISADevice dev; - MemoryRegion io; - uint8_t cmos_data[128]; - uint8_t cmos_index; - struct tm current_tm; - int32_t base_year; - qemu_irq irq; - qemu_irq sqw_irq; - int it_shift; - /* periodic timer */ - QEMUTimer *periodic_timer; - int64_t next_periodic_time; - /* second update */ - int64_t next_second_time; - uint16_t irq_reinject_on_ack_count; - uint32_t irq_coalesced; - uint32_t period; - QEMUTimer *coalesced_timer; - QEMUTimer *second_timer; - QEMUTimer *second_timer2; - Notifier clock_reset_notifier; - LostTickPolicy lost_tick_policy; - Notifier suspend_notifier; -} RTCState; - static void rtc_set_time(RTCState *s); static void rtc_copy_date(RTCState *s); diff --git a/hw/mc146818rtc_state.h b/hw/mc146818rtc_state.h new file mode 100644 index 0000000..f819e15 --- /dev/null +++ b/hw/mc146818rtc_state.h @@ -0,0 +1,32 @@ +#ifndef MC146818RTC_STATE_H +#define MC146818RTC_STATE_H + +#include "isa.h" + +typedef struct RTCState { + ISADevice dev; + MemoryRegion io; + uint8_t cmos_data[128]; + uint8_t cmos_index; + struct tm current_tm; + int32_t base_year; + qemu_irq irq; + qemu_irq sqw_irq; + int it_shift; + /* periodic timer */ + QEMUTimer *periodic_timer; + int64_t next_periodic_time; + /* second update */ + int64_t next_second_time; + uint16_t irq_reinject_on_ack_count; + uint32_t irq_coalesced; + uint32_t period; + QEMUTimer *coalesced_timer; + QEMUTimer *second_timer; + QEMUTimer *second_timer2; + Notifier clock_reset_notifier; + LostTickPolicy lost_tick_policy; + Notifier suspend_notifier; +} RTCState; + +#endif /* !MC146818RTC_STATE_H */ -- 1.7.4.1