hw/t*: pass owner to memory_region_init* functions
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
2977673992
commit
853dca1205
@ -236,14 +236,14 @@ static int arm_mptimer_init(SysBusDevice *dev)
|
||||
* * timer for core 1
|
||||
* and so on.
|
||||
*/
|
||||
memory_region_init_io(&s->iomem, NULL, &arm_thistimer_ops, s,
|
||||
memory_region_init_io(&s->iomem, OBJECT(s), &arm_thistimer_ops, s,
|
||||
"arm_mptimer_timer", 0x20);
|
||||
sysbus_init_mmio(dev, &s->iomem);
|
||||
for (i = 0; i < s->num_cpu; i++) {
|
||||
TimerBlock *tb = &s->timerblock[i];
|
||||
tb->timer = qemu_new_timer_ns(vm_clock, timerblock_tick, tb);
|
||||
sysbus_init_irq(dev, &tb->irq);
|
||||
memory_region_init_io(&tb->iomem, NULL, &timerblock_ops, tb,
|
||||
memory_region_init_io(&tb->iomem, OBJECT(s), &timerblock_ops, tb,
|
||||
"arm_mptimer_timerblock", 0x20);
|
||||
sysbus_init_mmio(dev, &tb->iomem);
|
||||
}
|
||||
|
@ -284,7 +284,8 @@ static int sp804_init(SysBusDevice *dev)
|
||||
s->timer[1] = arm_timer_init(s->freq1);
|
||||
s->timer[0]->irq = qi[0];
|
||||
s->timer[1]->irq = qi[1];
|
||||
memory_region_init_io(&s->iomem, NULL, &sp804_ops, s, "sp804", 0x1000);
|
||||
memory_region_init_io(&s->iomem, OBJECT(s), &sp804_ops, s,
|
||||
"sp804", 0x1000);
|
||||
sysbus_init_mmio(dev, &s->iomem);
|
||||
vmstate_register(&dev->qdev, -1, &vmstate_sp804, s);
|
||||
return 0;
|
||||
@ -347,7 +348,8 @@ static int icp_pit_init(SysBusDevice *dev)
|
||||
sysbus_init_irq(dev, &s->timer[1]->irq);
|
||||
sysbus_init_irq(dev, &s->timer[2]->irq);
|
||||
|
||||
memory_region_init_io(&s->iomem, NULL, &icp_pit_ops, s, "icp_pit", 0x1000);
|
||||
memory_region_init_io(&s->iomem, OBJECT(s), &icp_pit_ops, s,
|
||||
"icp_pit", 0x1000);
|
||||
sysbus_init_mmio(dev, &s->iomem);
|
||||
/* This device has no state to save/restore. The component timers will
|
||||
save themselves. */
|
||||
|
@ -409,7 +409,8 @@ static int cadence_ttc_init(SysBusDevice *dev)
|
||||
sysbus_init_irq(dev, &s->timer[i].irq);
|
||||
}
|
||||
|
||||
memory_region_init_io(&s->iomem, NULL, &cadence_ttc_ops, s, "timer", 0x1000);
|
||||
memory_region_init_io(&s->iomem, OBJECT(s), &cadence_ttc_ops, s,
|
||||
"timer", 0x1000);
|
||||
sysbus_init_mmio(dev, &s->iomem);
|
||||
|
||||
return 0;
|
||||
|
@ -323,7 +323,8 @@ static int etraxfs_timer_init(SysBusDevice *dev)
|
||||
sysbus_init_irq(dev, &t->irq);
|
||||
sysbus_init_irq(dev, &t->nmi);
|
||||
|
||||
memory_region_init_io(&t->mmio, NULL, &timer_ops, t, "etraxfs-timer", 0x5c);
|
||||
memory_region_init_io(&t->mmio, OBJECT(t), &timer_ops, t,
|
||||
"etraxfs-timer", 0x5c);
|
||||
sysbus_init_mmio(dev, &t->mmio);
|
||||
qemu_register_reset(etraxfs_timer_reset, t);
|
||||
return 0;
|
||||
|
@ -1449,8 +1449,8 @@ static int exynos4210_mct_init(SysBusDevice *dev)
|
||||
sysbus_init_irq(dev, &s->l_timer[i].irq);
|
||||
}
|
||||
|
||||
memory_region_init_io(&s->iomem, NULL, &exynos4210_mct_ops, s, "exynos4210-mct",
|
||||
MCT_SFR_SIZE);
|
||||
memory_region_init_io(&s->iomem, OBJECT(s), &exynos4210_mct_ops, s,
|
||||
"exynos4210-mct", MCT_SFR_SIZE);
|
||||
sysbus_init_mmio(dev, &s->iomem);
|
||||
|
||||
return 0;
|
||||
|
@ -390,8 +390,8 @@ static int exynos4210_pwm_init(SysBusDevice *dev)
|
||||
s->timer[i].parent = s;
|
||||
}
|
||||
|
||||
memory_region_init_io(&s->iomem, NULL, &exynos4210_pwm_ops, s, "exynos4210-pwm",
|
||||
EXYNOS4210_PWM_REG_MEM_SIZE);
|
||||
memory_region_init_io(&s->iomem, OBJECT(s), &exynos4210_pwm_ops, s,
|
||||
"exynos4210-pwm", EXYNOS4210_PWM_REG_MEM_SIZE);
|
||||
sysbus_init_mmio(dev, &s->iomem);
|
||||
|
||||
return 0;
|
||||
|
@ -559,8 +559,8 @@ static int exynos4210_rtc_init(SysBusDevice *dev)
|
||||
sysbus_init_irq(dev, &s->alm_irq);
|
||||
sysbus_init_irq(dev, &s->tick_irq);
|
||||
|
||||
memory_region_init_io(&s->iomem, NULL, &exynos4210_rtc_ops, s, "exynos4210-rtc",
|
||||
EXYNOS4210_RTC_REG_MEM_SIZE);
|
||||
memory_region_init_io(&s->iomem, OBJECT(s), &exynos4210_rtc_ops, s,
|
||||
"exynos4210-rtc", EXYNOS4210_RTC_REG_MEM_SIZE);
|
||||
sysbus_init_mmio(dev, &s->iomem);
|
||||
|
||||
return 0;
|
||||
|
@ -365,7 +365,8 @@ static int grlib_gptimer_init(SysBusDevice *dev)
|
||||
ptimer_set_freq(timer->ptimer, unit->freq_hz);
|
||||
}
|
||||
|
||||
memory_region_init_io(&unit->iomem, NULL, &grlib_gptimer_ops, unit, "gptimer",
|
||||
memory_region_init_io(&unit->iomem, OBJECT(unit), &grlib_gptimer_ops,
|
||||
unit, "gptimer",
|
||||
UNIT_REG_SIZE + GPTIMER_REG_SIZE * unit->nr_timers);
|
||||
|
||||
sysbus_init_mmio(dev, &unit->iomem);
|
||||
|
@ -722,7 +722,7 @@ static int hpet_init(SysBusDevice *dev)
|
||||
qdev_init_gpio_out(&dev->qdev, &s->pit_enabled, 1);
|
||||
|
||||
/* HPET Area */
|
||||
memory_region_init_io(&s->iomem, NULL, &hpet_ram_ops, s, "hpet", 0x400);
|
||||
memory_region_init_io(&s->iomem, OBJECT(s), &hpet_ram_ops, s, "hpet", 0x400);
|
||||
sysbus_init_mmio(dev, &s->iomem);
|
||||
return 0;
|
||||
}
|
||||
|
@ -333,7 +333,8 @@ static void pit_realizefn(DeviceState *dev, Error **err)
|
||||
s->irq_timer = qemu_new_timer_ns(vm_clock, pit_irq_timer, s);
|
||||
qdev_init_gpio_out(dev, &s->irq, 1);
|
||||
|
||||
memory_region_init_io(&pit->ioports, NULL, &pit_ioport_ops, pit, "pit", 4);
|
||||
memory_region_init_io(&pit->ioports, OBJECT(pit), &pit_ioport_ops,
|
||||
pit, "pit", 4);
|
||||
|
||||
qdev_init_gpio_in(dev, pit_irq_control, 1);
|
||||
|
||||
|
@ -396,7 +396,7 @@ static void imx_epit_realize(DeviceState *dev, Error **errp)
|
||||
DPRINTF("\n");
|
||||
|
||||
sysbus_init_irq(sbd, &s->irq);
|
||||
memory_region_init_io(&s->iomem, NULL, &imx_epit_ops, s, TYPE_IMX_EPIT,
|
||||
memory_region_init_io(&s->iomem, OBJECT(s), &imx_epit_ops, s, TYPE_IMX_EPIT,
|
||||
0x00001000);
|
||||
sysbus_init_mmio(sbd, &s->iomem);
|
||||
|
||||
|
@ -514,7 +514,7 @@ static void imx_gpt_realize(DeviceState *dev, Error **errp)
|
||||
QEMUBH *bh;
|
||||
|
||||
sysbus_init_irq(sbd, &s->irq);
|
||||
memory_region_init_io(&s->iomem, NULL, &imx_gpt_ops, s, TYPE_IMX_GPT,
|
||||
memory_region_init_io(&s->iomem, OBJECT(s), &imx_gpt_ops, s, TYPE_IMX_GPT,
|
||||
0x00001000);
|
||||
sysbus_init_mmio(sbd, &s->iomem);
|
||||
|
||||
|
@ -180,7 +180,8 @@ static int lm32_timer_init(SysBusDevice *dev)
|
||||
s->ptimer = ptimer_init(s->bh);
|
||||
ptimer_set_freq(s->ptimer, s->freq_hz);
|
||||
|
||||
memory_region_init_io(&s->iomem, NULL, &timer_ops, s, "timer", R_MAX * 4);
|
||||
memory_region_init_io(&s->iomem, OBJECT(s), &timer_ops, s,
|
||||
"timer", R_MAX * 4);
|
||||
sysbus_init_mmio(dev, &s->iomem);
|
||||
|
||||
return 0;
|
||||
|
@ -655,7 +655,8 @@ M48t59State *m48t59_init(qemu_irq IRQ, hwaddr mem_base,
|
||||
d = FROM_SYSBUS(M48t59SysBusState, s);
|
||||
state = &d->state;
|
||||
sysbus_connect_irq(s, 0, IRQ);
|
||||
memory_region_init_io(&d->io, NULL, &m48t59_io_ops, state, "m48t59", 4);
|
||||
memory_region_init_io(&d->io, OBJECT(d), &m48t59_io_ops, state,
|
||||
"m48t59", 4);
|
||||
if (io_base != 0) {
|
||||
memory_region_add_subregion(get_system_io(), io_base, &d->io);
|
||||
}
|
||||
@ -683,7 +684,7 @@ M48t59State *m48t59_init_isa(ISABus *bus, uint32_t io_base, uint16_t size,
|
||||
d = ISA_M48T59(isadev);
|
||||
s = &d->state;
|
||||
|
||||
memory_region_init_io(&d->io, NULL, &m48t59_io_ops, s, "m48t59", 4);
|
||||
memory_region_init_io(&d->io, OBJECT(d), &m48t59_io_ops, s, "m48t59", 4);
|
||||
if (io_base != 0) {
|
||||
isa_register_ioport(isadev, &d->io, io_base);
|
||||
}
|
||||
@ -721,7 +722,8 @@ static int m48t59_init1(SysBusDevice *dev)
|
||||
|
||||
sysbus_init_irq(dev, &s->IRQ);
|
||||
|
||||
memory_region_init_io(&s->iomem, NULL, &nvram_ops, s, "m48t59.nvram", s->size);
|
||||
memory_region_init_io(&s->iomem, OBJECT(d), &nvram_ops, s,
|
||||
"m48t59.nvram", s->size);
|
||||
sysbus_init_mmio(dev, &s->iomem);
|
||||
m48t59_realize_common(s, &err);
|
||||
if (err != NULL) {
|
||||
|
@ -863,7 +863,7 @@ static void rtc_realizefn(DeviceState *dev, Error **errp)
|
||||
s->suspend_notifier.notify = rtc_notify_suspend;
|
||||
qemu_register_suspend_notifier(&s->suspend_notifier);
|
||||
|
||||
memory_region_init_io(&s->io, NULL, &cmos_ops, s, "rtc", 2);
|
||||
memory_region_init_io(&s->io, OBJECT(s), &cmos_ops, s, "rtc", 2);
|
||||
isa_register_ioport(isadev, &s->io, base);
|
||||
|
||||
qdev_set_legacy_instance_id(dev, base, 3);
|
||||
|
@ -280,7 +280,7 @@ static int milkymist_sysctl_init(SysBusDevice *dev)
|
||||
ptimer_set_freq(s->ptimer0, s->freq_hz);
|
||||
ptimer_set_freq(s->ptimer1, s->freq_hz);
|
||||
|
||||
memory_region_init_io(&s->regs_region, NULL, &sysctl_mmio_ops, s,
|
||||
memory_region_init_io(&s->regs_region, OBJECT(s), &sysctl_mmio_ops, s,
|
||||
"milkymist-sysctl", R_MAX * 4);
|
||||
sysbus_init_mmio(dev, &s->regs_region);
|
||||
|
||||
|
@ -192,7 +192,7 @@ static int pl031_init(SysBusDevice *dev)
|
||||
pl031_state *s = FROM_SYSBUS(pl031_state, dev);
|
||||
struct tm tm;
|
||||
|
||||
memory_region_init_io(&s->iomem, NULL, &pl031_ops, s, "pl031", 0x1000);
|
||||
memory_region_init_io(&s->iomem, OBJECT(s), &pl031_ops, s, "pl031", 0x1000);
|
||||
sysbus_init_mmio(dev, &s->iomem);
|
||||
|
||||
sysbus_init_irq(dev, &s->irq);
|
||||
|
@ -122,7 +122,7 @@ static int puv3_ost_init(SysBusDevice *dev)
|
||||
s->ptimer = ptimer_init(s->bh);
|
||||
ptimer_set_freq(s->ptimer, 50 * 1000 * 1000);
|
||||
|
||||
memory_region_init_io(&s->iomem, NULL, &puv3_ost_ops, s, "puv3_ost",
|
||||
memory_region_init_io(&s->iomem, OBJECT(s), &puv3_ost_ops, s, "puv3_ost",
|
||||
PUV3_REGS_OFFSET);
|
||||
sysbus_init_mmio(dev, &s->iomem);
|
||||
|
||||
|
@ -461,7 +461,7 @@ static int pxa2xx_timer_init(SysBusDevice *dev)
|
||||
}
|
||||
}
|
||||
|
||||
memory_region_init_io(&s->iomem, NULL, &pxa2xx_timer_ops, s,
|
||||
memory_region_init_io(&s->iomem, OBJECT(s), &pxa2xx_timer_ops, s,
|
||||
"pxa2xx-timer", 0x00001000);
|
||||
sysbus_init_mmio(dev, &s->iomem);
|
||||
|
||||
|
@ -394,7 +394,7 @@ static int slavio_timer_init1(SysBusDevice *dev)
|
||||
|
||||
size = i == 0 ? SYS_TIMER_SIZE : CPU_TIMER_SIZE;
|
||||
snprintf(timer_name, sizeof(timer_name), "timer-%i", i);
|
||||
memory_region_init_io(&tc->iomem, NULL, &slavio_timer_mem_ops, tc,
|
||||
memory_region_init_io(&tc->iomem, OBJECT(s), &slavio_timer_mem_ops, tc,
|
||||
timer_name, size);
|
||||
sysbus_init_mmio(dev, &tc->iomem);
|
||||
|
||||
|
@ -779,8 +779,8 @@ static int tusb6010_init(SysBusDevice *dev)
|
||||
TUSBState *s = FROM_SYSBUS(TUSBState, dev);
|
||||
s->otg_timer = qemu_new_timer_ns(vm_clock, tusb_otg_tick, s);
|
||||
s->pwr_timer = qemu_new_timer_ns(vm_clock, tusb_power_tick, s);
|
||||
memory_region_init_io(&s->iomem[1], NULL, &tusb_async_ops, s, "tusb-async",
|
||||
UINT32_MAX);
|
||||
memory_region_init_io(&s->iomem[1], OBJECT(s), &tusb_async_ops, s,
|
||||
"tusb-async", UINT32_MAX);
|
||||
sysbus_init_mmio(dev, &s->iomem[0]);
|
||||
sysbus_init_mmio(dev, &s->iomem[1]);
|
||||
sysbus_init_irq(dev, &s->irq);
|
||||
|
@ -218,7 +218,7 @@ static int xilinx_timer_init(SysBusDevice *dev)
|
||||
ptimer_set_freq(xt->ptimer, t->freq_hz);
|
||||
}
|
||||
|
||||
memory_region_init_io(&t->mmio, NULL, &timer_ops, t, "xlnx.xps-timer",
|
||||
memory_region_init_io(&t->mmio, OBJECT(t), &timer_ops, t, "xlnx.xps-timer",
|
||||
R_MAX * 4 * num_timers(t));
|
||||
sysbus_init_mmio(dev, &t->mmio);
|
||||
return 0;
|
||||
|
@ -888,7 +888,8 @@ static void tpm_tis_initfn(Object *obj)
|
||||
ISADevice *dev = ISA_DEVICE(obj);
|
||||
TPMState *s = TPM(obj);
|
||||
|
||||
memory_region_init_io(&s->mmio, NULL, &tpm_tis_memory_ops, s, "tpm-tis-mmio",
|
||||
memory_region_init_io(&s->mmio, OBJECT(s), &tpm_tis_memory_ops,
|
||||
s, "tpm-tis-mmio",
|
||||
TPM_TIS_NUM_LOCALITIES << TPM_TIS_LOCALITY_SHIFT);
|
||||
memory_region_add_subregion(isa_address_space(dev), TPM_TIS_ADDR_BASE,
|
||||
&s->mmio);
|
||||
|
Loading…
Reference in New Issue
Block a user