[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 17/53] i8254: Move PITCommonState/PITCommonClass typedefs to i8254
From: |
Eduardo Habkost |
Subject: |
[PULL 17/53] i8254: Move PITCommonState/PITCommonClass typedefs to i8254.h |
Date: |
Thu, 27 Aug 2020 15:20:46 -0400 |
Move typedef closer to the type check macros, to make it easier
to convert the code to OBJECT_DEFINE_TYPE() in the future.
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Tested-By: Roman Bolshakov <r.bolshakov@yadro.com>
Message-Id: <20200825192110.3528606-19-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
include/hw/timer/i8254.h | 2 ++
include/hw/timer/i8254_internal.h | 8 ++++----
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/include/hw/timer/i8254.h b/include/hw/timer/i8254.h
index e75b4a5a08..206b8f8464 100644
--- a/include/hw/timer/i8254.h
+++ b/include/hw/timer/i8254.h
@@ -39,6 +39,8 @@ typedef struct PITChannelInfo {
} PITChannelInfo;
#define TYPE_PIT_COMMON "pit-common"
+typedef struct PITCommonState PITCommonState;
+typedef struct PITCommonClass PITCommonClass;
#define PIT_COMMON(obj) \
OBJECT_CHECK(PITCommonState, (obj), TYPE_PIT_COMMON)
#define PIT_COMMON_CLASS(klass) \
diff --git a/include/hw/timer/i8254_internal.h
b/include/hw/timer/i8254_internal.h
index 3db462aecd..a9a600d941 100644
--- a/include/hw/timer/i8254_internal.h
+++ b/include/hw/timer/i8254_internal.h
@@ -50,14 +50,14 @@ typedef struct PITChannelState {
uint32_t irq_disabled;
} PITChannelState;
-typedef struct PITCommonState {
+struct PITCommonState {
ISADevice dev;
MemoryRegion ioports;
uint32_t iobase;
PITChannelState channels[3];
-} PITCommonState;
+};
-typedef struct PITCommonClass {
+struct PITCommonClass {
ISADeviceClass parent_class;
void (*set_channel_gate)(PITCommonState *s, PITChannelState *sc, int val);
@@ -65,7 +65,7 @@ typedef struct PITCommonClass {
PITChannelInfo *info);
void (*pre_save)(PITCommonState *s);
void (*post_load)(PITCommonState *s);
-} PITCommonClass;
+};
int pit_get_out(PITChannelState *s, int64_t current_time);
int64_t pit_get_next_transition_time(PITChannelState *s, int64_t current_time);
--
2.26.2
- [PULL 05/53] pl110: Rename pl110_version enum values, (continued)
- [PULL 05/53] pl110: Rename pl110_version enum values, Eduardo Habkost, 2020/08/27
- [PULL 06/53] allwinner-h3: Rename memmap enum constants, Eduardo Habkost, 2020/08/27
- [PULL 09/53] aspeed_timer: Fix ASPEED_TIMER macro definition, Eduardo Habkost, 2020/08/27
- [PULL 08/53] opentitan: Rename memmap enum constants, Eduardo Habkost, 2020/08/27
- [PULL 10/53] versatile: Fix typo in PCI_VPB_HOST definition, Eduardo Habkost, 2020/08/27
- [PULL 07/53] aspeed_soc: Rename memmap/irqmap enum constants, Eduardo Habkost, 2020/08/27
- [PULL 11/53] virtio-ccw: Fix definition of VIRTIO_CCW_BUS_GET_CLASS, Eduardo Habkost, 2020/08/27
- [PULL 12/53] hvf: Add missing include, Eduardo Habkost, 2020/08/27
- [PULL 14/53] tulip: Move TulipState typedef to header, Eduardo Habkost, 2020/08/27
- [PULL 15/53] throttle-groups: Move ThrottleGroup typedef to header, Eduardo Habkost, 2020/08/27
- [PULL 17/53] i8254: Move PITCommonState/PITCommonClass typedefs to i8254.h,
Eduardo Habkost <=
- [PULL 19/53] mcf_fec: Move mcf_fec_state typedef to header, Eduardo Habkost, 2020/08/27
- [PULL 13/53] hcd-dwc2: Rename USB_*CLASS macros for consistency, Eduardo Habkost, 2020/08/27
- [PULL 16/53] pci: Move PCIBusClass typedef to pci.h, Eduardo Habkost, 2020/08/27
- [PULL 18/53] hvf: Move HVFState typedef to hvf.h, Eduardo Habkost, 2020/08/27
- [PULL 20/53] s390_flic: Move KVMS390FLICState typedef to header, Eduardo Habkost, 2020/08/27
- [PULL 22/53] nubus: Delete unused NUBUS_BRIDGE macro, Eduardo Habkost, 2020/08/27
- [PULL 21/53] can_emu: Delete macros for non-existing typedef, Eduardo Habkost, 2020/08/27
- [PULL 23/53] platform-bus: Delete macros for non-existing typedef, Eduardo Habkost, 2020/08/27
- [PULL 25/53] xen-legacy-backend: Add missing typedef XenLegacyDevice, Eduardo Habkost, 2020/08/27
- [PULL 26/53] spapr: Move typedef SpaprMachineState to spapr.h, Eduardo Habkost, 2020/08/27