aboutsummaryrefslogtreecommitdiff
path: root/hw/block/fdc.c
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2020-09-03 16:43:22 -0400
committerEduardo Habkost <ehabkost@redhat.com>2020-09-09 09:26:43 -0400
commitdb1015e92e04835c9eb50c29625fe566d1202dbd (patch)
tree41fbc0bf3e3f29b7ecb339224a049e3f2a7db8fa /hw/block/fdc.c
parent1c8eef0227e2942264063f22f10a06b84e0d3fa9 (diff)
Move QOM typedefs and add missing includes
Some typedefs and macros are defined after the type check macros. This makes it difficult to automatically replace their definitions with OBJECT_DECLARE_TYPE. Patch generated using: $ ./scripts/codeconverter/converter.py -i \ --pattern=QOMStructTypedefSplit $(git grep -l '' -- '*.[ch]') which will split "typdef struct { ... } TypedefName" declarations. Followed by: $ ./scripts/codeconverter/converter.py -i --pattern=MoveSymbols \ $(git grep -l '' -- '*.[ch]') which will: - move the typedefs and #defines above the type check macros - add missing #include "qom/object.h" lines if necessary Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-9-ehabkost@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-10-ehabkost@redhat.com> Message-Id: <20200831210740.126168-11-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/block/fdc.c')
-rw-r--r--hw/block/fdc.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index e9ed3eef45..70bfb136e4 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -46,6 +46,7 @@
#include "qemu/main-loop.h"
#include "qemu/module.h"
#include "trace.h"
+#include "qom/object.h"
/********************************************************/
/* debug Floppy devices */
@@ -64,16 +65,17 @@
/* qdev floppy bus */
#define TYPE_FLOPPY_BUS "floppy-bus"
+typedef struct FloppyBus FloppyBus;
#define FLOPPY_BUS(obj) OBJECT_CHECK(FloppyBus, (obj), TYPE_FLOPPY_BUS)
typedef struct FDCtrl FDCtrl;
typedef struct FDrive FDrive;
static FDrive *get_drv(FDCtrl *fdctrl, int unit);
-typedef struct FloppyBus {
+struct FloppyBus {
BusState bus;
FDCtrl *fdc;
-} FloppyBus;
+};
static const TypeInfo floppy_bus_info = {
.name = TYPE_FLOPPY_BUS,
@@ -494,15 +496,16 @@ static const BlockDevOps fd_block_ops = {
#define TYPE_FLOPPY_DRIVE "floppy"
+typedef struct FloppyDrive FloppyDrive;
#define FLOPPY_DRIVE(obj) \
OBJECT_CHECK(FloppyDrive, (obj), TYPE_FLOPPY_DRIVE)
-typedef struct FloppyDrive {
+struct FloppyDrive {
DeviceState qdev;
uint32_t unit;
BlockConf conf;
FloppyDriveType type;
-} FloppyDrive;
+};
static Property floppy_drive_properties[] = {
DEFINE_PROP_UINT32("unit", FloppyDrive, unit, -1),
@@ -886,19 +889,21 @@ static FloppyDriveType get_fallback_drive_type(FDrive *drv)
}
#define TYPE_SYSBUS_FDC "base-sysbus-fdc"
+typedef struct FDCtrlSysBus FDCtrlSysBus;
#define SYSBUS_FDC(obj) OBJECT_CHECK(FDCtrlSysBus, (obj), TYPE_SYSBUS_FDC)
-typedef struct FDCtrlSysBus {
+struct FDCtrlSysBus {
/*< private >*/
SysBusDevice parent_obj;
/*< public >*/
struct FDCtrl state;
-} FDCtrlSysBus;
+};
+typedef struct FDCtrlISABus FDCtrlISABus;
#define ISA_FDC(obj) OBJECT_CHECK(FDCtrlISABus, (obj), TYPE_ISA_FDC)
-typedef struct FDCtrlISABus {
+struct FDCtrlISABus {
ISADevice parent_obj;
uint32_t iobase;
@@ -907,7 +912,7 @@ typedef struct FDCtrlISABus {
struct FDCtrl state;
int32_t bootindexA;
int32_t bootindexB;
-} FDCtrlISABus;
+};
static uint32_t fdctrl_read (void *opaque, uint32_t reg)
{