mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-29 21:33:53 -06:00
rust: chardev: provide basic bindings to character devices
Most of the character device API is pretty simple, with "0 or -errno" or "number of bytes or -errno" as the convention for return codes. Add safe wrappers for the API to the CharBackend bindgen-generated struct. The API is not complete, but it covers the parts that are used by the PL011 device, plus qemu_chr_fe_write which is needed to implement the standard library Write trait. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
2ad011d466
commit
2d0050cbe2
3 changed files with 255 additions and 5 deletions
|
@ -106,3 +106,4 @@ impl_zeroable!(crate::bindings::MemoryRegionOps__bindgen_ty_1);
|
|||
impl_zeroable!(crate::bindings::MemoryRegionOps__bindgen_ty_2);
|
||||
impl_zeroable!(crate::bindings::MemoryRegionOps);
|
||||
impl_zeroable!(crate::bindings::MemTxAttrs);
|
||||
impl_zeroable!(crate::bindings::CharBackend);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue