DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
If TCB_FLAG_CUSTOM_STACK were not set in the TCB flags, the OS would attempt to free the stack using kmm_free() which is probably not what you want in this case.
The actual logic is a slightly more complex and somewhat redundant:
- If
TCB_FLAG_CUSTOM_STACKis set in the TCB flags, no attempt will be made to free the custom stack. - If
TCB_FLAG_CUSTOM_STACKis not set in the TCB flags, the stack will be de-allocated for the kernel thread only if the stack lies in the kernel memory pool.
So in reality TCB_FLAG_CUSTOM_STACK may not be necessary. But the safest option is to include it in all cases where you do not expect the custom stack to be de-allocated.
You must not free the custom stack after nxtask_activate() returns successfully and until the kernel thread is terminated.
...