Barrelfish
Functions
bulk_channel.c File Reference

Unidirectional bulk data transfer via shared memory. More...

Functions

errval_t bulk_channel_create (struct bulk_channel *channel, struct bulk_endpoint_descriptor *local_ep_desc, struct bulk_channel_callbacks *callbacks, struct bulk_channel_setup *setup)
 
errval_t bulk_channel_bind (struct bulk_channel *channel, struct bulk_endpoint_descriptor *remote_ep_desc, struct bulk_channel_callbacks *callbacks, struct bulk_channel_bind_params *params, struct bulk_continuation cont)
 
errval_t bulk_channel_destroy (struct bulk_channel *channel, struct bulk_continuation cont)
 
errval_t bulk_channel_assign_pool (struct bulk_channel *channel, struct bulk_pool *pool, struct bulk_continuation cont)
 
errval_t bulk_channel_remove_pool (struct bulk_channel *channel, struct bulk_pool *pool, struct bulk_continuation cont)
 
errval_t bulk_channel_move (struct bulk_channel *channel, struct bulk_buffer *buffer, void *meta, struct bulk_continuation cont)
 
errval_t bulk_channel_pass (struct bulk_channel *channel, struct bulk_buffer *buffer, void *meta, struct bulk_continuation cont)
 
errval_t bulk_channel_copy (struct bulk_channel *channel, struct bulk_buffer *buffer, void *meta, struct bulk_continuation cont)
 
errval_t bulk_channel_release (struct bulk_channel *channel, struct bulk_buffer *buffer, struct bulk_continuation cont)
 

Detailed Description

Unidirectional bulk data transfer via shared memory.

Function Documentation

errval_t bulk_channel_assign_pool ( struct bulk_channel channel,
struct bulk_pool pool,
struct bulk_continuation  cont 
)

Assign a pool to a channel.

Parameters
channelChannel
poolPool to assign (must not be assigned to this channel yet)
errval_t bulk_channel_bind ( struct bulk_channel channel,
struct bulk_endpoint_descriptor remote_ep_desc,
struct bulk_channel_callbacks callbacks,
struct bulk_channel_bind_params params,
struct bulk_continuation  cont 
)

Bind to an existing unbound channel.

Parameters
channelPointer to unused channel handle
ep_descDescription of the remote endpoint to bind to
callbacksCallbacks for events on this channel
paramsbind parameters
errval_t bulk_channel_copy ( struct bulk_channel channel,
struct bulk_buffer buffer,
void *  meta,
struct bulk_continuation  cont 
)

Copy buffer to other endpoint.

Parameters
channelChannel, this endpoint must be source
bufferBuffer, must belong to a pool on this channel. Must hold ownersihp, or hold a copy of this buffer.
metaPointer to metadata to be passed along with the buffer (channel-wide meta_size is used).
contevent continuation
errval_t bulk_channel_create ( struct bulk_channel channel,
struct bulk_endpoint_descriptor local_ep_desc,
struct bulk_channel_callbacks callbacks,
struct bulk_channel_setup setup 
)

Create a new channel.

Parameters
channelPointer to unused channel handle
ep_descDescription of endpoint to bind to
callbacksCallbacks for events on this channel
setupstruct containing the setup information
errval_t bulk_channel_destroy ( struct bulk_channel channel,
struct bulk_continuation  cont 
)

Free a channel

Parameters
channelChannel to be freed
free_resourcesFlag if the resources i.e. pools also should be freed
errval_t bulk_channel_move ( struct bulk_channel channel,
struct bulk_buffer buffer,
void *  meta,
struct bulk_continuation  cont 
)

Move buffer on the channel. Data and ownership are passed to the other endpoint. After the other endpoint is done with the respective buffer, it can pass it back.

Parameters
channelChannel, this endpoint must be source
bufferBuffer, must hold ownership and belong to a pool on this channel
metaPointer to metadata to be passed along with the data (channel-wide meta_size is used).
contevent continuation
errval_t bulk_channel_pass ( struct bulk_channel channel,
struct bulk_buffer buffer,
void *  meta,
struct bulk_continuation  cont 
)

Pass buffer ownership to the other endpoint, the buffer contents are not guaranteed to be transported.

Parameters
channelChannel
bufferBuffer, must hold ownership and belong to a pool on this channel
metaPointer to metadata to be passed along with the buffer (channel-wide meta_size is used).
contevent continuation
errval_t bulk_channel_release ( struct bulk_channel channel,
struct bulk_buffer buffer,
struct bulk_continuation  cont 
)

Release copy received over channel. Must only be called after all outgoing copies from this domain of the same buffer have been released.

Parameters
channelChannel, this endpoint must be sink
bufferBuffer, must have received it as a copy over this channel, all outgoing copies must have been released.
contevent continuation
errval_t bulk_channel_remove_pool ( struct bulk_channel channel,
struct bulk_pool pool,
struct bulk_continuation  cont 
)

Remove a pool from a channel

Parameters
channelChannel
poolPool to remove (must be previously assigned to the channel)