mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 06:43:53 -06:00
rust: add bindings for gpio_{in|out} initialization
Wrap qdev_init_gpio_{in|out} as methods in DeviceMethods. And for qdev_init_gpio_in, based on FnCall, it can support idiomatic Rust callback without the need for C style wrapper. Signed-off-by: Zhao Liu <zhao1.liu@intel.com> Link: https://lore.kernel.org/r/20250210030051.2562726-5-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
e6f1195f55
commit
9a96d41007
2 changed files with 43 additions and 5 deletions
|
@ -84,7 +84,6 @@ where
|
|||
self.cell.as_ptr()
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub(crate) const fn slice_as_ptr(slice: &[Self]) -> *mut *mut IRQState {
|
||||
assert!(!slice.is_empty());
|
||||
slice[0].as_ptr()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue