Hi
I have created a new process from the root/init task. In the new process I have the following code for initializing the allocman as below:
vka_t vka;
allocman_t *allocman;
vspace_t vspace;
#define ALLOCATOR_STATIC_POOL_SIZE ((1 << seL4_PageBits) * 10)
UNUSED static char allocator_mem_pool[ALLOCATOR_STATIC_POOL_SIZE];
#define ALLOCATOR_VIRTUAL_POOL_SIZE ((1 << seL4_PageBits) * 100)
int main(int argc, char **argv) {
allocman = bootstrap_use_current_1level(SEL4UTILS_CNODE_SLOT,
CONFIG_SEL4UTILS_CSPACE_SIZE_BITS,
0,
(1u << CONFIG_SEL4UTILS_CSPACE_SIZE_BITS),
ALLOCATOR_STATIC_POOL_SIZE,
allocator_mem_pool);
allocman_make_vka(&vka, allocman);
vka_object_t ep_object = {0};
error = vka_alloc_endpoint(&vka, &ep_object);
ZF_LOGF_IFERR(error, "Failed to allocate new endpoint object.\n");
I have the following definition structure shared as
enum sel4utils_cspace_layout {
/*
* The root cnode (with appropriate guard)
*/
SEL4UTILS_CNODE_SLOT = 1,
/* The slot on the cspace that fault_endpoint is put if
* sel4utils_configure_process is used.
*/
SEL4UTILS_ENDPOINT_SLOT = 2,
SEL4UTILS_PD_SLOT = 3,
FREE_SLOT = 4,
};
This particular program has compiled for zynq-7000 platform and when running it I get the following output in the stdout :
Just entered the user function
vka_alloc_object@object.h:51 Failed to allocate object of size 16, error 1
Assertion failed: error == 0 (/apps/zynq-comm-user/src/main.c: main: 71)
I have been not able to figure out why this error is occurring. I can only guess that the allocman was not initialized properly. Can someone help me with what I may have done wrong?
Regards
Neelesh Vemula