130,6 → 130,9 |
link_initialize(&t->wq_link); |
link_initialize(&t->th_link); |
|
/* call the architecture-specific part of the constructor */ |
thr_constructor_arch(t); |
|
#ifdef ARCH_HAS_FPU |
# ifdef CONFIG_FPU_LAZY |
t->saved_fpu_context = NULL; |
157,6 → 160,9 |
{ |
thread_t *t = (thread_t *) obj; |
|
/* call the architecture-specific part of the destructor */ |
thr_destructor_arch(t); |
|
frame_free(KA2PA(t->kstack)); |
#ifdef ARCH_HAS_FPU |
if (t->saved_fpu_context) |
210,7 → 216,7 |
i = (t->priority < RQ_COUNT -1) ? ++t->priority : t->priority; |
|
cpu = CPU; |
if (t->flags & X_WIRED) { |
if (t->flags & THREAD_FLAG_WIRED) { |
cpu = t->cpu; |
} |
t->state = Ready; |
296,8 → 302,6 |
if (!t) |
return NULL; |
|
thread_create_arch(t); |
|
/* Not needed, but good for debugging */ |
memsetb((uintptr_t) t->kstack, THREAD_STACK_SIZE * 1 << STACK_FRAMES, 0); |
|
323,7 → 327,7 |
t->ticks = -1; |
t->priority = -1; /* start in rq[0] */ |
t->cpu = NULL; |
t->flags = 0; |
t->flags = flags; |
t->state = Entering; |
t->call_me = NULL; |
t->call_me_with = NULL; |
348,6 → 352,8 |
t->fpu_context_exists = 0; |
t->fpu_context_engaged = 0; |
|
thread_create_arch(t); /* might depend on previous initialization */ |
|
/* |
* Attach to the containing task. |
*/ |
589,7 → 595,7 |
return (unative_t) rc; |
} |
|
if ((t = thread_create(uinit, kernel_uarg, TASK, 0, namebuf))) { |
if ((t = thread_create(uinit, kernel_uarg, TASK, THREAD_FLAG_USPACE, namebuf))) { |
tid = t->tid; |
thread_ready(t); |
return (unative_t) tid; |