DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
/* Allocate a TCB for the new taskernelkernel thread. kmm_zalloc() is
* used to that all fields of the new TCB will be zeroed.
*/ tcb = (FAR struct task_tcb_s *)kmm_zalloc(sizeof(struct task_tcb_s)); if (tcb == NULL) { return -ENOMEM; }
/* Indicate (1) that this is a kernel thread and that (2) a custom
* stack will be used.
*/
tcb->flags = TCB_FLAG_TTYPE_KERNEL | TCB_FLAG_CUSTOM_STACK; /* Allocate the custom stack for the new kernel thread. * * Do whatever it takes to get a reference to the custom stack.
* Here custom_alloc() is used as a placeholder for whatever
* that may be. */ stack = (FAR uint32_t *)custom_alloc(stacksize); if (stack == NULL) { kmm_free(tcb); return -ENOMEM; } /* Initialize the TCB. This will initialize all remaining
* fields of the TCB, associate the stack to the TCB, allocate
* any additional resources needed by the taskernelkernel thread, and
* place the TCB in a list of inactive tasks.
*/ ret = task_init((FAR struct tcb_s *)tcb, progname, priority, stack, stacksize, entry_point, argv); if (ret < 0) {kmm_free(tcb); custom_free(stack);
return ret;
}
...