Barrelfish
Data Structures | Functions
lmp_chan.h File Reference

Bidirectional LMP channel. More...

Data Structures

struct  lmp_chan
 A bidirectional LMP channel. More...
 

Functions

void lmp_chan_init (struct lmp_chan *lc)
 Initialise a new LMP channel. More...
 
void lmp_chan_destroy (struct lmp_chan *lc)
 Destroy the local state associated with a given 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. More...
 
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.
 

Detailed Description

Bidirectional LMP channel.

Function Documentation

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.

Parameters
lcStorage for channel state
buflen_wordsSize of incoming buffer, in words
endpointCapability 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).

Parameters
lcLMP 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.

Parameters
lcStorage for channel state
contContinuation for bind completion/failure
qnodeStorage for an event queue node (used for queuing bind request)
irefIREF to which to bind
buflen_wordsSize 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()

Parameters
lcLMP channel
void lmp_chan_init ( struct lmp_chan lc)

Initialise a new LMP channel.

Parameters
lcStorage for channel state
void lmp_chan_migrate_send ( struct lmp_chan lc,
struct waitset ws 
)

Migrate an event registration to a new waitset.

Parameters
lcLMP channel
wsNew 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.

Parameters
lcLMP channel
wsWaitset
closureEvent 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.