Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions axdevice_base/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

extern crate alloc;

use alloc::sync::Arc;

use memory_addr::AddrRange;

use axaddrspace::GuestPhysAddr;
Expand All @@ -23,6 +25,8 @@ pub trait BaseDeviceOps {
fn emu_type(&self) -> EmuDeviceType;
/// Returns the address range of the emulated device.
fn address_range(&self) -> AddrRange<GuestPhysAddr>;
/// Converts the emulated device into a `dyn Any` trait object.
fn into_any(self: Arc<Self>) -> Arc<dyn core::any::Any + Send + Sync>;
/// Handles a read operation on the emulated device.
fn handle_read(&self, addr: GuestPhysAddr, width: usize) -> AxResult<usize>;
/// Handles a write operation on the emulated device.
Expand Down