static void run_cpu_task(int cpu, struct cpu_task *task) { struct cpu_data *cpud = &cpus[cpu]; acquire_spinlock(&cpud->lock); cpud->task = *task; cpud->task.error = ERR_BUSY; issue_cpu_interrupt(get_cpu_desc(cpu)->apic_id, INT_VECTOR_SCHEDULER_TASK); while (cpud->task.error == ERR_BUSY); *task = cpud->task; release_spinlock(&cpud->lock); }
static void run_cpu_task(int cpu, struct cpu_task *task) { struct cpu_data *cpud = &cpus[cpu]; acquire_spinlock(&cpud->lock, 0); cpud->task = *task; if (get_cpu() == cpu) handle_task_int(NULL, 0); else { cpud->task.error = ERR_BUSY; issue_cpu_interrupt(cpu, INT_VECTOR_SCHEDULER_TASK); while (cpud->task.error == ERR_BUSY); } *task = cpud->task; if (task->type != CPU_TASK_SELF_HALT) release_spinlock(&cpud->lock); }