- /* setup run-queues */
- simple_lock_init(&pr->runq.lock, ETAP_THREAD_PROC_RUNQ);
- pr->runq.count = 0;
- for (i = 0; i < NRQBM; i++) {
- pr->runq.bitmap[i] = 0;
- }
- setbit(MAXPRI - IDLEPRI, pr->runq.bitmap);
- pr->runq.highq = IDLEPRI;
- for (i = 0; i < NRQS; i++) {
- queue_init(&(pr->runq.queues[i]));
- }
+ /* setup run queue */
+ simple_lock_init(&p->runq.lock, ETAP_THREAD_PROC_RUNQ);
+ for (i = 0; i < NRQBM; i++)
+ p->runq.bitmap[i] = 0;
+ setbit(MAXPRI - IDLEPRI, p->runq.bitmap);
+ p->runq.highq = IDLEPRI;
+ p->runq.urgency = p->runq.count = 0;
+ for (i = 0; i < NRQS; i++)
+ queue_init(&p->runq.queues[i]);
+
+ p->state = PROCESSOR_OFF_LINE;
+ p->current_pri = MINPRI;
+ p->next_thread = THREAD_NULL;
+ p->idle_thread = THREAD_NULL;
+ timer_call_setup(&p->quantum_timer, thread_quantum_expire, p);
+ p->slice_quanta = 0;
+ p->processor_set = PROCESSOR_SET_NULL;
+ p->processor_set_next = PROCESSOR_SET_NULL;
+ simple_lock_init(&p->lock, ETAP_THREAD_PROC);
+ p->processor_self = IP_NULL;
+ p->slot_num = slot_num;
+}