Barrelfish
Functions
bulk_pool.c File Reference

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

Functions

struct bulk_poolbulk_pool_domain_list_get (struct bulk_pool_id *id)
 
errval_t bulk_pool_domain_list_insert (struct bulk_pool *pool)
 
errval_t bulk_pool_domain_list_remove (struct bulk_pool *pool)
 
int8_t bulk_pool_cmp_id (struct bulk_pool_id *id1, struct bulk_pool_id *id2)
 
uint8_t bulk_pool_is_assigned (struct bulk_pool *pool, struct bulk_channel *channel)
 
struct bulk_poolbulk_pool_get (struct bulk_pool_id *id, struct bulk_channel *channel)
 
errval_t bulk_pool_assign (struct bulk_pool *pool, struct bulk_channel *channel)
 
errval_t bulk_pool_remove (struct bulk_pool *pool, struct bulk_channel *channel)
 
errval_t bulk_pool_unmap (struct bulk_pool *pool)
 
errval_t bulk_pool_map (struct bulk_pool *pool)
 
errval_t bulk_pool_init_bufs (struct bulk_pool *pool)
 
errval_t bulk_pool_alloc_with_id (struct bulk_pool **pool, size_t buffer_count, size_t buffer_size, struct bulk_pool_id id)
 
errval_t bulk_pool_alloc (struct bulk_pool **pool, size_t buffer_count, size_t buffer_size)
 
errval_t bulk_pool_dealloc (struct bulk_pool *pool)
 

Detailed Description

Unidirectional bulk data transfer via shared memory.

Function Documentation

errval_t bulk_pool_alloc ( struct bulk_pool **  pool,
size_t  buffer_count,
size_t  buffer_size 
)

allocates the data structures for the pool with new id.

Parameters
poolstorage for pointer to newly allocated pool
buffer_countthe number of buffers in the pool
buffer_sizethe size of a single buffer
errval_t bulk_pool_alloc_with_id ( struct bulk_pool **  pool,
size_t  buffer_count,
size_t  buffer_size,
struct bulk_pool_id  id 
)

allocates the data structures for the pool.

Parameters
poolstorage for pointer to newly allocated pool
buffer_countthe number of buffers in the pool
buffer_sizethe size of a single buffer
idpool id
errval_t bulk_pool_assign ( struct bulk_pool pool,
struct bulk_channel channel 
)

adds a pool to a channel's pool list

Parameters
poolthe pool to assing to the channel
channelthe channel to assign the the pool to
int8_t bulk_pool_cmp_id ( struct bulk_pool_id id1,
struct bulk_pool_id id2 
)

compares two bulk pool ids

Returns
-1 if id1 is less than id2 0 if both ids are equal 1 if id1 is bigger than id2
errval_t bulk_pool_dealloc ( struct bulk_pool pool)

frees up the resources needed by the pool note

Parameters
poolthe pool to dealloc
struct bulk_pool* bulk_pool_domain_list_get ( struct bulk_pool_id id)

returns a pointer to the pool with the given id

Parameters
idthe id of the pool to look up
Returns
NULL if the pool is not present in the domain
errval_t bulk_pool_domain_list_insert ( struct bulk_pool pool)

inserts a pool into the domain global bulk pool list

Parameters
poolthe pool to insert
errval_t bulk_pool_domain_list_remove ( struct bulk_pool pool)

removes the pool from the channel's pool list

Parameters
poolthe poo to remove
struct bulk_pool* bulk_pool_get ( struct bulk_pool_id id,
struct bulk_channel channel 
)

gets a pointer to the pool on this channel

Parameters
idthe poolid we want the pool
channelthe channel to look for the pools
errval_t bulk_pool_init_bufs ( struct bulk_pool pool)

initializes the buffers for a pool given the struct pool is allocated and filled with the num bufs

Parameters
poolpointer to a pool with the information
uint8_t bulk_pool_is_assigned ( struct bulk_pool pool,
struct bulk_channel channel 
)

checks if a pool already has been assigned to that channel

Parameters
poolthe bulk pool to check for assignment
channelthe channel to check for assignment
Returns
true: the pool is assigned to this channel false: the pools has not been assigned to the channel
errval_t bulk_pool_map ( struct bulk_pool pool)

Does the mapping of a pool depending on the trust level. Reserves virtual memory, and allocates a memobj for the pool. In the trusted case, the pool is backed with the pool cap and mapped. In the nontrusted case, the pool cap is split into seperate buffer caps and mapped. If there is no pool_cap, only the virtual memory is allocated.

XXX : trust_uninitialized is currently treated like the trusted case, which is probably not the best idea. should we treat it as an error or just ignore it?

Parameters
poolthe pool to map
errval_t bulk_pool_remove ( struct bulk_pool pool,
struct bulk_channel channel 
)

removes the pool from the channel's pool list

Parameters
poolthe poo to remove
channelthe channel to remove the pool from
errval_t bulk_pool_unmap ( struct bulk_pool pool)

unmaps the entire pool and frees up the entire memory region of the pool.

Parameters
poolthe pool to unmap