Barrelfish
|
Slot allocator for two level CSpace. More...
Functions | |
errval_t | two_level_alloc (struct slot_allocator *ca, struct capref *ret) |
slot allocator More... | |
errval_t | two_level_free (struct slot_allocator *ca, struct capref cap) |
Free an allocated slot. More... | |
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... | |
errval_t | two_level_slot_alloc_init (struct multi_slot_allocator *ret) |
Initializer that uses memory. | |
Slot allocator for two level CSpace.
errval_t two_level_alloc | ( | struct slot_allocator * | ca, |
struct capref * | ret | ||
) |
slot allocator
ca | Instance of the allocator |
ret | Pointer to return the allocated slot |
errval_t two_level_free | ( | struct slot_allocator * | ca, |
struct capref | cap | ||
) |
Free an allocated slot.
ca | Instance of the allocator |
cap | The slot to free |
Walks the list of single slot allocators trying to free the 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