mirror of https://github.com/xemu-project/xemu.git
sun4m: QOM cast cleanup for RamDevice
Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
e6f54c9175
commit
5ab6b4c661
|
@ -739,9 +739,12 @@ static const TypeInfo prom_info = {
|
||||||
.class_init = prom_class_init,
|
.class_init = prom_class_init,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct RamDevice
|
#define TYPE_SUN4M_MEMORY "memory"
|
||||||
{
|
#define SUN4M_RAM(obj) OBJECT_CHECK(RamDevice, (obj), TYPE_SUN4M_MEMORY)
|
||||||
SysBusDevice busdev;
|
|
||||||
|
typedef struct RamDevice {
|
||||||
|
SysBusDevice parent_obj;
|
||||||
|
|
||||||
MemoryRegion ram;
|
MemoryRegion ram;
|
||||||
uint64_t size;
|
uint64_t size;
|
||||||
} RamDevice;
|
} RamDevice;
|
||||||
|
@ -749,7 +752,7 @@ typedef struct RamDevice
|
||||||
/* System RAM */
|
/* System RAM */
|
||||||
static int ram_init1(SysBusDevice *dev)
|
static int ram_init1(SysBusDevice *dev)
|
||||||
{
|
{
|
||||||
RamDevice *d = FROM_SYSBUS(RamDevice, dev);
|
RamDevice *d = SUN4M_RAM(dev);
|
||||||
|
|
||||||
memory_region_init_ram(&d->ram, OBJECT(d), "sun4m.ram", d->size);
|
memory_region_init_ram(&d->ram, OBJECT(d), "sun4m.ram", d->size);
|
||||||
vmstate_register_ram_global(&d->ram);
|
vmstate_register_ram_global(&d->ram);
|
||||||
|
@ -775,7 +778,7 @@ static void ram_init(hwaddr addr, ram_addr_t RAM_size,
|
||||||
dev = qdev_create(NULL, "memory");
|
dev = qdev_create(NULL, "memory");
|
||||||
s = SYS_BUS_DEVICE(dev);
|
s = SYS_BUS_DEVICE(dev);
|
||||||
|
|
||||||
d = FROM_SYSBUS(RamDevice, s);
|
d = SUN4M_RAM(dev);
|
||||||
d->size = RAM_size;
|
d->size = RAM_size;
|
||||||
qdev_init_nofail(dev);
|
qdev_init_nofail(dev);
|
||||||
|
|
||||||
|
@ -797,7 +800,7 @@ static void ram_class_init(ObjectClass *klass, void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo ram_info = {
|
static const TypeInfo ram_info = {
|
||||||
.name = "memory",
|
.name = TYPE_SUN4M_MEMORY,
|
||||||
.parent = TYPE_SYS_BUS_DEVICE,
|
.parent = TYPE_SYS_BUS_DEVICE,
|
||||||
.instance_size = sizeof(RamDevice),
|
.instance_size = sizeof(RamDevice),
|
||||||
.class_init = ram_class_init,
|
.class_init = ram_class_init,
|
||||||
|
|
Loading…
Reference in New Issue