Attribute Macro panda_macros::unassigned_io_read
source · #[unassigned_io_read]
Expand description
(Callback) Called when the guest attempts to read from an unmapped peripheral via MMIO
Callback ID: PANDA_CB_UNASSIGNED_IO_WRITE
Arguments:
pc: Guest program counter at time of write
addr: Physical address written to
size: Size of write
val: Pointer to a buffer that will be passed to the guest as the result of the read
Return value:
True if value read was changed by a PANDA plugin and should be returned
False if error-logic (invalid write) should be run
Callback arguments: (&mut CPUState
, target_ptr_t
, hwaddr
, usize
, u64
, )
Example
use panda::prelude::*;
#[panda::unassigned_io_read]
fn callback(_: &mut CPUState, _: target_ptr_t, _: hwaddr, _: usize, _: u64, ) -> bool {
// do stuff
}