- setbit(MAXPRI - IDLEPRI, pr->runq.bitmap);
- pr->runq.highq = IDLEPRI;
- for (i = 0; i < NRQS; i++) {
- queue_init(&(pr->runq.queues[i]));
+
+ processor->state = PROCESSOR_OFF_LINE;
+ processor->active_thread = processor->next_thread = processor->idle_thread = THREAD_NULL;
+ processor->processor_set = pset;
+ processor->current_pri = MINPRI;
+ processor->current_thmode = TH_MODE_NONE;
+ processor->cpu_id = cpu_id;
+ timer_call_setup(&processor->quantum_timer, thread_quantum_expire, processor);
+ processor->deadline = UINT64_MAX;
+ processor->timeslice = 0;
+ processor->processor_meta = PROCESSOR_META_NULL;
+ processor->processor_self = IP_NULL;
+ processor_data_init(processor);
+ processor->processor_list = NULL;
+
+ pset_lock(pset);
+ if (pset->cpu_set_count++ == 0)
+ pset->cpu_set_low = pset->cpu_set_hi = cpu_id;
+ else {
+ pset->cpu_set_low = (cpu_id < pset->cpu_set_low)? cpu_id: pset->cpu_set_low;
+ pset->cpu_set_hi = (cpu_id > pset->cpu_set_hi)? cpu_id: pset->cpu_set_hi;