Lines Matching +full:clock +full:- +full:bindings
3 // SPDX-License-Identifier: GPL-2.0-or-later
5 //! Bindings to create devices and access device functionality from Rust.
13 pub use bindings::{ClockEvent, DeviceClass, Property, ResetType};
16 bindings::{self, qdev_init_gpio_in, qdev_init_gpio_out, Error, ResettableClass},
26 /// A safe wrapper around [`bindings::Clock`].
29 pub struct Clock(Opaque<bindings::Clock>); struct
31 unsafe impl Send for Clock {} implementation
32 unsafe impl Sync for Clock {} implementation
34 /// A safe wrapper around [`bindings::DeviceState`].
37 pub struct DeviceState(Opaque<bindings::DeviceState>);
47 /// has a side-effect on other objects, such as raising or lowering an
71 obj: *mut bindings::Object, in rust_resettable_enter_fn()
84 obj: *mut bindings::Object, in rust_resettable_hold_fn()
97 obj: *mut bindings::Object, in rust_resettable_exit_fn()
117 fn properties() -> &'static [Property] { in properties()
124 fn vmsd() -> Option<&'static VMStateDescription> { in vmsd()
137 dev: *mut bindings::DeviceState, in rust_realize_fn()
146 unsafe { CStr::from_bytes_with_nul_unchecked(bindings::TYPE_RESETTABLE_INTERFACE) };
178 bindings::device_class_set_props_n(self, prop.as_ptr(), prop.len()); in class_init()
190 $crate::bindings::Property {
197 defval: $crate::bindings::Property__bindgen_ty_1 { u: $defval as u64 },
202 $crate::bindings::Property {
208 defval: $crate::bindings::Property__bindgen_ty_1 { u: $defval as u64 },
213 $crate::bindings::Property {
227 pub static $ident: [$crate::bindings::Property; {
243 unsafe { CStr::from_bytes_with_nul_unchecked(bindings::TYPE_DEVICE) };
256 /// Add an input clock named `name`. Invoke the callback with
259 /// The resulting clock is added as a child of `self`, but it also
264 /// possible for this function to return a `&Clock` too.
271 ) -> Owned<Clock> { in init_clock_in() argument
277 ) -> Owned<Clock> { in init_clock_in() argument
280 // SAFETY: the clock is heap allocated, but qdev_init_clock_in() in init_clock_in()
282 // add one. The callback is disabled automatically when the clock in init_clock_in()
286 let clk = bindings::qdev_init_clock_in( in init_clock_in()
294 let clk: &Clock = Clock::from_raw(clk); in init_clock_in()
315 /// Add an output clock named `name`.
317 /// The resulting clock is added as a child of `self`, but it also
322 /// possible for this function to return a `&Clock` too.
324 fn init_clock_out(&self, name: &str) -> Owned<Clock> { in init_clock_out() argument
327 let clk = bindings::qdev_init_clock_out(self.upcast().as_mut_ptr(), cstr.as_ptr()); in init_clock_out()
329 let clk: &Clock = Clock::from_raw(clk); in init_clock_out()
339 bindings::qdev_prop_set_chr( in prop_set_chr()
391 unsafe impl ObjectType for Clock { implementation
394 unsafe { CStr::from_bytes_with_nul_unchecked(bindings::TYPE_CLOCK) };
396 qom_isa!(Clock: Object);