On Tue, Oct 28, 2025 at 07:12:37PM +0100, Philippe Mathieu-Daudé wrote: > Date: Tue, 28 Oct 2025 19:12:37 +0100 > From: Philippe Mathieu-Daudé <[email protected]> > Subject: [PATCH v3 03/25] hw/timer/hpet: Use proper SysBus accessors > X-Mailer: git-send-email 2.51.0 > > SysBusDevice::mmio[] is private data of SysBusDevice, use > sysbus_mmio_get_region() to access it. > > Signed-off-by: Philippe Mathieu-Daudé <[email protected]> > --- > hw/timer/hpet.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c > index 1acba4fa9db..c1b96d0a89f 100644 > --- a/hw/timer/hpet.c > +++ b/hw/timer/hpet.c > @@ -654,7 +654,7 @@ static const MemoryRegionOps hpet_ram_ops = { > static void hpet_reset(DeviceState *d) > { > HPETState *s = HPET(d); > - SysBusDevice *sbd = SYS_BUS_DEVICE(d); > + MemoryRegion *mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(d), 0); > int i; > > for (i = 0; i < s->num_timers; i++) { > @@ -677,7 +677,7 @@ static void hpet_reset(DeviceState *d) > s->hpet_offset = 0ULL; > s->config = 0ULL; > hpet_fw_cfg.hpet[s->hpet_id].event_timer_block_id = > (uint32_t)s->capability; > - hpet_fw_cfg.hpet[s->hpet_id].address = sbd->mmio[0].addr; > + hpet_fw_cfg.hpet[s->hpet_id].address = mr->addr; Rust's sysbus has a method "mmio_addr". Maybe Rust side should also split it into two methods similar to `sysbus_mmio_get_region` and `memory_region_get_address`, to align with the C interfaces.
For this patch, Reviewed-by: Zhao Liu <[email protected]> > /* to document that the RTC lowers its output on reset as well */ > s->rtc_irq_level = 0; > -- > 2.51.0 > >
