Attribute Macro panda_macros::unassigned_io_write

source ·
#[unassigned_io_write]
Expand description

(Callback) Called when the guest attempts to write to 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: Data being written, up to 8 bytes

   Return value:
     True if the write should be allowed without error
     False if normal behavior should be used (error-logic)

Callback arguments: (&mut CPUState, target_ptr_t, hwaddr, usize, u64, )

Example

use panda::prelude::*;

#[panda::unassigned_io_write]
fn callback(_: &mut CPUState, _: target_ptr_t, _: hwaddr, _: usize, _: u64, ) -> bool {
    // do stuff
}