qemu-rust
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC 12/13] rust/timer/hpet: add qdev APIs support


From: Paolo Bonzini
Subject: Re: [RFC 12/13] rust/timer/hpet: add qdev APIs support
Date: Thu, 5 Dec 2024 19:58:07 +0100
User-agent: Mozilla Thunderbird

On 12/5/24 07:07, Zhao Liu wrote:
Implement QAPI support for HPET device in qdev.rs.

Additionally, wrap the handling of HPET internal details as traits to be
specifically implemented in hpet.rs.

Why not just put everything in a simple file to avoid the traits?

+pub(crate) trait RamOps {
+    fn read(&mut self, addr: hwaddr, _size: c_uint) -> u64;
+    fn write(&mut self, addr: hwaddr, value: u64, size: u64);
+}

Please try as much as possible to make these "&self", same for the GPIO handler. That's the point of BqlCell/BqlRefCell. :)

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]