Skip to main content

async_set_guest_bell_trap

Function async_set_guest_bell_trap 

Source
pub unsafe extern "C" fn async_set_guest_bell_trap(
    dispatcher: *mut async_dispatcher_t,
    trap: *mut async_guest_bell_trap_t,
    guest: zx_handle_t,
    addr: zx_vaddr_t,
    length: usize,
) -> zx_status_t
Expand description

Sets a bell trap in the guest to be handled asynchronously via a handler.

|guest| is the handle of the guest the trap will be set on. |addr| is the base address for the trap in the guest’s physical address space. |length| is the size of the trap in the guest’s physical address space.

Returns |ZX_OK| if the trap was successfully set. Returns |ZX_ERR_ACCESS_DENIED| if the guest does not have |ZX_RIGHT_WRITE|. Returns |ZX_ERR_ALREADY_EXISTS| if a bell trap with the same |addr| exists. Returns |ZX_ERR_INVALID_ARGS| if |addr| or |length| are invalid. Returns |ZX_ERR_OUT_OF_RANGE| if |addr| or |length| are out of range of the address space. Returns |ZX_ERR_WRONG_TYPE| if |guest| is not a handle to a guest. Returns |ZX_ERR_BAD_STATE| if the dispatcher is shutting down. Returns |ZX_ERR_NOT_SUPPORTED| if not supported by the dispatcher.

This operation is thread-safe.