qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 06/12] hw/block/fdc-isa: Expose struct FDCtrlISABus


From: Bernhard Beschow
Subject: [PATCH 06/12] hw/block/fdc-isa: Expose struct FDCtrlISABus
Date: Sun, 17 Dec 2023 15:41:42 +0100

Exposing device structs in headers is encuraged by qdev guidelines.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 include/hw/block/fdc-isa.h | 15 +++++++++++++++
 hw/block/fdc-isa.c         | 17 -----------------
 2 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/include/hw/block/fdc-isa.h b/include/hw/block/fdc-isa.h
index 42abd001dd..965c749c96 100644
--- a/include/hw/block/fdc-isa.h
+++ b/include/hw/block/fdc-isa.h
@@ -3,9 +3,24 @@
 
 #include "exec/hwaddr.h"
 #include "qapi/qapi-types-block.h"
+#include "hw/block/fdc.h"
+#include "hw/isa/isa.h"
 
 #define TYPE_ISA_FDC "isa-fdc"
 
+OBJECT_DECLARE_SIMPLE_TYPE(FDCtrlISABus, ISA_FDC)
+
+struct FDCtrlISABus {
+    ISADevice parent_obj;
+
+    uint32_t iobase;
+    uint32_t irq;
+    uint32_t dma;
+    FDCtrl state;
+    int32_t bootindexA;
+    int32_t bootindexB;
+};
+
 void isa_fdc_init_drives(ISADevice *fdc, DriveInfo **fds);
 void fdctrl_init_sysbus(qemu_irq irq, hwaddr mmio_base, DriveInfo **fds);
 void sun4m_fdctrl_init(qemu_irq irq, hwaddr io_base,
diff --git a/hw/block/fdc-isa.c b/hw/block/fdc-isa.c
index 7058d4118f..090dc03381 100644
--- a/hw/block/fdc-isa.c
+++ b/hw/block/fdc-isa.c
@@ -34,12 +34,10 @@
 #include "qemu/timer.h"
 #include "hw/acpi/acpi_aml_interface.h"
 #include "hw/irq.h"
-#include "hw/isa/isa.h"
 #include "hw/qdev-properties.h"
 #include "hw/qdev-properties-system.h"
 #include "migration/vmstate.h"
 #include "hw/block/block.h"
-#include "hw/block/fdc.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"
 #include "sysemu/sysemu.h"
@@ -49,21 +47,6 @@
 #include "trace.h"
 #include "qom/object.h"
 
-OBJECT_DECLARE_SIMPLE_TYPE(FDCtrlISABus, ISA_FDC)
-
-struct FDCtrlISABus {
-    /*< private >*/
-    ISADevice parent_obj;
-    /*< public >*/
-
-    uint32_t iobase;
-    uint32_t irq;
-    uint32_t dma;
-    struct FDCtrl state;
-    int32_t bootindexA;
-    int32_t bootindexB;
-};
-
 static void fdctrl_external_reset_isa(DeviceState *d)
 {
     FDCtrlISABus *isa = ISA_FDC(d);
-- 
2.43.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]