Barrelfish
|
Slot allocator. More...
Data Structures | |
struct | cnode_meta |
Meta data for single_slot_allocator. More... | |
Functions | |
errval_t | two_level_slot_alloc_init (struct multi_slot_allocator *ret) |
Initializer that uses memory. | |
errval_t | two_level_slot_alloc_init_raw (struct multi_slot_allocator *ret, struct capref initial_cap, struct cnoderef initial_cnode, struct capref reserve_cap, struct cnoderef reserve_cnode, void *head_buf, void *reserve_buf, size_t bufsize) |
Initializer that does not allocate any space. More... | |
struct slot_allocator * | get_default_slot_allocator (void) |
Returns the default slot allocator for the caller. | |
errval_t | slot_alloc (struct capref *ret) |
Default slot allocator. More... | |
errval_t | slot_alloc_root (struct capref *ret) |
Root slot allocator functions. More... | |
errval_t | slot_free (struct capref ret) |
Default slot free. More... | |
errval_t | range_slot_alloc (struct range_slot_allocator *alloc, cslot_t nslots, struct capref *ret) |
Allocate slots out of a cnode. More... | |
errval_t | range_slot_free (struct range_slot_allocator *alloc, struct capref cap, cslot_t nslots) |
Free slots belonging to the cnode. More... | |
errval_t | range_slot_alloc_init (struct range_slot_allocator *ret, cslot_t nslots, cslot_t *retslots) |
Constructor for a new instance of a single cnode cspace_allocator. More... | |
Slot allocator.
errval_t range_slot_alloc | ( | struct range_slot_allocator * | alloc, |
cslot_t | nslots, | ||
struct capref * | ret | ||
) |
Allocate slots out of a cnode.
alloc | Pointer to the metadata |
nslots | Number of slots to allocate |
ret | Pointer used to return the allocated slot |
errval_t range_slot_alloc_init | ( | struct range_slot_allocator * | ret, |
cslot_t | nslots, | ||
cslot_t * | retslots | ||
) |
Constructor for a new instance of a single cnode cspace_allocator.
ret | Instance of the allocator created |
nslots | Desired number of slots the cnode should have |
ret_slots | Number of slots actually used |
errval_t range_slot_free | ( | struct range_slot_allocator * | alloc, |
struct capref | cap, | ||
cslot_t | nslots | ||
) |
Free slots belonging to the cnode.
alloc | Pointer to the metadata |
cap | Slot to start freeing from |
nslots | Number of slots to free |
errval_t slot_alloc | ( | struct capref * | ret | ) |
Default slot allocator.
ret | Pointer to the cap to return the allocated slot in |
Allocates one slot from the default allocator
errval_t slot_alloc_root | ( | struct capref * | ret | ) |
Root slot allocator functions.
Root slot allocator functions.
ret | Pointer to the cap to return the allocated slot in |
Allocates one slot from the root slot allocator
errval_t slot_free | ( | struct capref | ret | ) |
Default slot free.
ret | The cap to free |
Frees the passed in slot.
errval_t two_level_slot_alloc_init_raw | ( | struct multi_slot_allocator * | ret, |
struct capref | initial_cap, | ||
struct cnoderef | initial_cnode, | ||
struct capref | reserve_cap, | ||
struct cnoderef | reserve_cnode, | ||
void * | head_buf, | ||
void * | reserve_buf, | ||
size_t | bufsize | ||
) |
Initializer that does not allocate any space.
#slot_alloc_init duplicates some of the code below, modify it if making changes here.
XXX: top_buf head_buf and reserve_buf each point to a separate buffer of size bufsize bytes which can be used for backing storage. bufsize evidently needs to be >= sizeof(struct cnode_meta) * nslots / 2. Don't ask me why! -AB