Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
q800: move SWIM device to Q800MachineState
Also change the instantiation of the SWIM device to use object_initialize_child().

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20230621085353.113233-20-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
  • Loading branch information
mcayland authored and vivier committed Jun 22, 2023
1 parent e78d17c commit 01f35a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 5 additions & 3 deletions hw/m68k/q800.c
Expand Up @@ -406,10 +406,12 @@ static void q800_machine_init(MachineState *machine)

/* SWIM floppy controller */

dev = qdev_new(TYPE_SWIM);
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
object_initialize_child(OBJECT(machine), "swim", &m->swim,
TYPE_SWIM);
sysbus = SYS_BUS_DEVICE(&m->swim);
sysbus_realize(sysbus, &error_fatal);
memory_region_add_subregion(&m->macio, SWIM_BASE - IO_BASE,
sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0));
sysbus_mmio_get_region(sysbus, 0));

/* NuBus */

Expand Down
2 changes: 2 additions & 0 deletions include/hw/m68k/q800.h
Expand Up @@ -33,6 +33,7 @@
#include "hw/char/escc.h"
#include "hw/or-irq.h"
#include "hw/scsi/esp.h"
#include "hw/block/swim.h"

/*
* The main Q800 machine
Expand All @@ -50,6 +51,7 @@ struct Q800MachineState {
ESCCState escc;
OrIRQState escc_orgate;
SysBusESPState esp;
Swim swim;
MemoryRegion macio;
MemoryRegion macio_alias;
};
Expand Down

0 comments on commit 01f35a4

Please sign in to comment.