Barrelfish
|
Bidirectional LMP channel implementation. More...
Functions | |
void | lmp_chan_init (struct lmp_chan *lc) |
Initialise a new LMP channel. More... | |
errval_t | lmp_chan_bind (struct lmp_chan *lc, struct lmp_bind_continuation cont, struct event_queue_node *qnode, iref_t iref, size_t buflen_words) |
Initialise a new LMP channel and initiate a binding. More... | |
void | lmp_chan_destroy (struct lmp_chan *lc) |
Destroy the local state associated with a given channel. | |
errval_t | lmp_chan_accept (struct lmp_chan *lc, size_t buflen_words, struct capref endpoint) |
Initialise a new LMP channel to accept an incoming binding request. More... | |
errval_t | lmp_chan_register_send (struct lmp_chan *lc, struct waitset *ws, struct event_closure closure) |
Register an event handler to be notified when messages can be sent. More... | |
errval_t | lmp_chan_deregister_send (struct lmp_chan *lc) |
Cancel an event registration made with lmp_chan_register_send() More... | |
void | lmp_chan_migrate_send (struct lmp_chan *lc, struct waitset *ws) |
Migrate an event registration to a new waitset. More... | |
errval_t | lmp_chan_alloc_recv_slot (struct lmp_chan *lc) |
Allocate a new receive capability slot for an LMP channel. More... | |
void | lmp_channels_retry_send_disabled (dispatcher_handle_t handle) |
Trigger send events for all LMP channels that are registered. More... | |
void | lmp_init (void) |
Initialise the LMP channel driver. | |
Bidirectional LMP channel implementation.
Initialise a new LMP channel to accept an incoming binding request.
lc | Storage for channel state |
buflen_words | Size of incoming buffer, in words |
endpoint | Capability to remote LMP endpoint |
errval_t lmp_chan_alloc_recv_slot | ( | struct lmp_chan * | lc | ) |
Allocate a new receive capability slot for an LMP channel.
This utility function allocates a new receive slot (using slot_alloc) and sets it on the channel (using #lmp_chan_set_recv_slot).
lc | LMP channel |
errval_t lmp_chan_bind | ( | struct lmp_chan * | lc, |
struct lmp_bind_continuation | cont, | ||
struct event_queue_node * | qnode, | ||
iref_t | iref, | ||
size_t | buflen_words | ||
) |
Initialise a new LMP channel and initiate a binding.
lc | Storage for channel state |
cont | Continuation for bind completion/failure |
qnode | Storage for an event queue node (used for queuing bind request) |
iref | IREF to which to bind |
buflen_words | Size of incoming buffer, in number of words |
errval_t lmp_chan_deregister_send | ( | struct lmp_chan * | lc | ) |
Cancel an event registration made with lmp_chan_register_send()
lc | LMP channel |
void lmp_chan_init | ( | struct lmp_chan * | lc | ) |
Initialise a new LMP channel.
lc | Storage for channel state |
Migrate an event registration to a new waitset.
lc | LMP channel |
ws | New waitset to migrate to |
errval_t lmp_chan_register_send | ( | struct lmp_chan * | lc, |
struct waitset * | ws, | ||
struct event_closure | closure | ||
) |
Register an event handler to be notified when messages can be sent.
In the future, call the closure on the given waitset when it is likely that a message can be sent on the channel. A channel may only be registered with a single send event handler on a single waitset at any one time.
lc | LMP channel |
ws | Waitset |
closure | Event handler |
void lmp_channels_retry_send_disabled | ( | dispatcher_handle_t | handle | ) |
Trigger send events for all LMP channels that are registered.
We don't have a good way to determine when we are likely to be able to send on an LMP channel, so this function just trigger all such pending events every time the dispatcher is rescheduled.
Must be called while disabled and from dispatcher logic.