class GuestBellTrapBase

Defined at line 24 of file ../../sdk/lib/async/include/lib/async/cpp/trap.h

Holds context for a bell trap and its handler.

After successfully posting setting the trap, the client is responsible for retaining

the structure in memory (and unmodified) until the guest has been destroyed or the

dispatcher shuts down. There is no way to cancel a trap which has been set.

Concrete implementations: |async::GuestBellTrap|, |async::GuestBellTrapMethod|.

Please do not create subclasses of GuestBellTrapBase outside of this library.

Public Methods

zx_status_t SetTrap (async_dispatcher_t * dispatcher, const zx::guest & guest, zx_vaddr_t addr, size_t length)

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.

Defined at line 16 of file ../../sdk/lib/async/trap.cc

Protected Methods

void GuestBellTrapBase (async_guest_bell_trap_handler_t * handler)

Defined at line 11 of file ../../sdk/lib/async/trap.cc

void ~GuestBellTrapBase ()

Defined at line 14 of file ../../sdk/lib/async/trap.cc

void GuestBellTrapBase (const GuestBellTrapBase & )

Defined at line 29 of file ../../sdk/lib/async/include/lib/async/cpp/trap.h

void GuestBellTrapBase (GuestBellTrapBase && )

Defined at line 30 of file ../../sdk/lib/async/include/lib/async/cpp/trap.h

GuestBellTrapBase & operator= (const GuestBellTrapBase & )

Defined at line 31 of file ../../sdk/lib/async/include/lib/async/cpp/trap.h

GuestBellTrapBase & operator= (GuestBellTrapBase && )

Defined at line 32 of file ../../sdk/lib/async/include/lib/async/cpp/trap.h

template <typename T>
T * Dispatch (async_guest_bell_trap_t * trap)

Defined at line 57 of file ../../sdk/lib/async/include/lib/async/cpp/trap.h