From: Lennert B. <bu...@gn...> - 2002-01-06 11:14:58
|
Sorry I've been silent for a while, I was travelling back home from 'holidays'. I saw you dropped the process_kern.c bits from 00_cleanup_boot_logic.diff. Any particular reason? I thought you were happy with it.. --- linux-2.4.17-4um-untouched/arch/um/kernel/process_kern.c Sun Jan 6 11:30:40 2002 +++ linux-2.4.17-3um-build/arch/um/kernel/process_kern.c Sun Jan 6 12:12:41 2002 @@ -165,23 +165,21 @@ task->mm = &init_mm; task->active_mm = &init_mm; #ifdef CONFIG_SMP - if(cpu != -1){ + if(cpu != NO_PROC_ID) { + unsigned char c; + cpu_tasks[cpu].pid = extern_pid; cpu_tasks[cpu].task = task; inited_cpus++; init_tasks[cpu] = task; - if (test_and_set_bit(cpu, &cpu_online_map)) { - printk("huh, CPU#%d already present??\n", cpu); - BUG(); - } task->processor = cpu; - cont_pid(extern_pid); + write(task->thread.switch_pipe[1], &c, sizeof(c)); } #endif return(extern_pid); } -static int kernel_thread1(int (*fn)(void *), void * arg, unsigned long flags, +int kernel_thread1(int (*fn)(void *), void * arg, unsigned long flags, int cpu, int *extern_pid_out) { struct task_struct *new_task; @@ -441,9 +441,9 @@ return(current->pid); } -static void do_idle(void) +int cpu_idle(void) { - if (current->processor == 0) idle_timer(); + if (current->processor == 0) idle_timer(); atomic_inc(&init_mm.mm_count); current->mm = &init_mm; @@ -464,33 +464,7 @@ } idle_sleep(10); } -} - -static int idle_proc(void *unused) -{ - set_current(current); - del_from_runqueue(current); - init_idle(); -#ifdef CONFIG_SMP - smp_num_cpus++; -#endif - do_idle(); - return(0); -} -int cpu_idle(void) -{ - int i, pid; - - if(ncpus > 1){ - printk(KERN_INFO "Starting up other processors:\n"); - for(i=1;i<ncpus;i++){ - kernel_thread1(idle_proc, NULL, 0, i, &pid); - printk(KERN_INFO "\t#%d - idle thread pid = %d\n", - i, pid); - } - } - do_idle(); return(0); } |