PKCtxNew Layer
Function: kctx_new
kctx_newunsigned int kctx_new(void *entry, unsigned int id, unsigned int quota)
{
unsigned int child = alloc_mem_quota(id, quota); //* Allocate memory for the new child thread
kctx_set_eip(child, entry); //* Set the eip of the thread states
kctx_set_esp(child, (void *) &STACK_LOC[child][PAGESIZE]); //* Set the esp of the thread states
return child;
}Use Case
Last updated