Type Alias simics_api_sys::bindings::pre_decoder_cb_t

source ·
pub type pre_decoder_cb_t = Option<unsafe extern "C" fn(obj: *mut conf_object_t, cpu: *mut conf_object_t, instruction_start_address: generic_address_t, position_physical_address: physical_address_t, opcode_bytes: *mut uint8, valid_bytes: c_uint, instruction_position: c_uint, user_data: *mut lang_void) -> bool>;
Expand description
pre_decoder_cb_t pre_decoder_cb_t pre_decoder_cb_t

This callback is used by the pre_decoder_interface_t to observe and modify the instruction byte stream.

The obj is the connection object which owns the callback, or NULL, if no connection is used. cpu is the cpu which decodes the instructions. instruction_start_address is the address of the first byte in the instruction that is being decoded. For x86 this is the linerar address. opcode_bytes is a pointer to the first opcode byte in the instruction. The valid_bytes tells how many bytes that can read from the first byte.

If the decoded instruction crosses a page boundary this callback is invoked twice, first with the bytes on the first page and then with additional bytes located on the next page. The instruction_position tells where in the instruction opcode the next bytes are added from the second page, and hence will be greater 0 if this occurs.

The position_physical_address reflects the physical address of the instruction_position.

The function should return true if the memory was modified, otherwise false.

Aliased Type§

enum pre_decoder_cb_t {
    None,
    Some(unsafe extern "C" fn(_: *mut conf_object, _: *mut conf_object, _: u64, _: u64, _: *mut u8, _: u32, _: u32, _: *mut c_void) -> bool),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(_: *mut conf_object, _: *mut conf_object, _: u64, _: u64, _: *mut u8, _: u32, _: u32, _: *mut c_void) -> bool)

Some value of type T.