Closes T288.
Signed-off-by: Simon Gerber <simon.gerber@inf.ethz.ch>
#define MAX_MEM_REGIONS ((BOOTINFO_SIZE - sizeof(struct bootinfo)) / \
sizeof(struct mem_region))
-/// Default number of entries in a cnode (in bits)
-#define DEFAULT_CNODE_BITS (BASE_PAGE_BITS - OBJBITS_CTE)
-
-/// Default number of entries in a cnode
-#define DEFAULT_CNODE_SLOTS (1UL << DEFAULT_CNODE_BITS)
-
-
-/// Number of entries in page cnode (in bits)
-#define PAGE_CNODE_BITS (DEFAULT_CNODE_BITS + 2)
-
-/// Number of entries in page cnode
-#define PAGE_CNODE_SLOTS (1UL << PAGE_CNODE_BITS)
-
-/// Number of entries in physaddr cnode (in bits)
-#define PHYSADDRCN_BITS (DEFAULT_CNODE_BITS + 2)
-
-/// Number of entries in physaddr cnode
-#define PHYSADDRCN_SLOTS (1UL << PHYSADDRCN_BITS)
-
-/// Number of entries in super cnode (in bits)
-#define SUPER_CNODE_BITS (DEFAULT_CNODE_BITS + 2)
-
-/// Number of entries in page cnode
-#define SUPER_CNODE_SLOTS (1UL << SUPER_CNODE_BITS)
-
-/// Remainder of guard size when subtracting bits from capaddr_t bitsize
-#define GUARD_REMAINDER(bits) (CPTR_BITS - (bits))
-
/* Root CNode */
#define ROOTCN_SLOT_TASKCN 0 ///< Taskcn slot in root cnode
#define ROOTCN_SLOT_PAGECN 1 ///< Pagecn slot in root cnode
if (err_is_fail(err)) {
return err_push(err, LIB_ERR_SINGLE_SLOT_ALLOC_INIT_RAW);
}
- state->rootca.a.space = DEFAULT_CNODE_SLOTS - ROOTCN_FREE_SLOTS;
- state->rootca.head->space = DEFAULT_CNODE_SLOTS - ROOTCN_FREE_SLOTS;
+ state->rootca.a.space = L2_CNODE_SLOTS - ROOTCN_FREE_SLOTS;
+ state->rootca.head->space = L2_CNODE_SLOTS - ROOTCN_FREE_SLOTS;
state->rootca.head->slot = ROOTCN_FREE_SLOTS;
return SYS_ERR_OK;
}
this->cap.slot = 0;
- this->free = 1UL << DEFAULT_CNODE_BITS;
+ this->free = L2_CNODE_SLOTS;
}
assert(nslots <= this->free);
si->pagecn_cap.slot = ROOTCN_SLOT_PAGECN;
// XXX: satisfy a peculiarity of the single_slot_alloc_init_raw API
- size_t bufsize = SINGLE_SLOT_ALLOC_BUFLEN(PAGE_CNODE_SLOTS);
+ size_t bufsize = SINGLE_SLOT_ALLOC_BUFLEN(L2_CNODE_SLOTS);
void *buf = malloc(bufsize);
assert(buf != NULL);
err = single_slot_alloc_init_raw(&si->pagecn_slot_alloc, si->pagecn_cap,
- si->pagecn, PAGE_CNODE_SLOTS,
+ si->pagecn, L2_CNODE_SLOTS,
buf, bufsize);
if (err_is_fail(err)) {
return err_push(err, LIB_ERR_SINGLE_SLOT_ALLOC_INIT_RAW);
USER_PANIC_ERR(err, "initialize_ram_alloc");
}
- /* Initialize self slot_allocator */
- /*
- err = two_level_slot_alloc_init(&msa, DEFAULT_CNODE_SLOTS, NULL);
- if(err_is_fail(err)) {
- USER_PANIC_ERR(err, "two_level_slot_alloc_init");
- }
- */
-
err = mem_export(NULL, export_callback, connect_callback, ws,
IDC_EXPORT_FLAGS_DEFAULT);
if(err_is_fail(err)) {