> > > This needs to be "match addr & !4".
> >
> > I understand it's not necessary:
> >
> > In timer_and_addr(), I've masked the address with 0x18.
> >
> > fn timer_and_addr(&self, addr: hwaddr) ->
> > Option<(&BqlRefCell, hwaddr)> {
> > let timer_id: usize = ((addr - 0x100) / 0x20) as u
Il sab 8 feb 2025, 11:36 Zhao Liu ha scritto:
> On Wed, Jan 29, 2025 at 11:58:14AM +0100, Paolo Bonzini wrote:
> > Date: Wed, 29 Jan 2025 11:58:14 +0100
> > From: Paolo Bonzini
> > Subject: Re: [PATCH 09/10] rust/timer/hpet: add qom and qdev APIs support
> >
> >
On Wed, Jan 29, 2025 at 11:58:14AM +0100, Paolo Bonzini wrote:
> Date: Wed, 29 Jan 2025 11:58:14 +0100
> From: Paolo Bonzini
> Subject: Re: [PATCH 09/10] rust/timer/hpet: add qom and qdev APIs support
>
>
>
> On Sat, Jan 25, 2025 at 1:32 PM Zhao Liu wrote:
> >
On Sat, Jan 25, 2025 at 1:32 PM Zhao Liu wrote:
fn read(&mut self, addr: hwaddr, _size: u32) -> u64 {
This can be &self.
let shift: u64 = (addr & 4) * 8;
+match addr {
+HPET_TN_CFG_REG => self.config >> shift, // including interrupt
capabilities
This
Implement QOM & QAPI support for HPET device.
Signed-off-by: Zhao Liu
---
Changes since RFC:
* Merge qdev.rs to hpet.rs.
* Apply memory and Resettable bindings.
* Consolidate inmutable &self and QOM casting.
* Prefer timer iterator over loop.
* Move init_mmio() and init_irq() to post_init().