summary refs log tree commit diff stats
path: root/rust/qemu-api/src/memory.rs (follow)
Commit message (Collapse)AuthorAgeFilesLines
* rust: qom: change instance_init to take a ParentInit<>Paolo Bonzini2025-06-171-6/+6
| | | | | | | | | | | | | This removes undefined behavior associated to writing to uninitialized fields, and makes it possible to remove "unsafe" from the instance_init implementation. However, the init function itself is still unsafe, because it must promise (as a sort as MaybeUninit::assume_init) that all fields have been initialized. Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* rust: use std::ffi instead of std::os::rawPaolo Bonzini2025-05-061-2/+1
| | | | | | | | This is allowed since Rust 1.64.0. Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* rust: qom: remove operations on &mutPaolo Bonzini2025-03-061-5/+0
| | | | | | | | | | The dubious casts of mutable references to objects are not used anymore: the wrappers for qdev_init_clock_in and for IRQ and MMIO initialization can be called directly on the subclasses, without casts, plus they take a shared reference so they can just use "upcast()" instead of "upcast_mut()". Remove them. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* rust: memory: wrap MemoryRegion with Opaque<>Paolo Bonzini2025-03-061-14/+21
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* rust: qom: wrap Object with Opaque<>Paolo Bonzini2025-03-061-1/+1
| | | | | Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* rust: add bindings for memattrsZhao Liu2025-02-131-2/+14
| | | | | | | | | | | | | The MemTxAttrs structure contains bitfield members, and bindgen is unable to generate an equivalent macro definition for MEMTXATTRS_UNSPECIFIED. Therefore, manually define a global constant variable MEMTXATTRS_UNSPECIFIED to support calls from Rust code. Signed-off-by: Zhao Liu <zhao1.liu@intel.com> Link: https://lore.kernel.org/r/20250125125137.1223277-6-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* rust: bindings for MemoryRegionOpsPaolo Bonzini2025-02-131-0/+191
Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>