pub struct MonitorPage { /* private fields */ }
Expand description
Holds information about the monitor page and registered monitors.
Implementations§
Source§impl MonitorPage
impl MonitorPage
Sourcepub fn set_gpa(&self, gpa: Option<u64>) -> Option<u64>
pub fn set_gpa(&self, gpa: Option<u64>) -> Option<u64>
Sets the GPA of the monitor page currently in use.
Sourcepub fn gpa(&self) -> Option<u64>
pub fn gpa(&self) -> Option<u64>
Gets the current GPA of the monitor page, or None if no monitor page is in use.
Sourcepub fn register_monitor(
&self,
monitor_id: MonitorId,
connection_id: u32,
) -> Box<dyn Sync + Send>
pub fn register_monitor( &self, monitor_id: MonitorId, connection_id: u32, ) -> Box<dyn Sync + Send>
Registers a monitored interrupt, optionally using a pre-existing ID. The returned struct will unregister the ID when dropped.
§Panics
Panics if monitor_id is already in use.
Sourcepub fn write_bit(&self, page_bit: u32) -> Option<u32>
pub fn write_bit(&self, page_bit: u32) -> Option<u32>
Sets one bit within the monitor page, returning the connection ID to signal.
Sourcepub fn check_write(
&self,
gpa: u64,
bytes: &[u8],
signal: impl FnMut(u32),
) -> bool
pub fn check_write( &self, gpa: u64, bytes: &[u8], signal: impl FnMut(u32), ) -> bool
Check if the specified write is wholly inside the monitor page, and signal the associated interrupt if it is.
Sourcepub fn check_read(&self, gpa: u64, bytes: &mut [u8]) -> bool
pub fn check_read(&self, gpa: u64, bytes: &mut [u8]) -> bool
Checks if a read if inside the monitor page, and fills the buffer if it is. N.B. This is used to handle cases where the instruction emulator needs to read the monitor page. The guest should have read access to the page so doesn’t need to go through this path.