> Please keep init_full(); init() would be a version without some of the
> arguments (e.g. the TimerListGroup, or the attributes).
Done.
...
> > > > +scale: u32,
>
> While at it, can you add constants for the scale, i.e.
>
> pub const NS: u32 = bindings::SCALE_NS;
> pub const U
On 2/7/25 14:33, Zhao Liu wrote:
+pub use bindings::QEMUTimer;
+
+use crate::{
+bindings::{
+self, qemu_clock_get_ns, timer_del, timer_init_full, timer_mod,
QEMUClockType,
+QEMUTimerListGroup,
+},
+callbacks::FnCall,
+};
+
+impl QEMUTimer {
+pub fn new() -> Self {
> > +pub use bindings::QEMUTimer;
> > +
> > +use crate::{
> > +bindings::{
> > +self, qemu_clock_get_ns, timer_del, timer_init_full, timer_mod,
> > QEMUClockType,
> > +QEMUTimerListGroup,
> > +},
> > +callbacks::FnCall,
> > +};
> > +
> > +impl QEMUTimer {
> > +pub f
On Sat, Jan 25, 2025 at 1:32 PM Zhao Liu wrote:
+ c_nocopy = [
+'QEMUTimer',
+ ]
+ # Used to customize Drop trait
+ foreach struct : c_nocopy
+bindgen_args += ['--no-copy', struct]
+ endforeach
Nice.
+pub use bindings::QEMUTimer;
+
+use crate::{
+bindings::{
+self
Add timer bindings to help handle idiomatic Rust callbacks.
Additionally, wrap QEMUClockType in ClockType binding to avoid unsafe
calls in device code.
Signed-off-by: Zhao Liu
---
Changes since RFC:
* Use FnCall to support timer callback.
* Only add timer_init_full() binding. timer_new() is un