Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
adlib_portio_list[1].offset = s->port;
adlib_portio_list[2].offset = s->port + 8;
adlib_portio_list[1].offset = s->port;
adlib_portio_list[2].offset = s->port + 8;
- portio_list_init (port_list, adlib_portio_list, s, "adlib");
+ portio_list_init (port_list, OBJECT(s), adlib_portio_list, s, "adlib");
portio_list_add (port_list, isa_address_space_io(&s->parent_obj), 0);
}
portio_list_add (port_list, isa_address_space_io(&s->parent_obj), 0);
}
vga_common_init(vga, OBJECT(dev));
vga_init(vga, OBJECT(dev),
pci_address_space(dev), pci_address_space_io(dev), false);
vga_common_init(vga, OBJECT(dev));
vga_init(vga, OBJECT(dev),
pci_address_space(dev), pci_address_space_io(dev), false);
- portio_list_init(qxl_vga_port_list, qxl_vga_portio_list, vga, "vga");
+ portio_list_init(qxl_vga_port_list, OBJECT(dev), qxl_vga_portio_list,
+ vga, "vga");
portio_list_add(qxl_vga_port_list, pci_address_space_io(dev), 0x3b0);
vga->con = graphic_console_init(DEVICE(dev), &qxl_ops, qxl);
portio_list_add(qxl_vga_port_list, pci_address_space_io(dev), 0x3b0);
vga->con = graphic_console_init(DEVICE(dev), &qxl_ops, qxl);
1);
memory_region_set_coalescing(vga_io_memory);
if (init_vga_ports) {
1);
memory_region_set_coalescing(vga_io_memory);
if (init_vga_ports) {
- portio_list_init(vga_port_list, vga_ports, s, "vga");
+ portio_list_init(vga_port_list, obj, vga_ports, s, "vga");
portio_list_add(vga_port_list, address_space_io, 0x3b0);
}
if (vbe_ports) {
portio_list_add(vga_port_list, address_space_io, 0x3b0);
}
if (vbe_ports) {
- portio_list_init(vbe_port_list, vbe_ports, s, "vbe");
+ portio_list_init(vbe_port_list, obj, vbe_ports, s, "vbe");
portio_list_add(vbe_port_list, address_space_io, 0x1ce);
}
}
portio_list_add(vbe_port_list, address_space_io, 0x1ce);
}
}
I82374State *s = &isa->state;
PortioList *port_list = g_new(PortioList, 1);
I82374State *s = &isa->state;
PortioList *port_list = g_new(PortioList, 1);
- portio_list_init(port_list, i82374_portio_list, s, "i82374");
+ portio_list_init(port_list, OBJECT(isa), i82374_portio_list, s, "i82374");
portio_list_add(port_list, isa_address_space_io(&isa->parent_obj),
isa->iobase);
portio_list_add(port_list, isa_address_space_io(&isa->parent_obj),
isa->iobase);
actually handled e.g. the FDC device. */
isa_init_ioport(dev, start);
actually handled e.g. the FDC device. */
isa_init_ioport(dev, start);
- portio_list_init(piolist, pio_start, opaque, name);
+ portio_list_init(piolist, OBJECT(dev), pio_start, opaque, name);
portio_list_add(piolist, isabus->address_space_io, start);
}
portio_list_add(piolist, isabus->address_space_io, start);
}
- memory_region_init_io(&vt82c->superio, NULL, &superio_ops,
+ memory_region_init_io(&vt82c->superio, OBJECT(d), &superio_ops,
&vt82c->superio_conf, "superio", 2);
memory_region_set_enabled(&vt82c->superio, false);
/* The floppy also uses 0x3f0 and 0x3f1.
&vt82c->superio_conf, "superio", 2);
memory_region_set_enabled(&vt82c->superio, false);
/* The floppy also uses 0x3f0 and 0x3f1.
sysctrl->reset_irq = first_cpu->irq_inputs[PPC6xx_INPUT_HRESET];
sysctrl->reset_irq = first_cpu->irq_inputs[PPC6xx_INPUT_HRESET];
- portio_list_init(port_list, prep_portio_list, sysctrl, "prep");
+ portio_list_init(port_list, NULL, prep_portio_list, sysctrl, "prep");
portio_list_add(port_list, get_system_io(), 0x0);
/* PowerPC control and status register group */
portio_list_add(port_list, get_system_io(), 0x0);
/* PowerPC control and status register group */
s->timer = qemu_new_timer_ns(vm_clock, ib700_timer_expired, s);
s->timer = qemu_new_timer_ns(vm_clock, ib700_timer_expired, s);
- portio_list_init(port_list, wdt_portio_list, s, "ib700");
+ portio_list_init(port_list, OBJECT(s), wdt_portio_list, s, "ib700");
portio_list_add(port_list, isa_address_space_io(&s->parent_obj), 0);
}
portio_list_add(port_list, isa_address_space_io(&s->parent_obj), 0);
}
#define IOPORT_H
#include "qemu-common.h"
#define IOPORT_H
#include "qemu-common.h"
#include "exec/memory.h"
typedef uint32_t pio_addr_t;
#include "exec/memory.h"
typedef uint32_t pio_addr_t;
typedef struct PortioList {
const struct MemoryRegionPortio *ports;
typedef struct PortioList {
const struct MemoryRegionPortio *ports;
struct MemoryRegion *address_space;
unsigned nr;
struct MemoryRegion **regions;
struct MemoryRegion *address_space;
unsigned nr;
struct MemoryRegion **regions;
const char *name;
} PortioList;
const char *name;
} PortioList;
-void portio_list_init(PortioList *piolist,
+void portio_list_init(PortioList *piolist, Object *owner,
const struct MemoryRegionPortio *callbacks,
void *opaque, const char *name);
void portio_list_destroy(PortioList *piolist);
const struct MemoryRegionPortio *callbacks,
void *opaque, const char *name);
void portio_list_destroy(PortioList *piolist);
}
void portio_list_init(PortioList *piolist,
}
void portio_list_init(PortioList *piolist,
const MemoryRegionPortio *callbacks,
void *opaque, const char *name)
{
const MemoryRegionPortio *callbacks,
void *opaque, const char *name)
{
piolist->regions = g_new0(MemoryRegion *, n);
piolist->address_space = NULL;
piolist->opaque = opaque;
piolist->regions = g_new0(MemoryRegion *, n);
piolist->address_space = NULL;
piolist->opaque = opaque;
+ piolist->owner = owner;
* Use an alias so that the callback is called with an absolute address,
* rather than an offset relative to to start + off_low.
*/
* Use an alias so that the callback is called with an absolute address,
* rather than an offset relative to to start + off_low.
*/
- memory_region_init_io(&mrpio->mr, NULL, &portio_ops, mrpio, piolist->name,
- off_high - off_low);
+ memory_region_init_io(&mrpio->mr, piolist->owner, &portio_ops, mrpio,
+ piolist->name, off_high - off_low);
memory_region_add_subregion(piolist->address_space,
start + off_low, &mrpio->mr);
piolist->regions[piolist->nr] = &mrpio->mr;
memory_region_add_subregion(piolist->address_space,
start + off_low, &mrpio->mr);
piolist->regions[piolist->nr] = &mrpio->mr;