95,6 → 95,7 |
{ |
thread_t *t = (thread_t *)obj; |
pfn_t pfn; |
int status; |
|
spinlock_initialize(&t->lock, "thread_t_lock"); |
link_initialize(&t->rq_link); |
102,10 → 103,10 |
link_initialize(&t->th_link); |
link_initialize(&t->threads_link); |
|
pfn = frame_alloc(ONE_FRAME, FRAME_KA | kmflags); |
pfn = frame_alloc_rc(ONE_FRAME, FRAME_KA | kmflags,&status); |
if (status) |
return -1; |
t->kstack = (__u8 *)PA2KA(PFN2ADDR(pfn)); |
if (!t->kstack) |
return -1; |
|
return 0; |
} |
229,6 → 230,8 |
ipl_t ipl; |
|
t = (thread_t *) slab_alloc(thread_slab, 0); |
if (!t) |
return NULL; |
|
/* Not needed, but good for debugging */ |
memsetb((__address)t->kstack, THREAD_STACK_SIZE, 0); |