Barrelfish
|
Unidirectional bulk data transfer via shared memory. More...
Functions | |
errval_t | bulk_alloc_init (struct bulk_allocator *alloc, size_t buffer_count, size_t buffer_size, struct bulk_pool_constraints *constraints) |
errval_t | bulk_alloc_init_from_cap (struct bulk_allocator *alloc, size_t buffer_size, struct capref *frame) |
errval_t | bulk_alloc_free (struct bulk_allocator *alloc) |
struct bulk_buffer * | bulk_alloc_new_buffer (struct bulk_allocator *alloc) |
errval_t | bulk_alloc_return_buffer (struct bulk_allocator *alloc, struct bulk_buffer *buffer) |
Unidirectional bulk data transfer via shared memory.
errval_t bulk_alloc_free | ( | struct bulk_allocator * | alloc | ) |
Frees up the bulk allocator and it's pool.
alloc | handle to a bulk allocator to be freed |
errval_t bulk_alloc_init | ( | struct bulk_allocator * | alloc, |
size_t | buffer_count, | ||
size_t | buffer_size, | ||
struct bulk_pool_constraints * | constraints | ||
) |
initializes a new bulk allocator with a pool and allocates memory for it.
alloc | pointer to an unused allocator handle |
buffer_count | the number of buffers to allocate |
buffer_size | the size of a single buffer |
constraints | memory requirements for this pool or NULL if none |
errval_t bulk_alloc_init_from_cap | ( | struct bulk_allocator * | alloc, |
size_t | buffer_size, | ||
struct capref * | frame | ||
) |
creates a new allocator based on the supplied capability. It creates as many buffers as possible of size buffer_size that fit into the capability.
alloc | an unused allocator handle |
buffer_size | the size of a single buffer |
frame | capability for backing the bulk pool |
struct bulk_buffer* bulk_alloc_new_buffer | ( | struct bulk_allocator * | alloc | ) |
Gets a new bulk buffer from the allocator.
alloc | the allocator handle to allocate the buffer from |
errval_t bulk_alloc_return_buffer | ( | struct bulk_allocator * | alloc, |
struct bulk_buffer * | buffer | ||
) |
returns a buffer back to the allocator. The pools must match.
alloc | the allocator to hand the buffer back |
buffer | the buffer to hand back to the allocator |