diff -urNp x-ref/arch/um/kernel/init_task.c x/arch/um/kernel/init_task.c --- x-ref/arch/um/kernel/init_task.c 2003-02-14 05:11:15.000000000 +0100 +++ x/arch/um/kernel/init_task.c 2003-02-14 05:11:16.000000000 +0100 @@ -7,6 +7,7 @@ #include "linux/mm.h" #include "linux/sched.h" #include "linux/version.h" +#include "linux/sched_runqueue.h" #include "asm/uaccess.h" #include "asm/pgtable.h" #include "user_util.h" --- ./arch/um/drivers/mconsole_kern.c.~1~ 2003-02-14 07:21:38.000000000 +0100 +++ ./arch/um/drivers/mconsole_kern.c 2003-02-14 18:15:36.000000000 +0100 @@ -104,20 +104,7 @@ void mconsole_version(struct mc_request } #define UML_MCONSOLE_HELPTEXT \ -"Commands: - version - Get kernel version - help - Print this message - halt - Halt UML - reboot - Reboot UML - config = - Add a new device to UML; - same syntax as command line - config - Query the configuration of a device - remove - Remove a device from UML - sysrq - Performs the SysRq action controlled by the letter - cad - invoke the Ctl-Alt-Del handler - stop - pause the UML; it will do nothing until it receives a 'go' - go - continue the UML after a 'stop' -" +"Commands:\n version - Get kernel version\n help - Print this message\n halt - Halt UML\n reboot - Reboot UML\n config = - Add a new device to UML; \n same syntax as command line\n config - Query the configuration of a device\n remove - Remove a device from UML\n sysrq - Performs the SysRq action controlled by the letter\n cad - invoke the Ctl-Alt-Del handler\n stop - pause the UML; it will do nothing until it receives a 'go'\n go - continue the UML after a 'stop'\n" void mconsole_help(struct mc_request *req) { --- ./arch/um/include/kern_util.h.~1~ 2003-02-14 07:21:38.000000000 +0100 +++ ./arch/um/include/kern_util.h 2003-02-14 18:22:31.000000000 +0100 @@ -106,7 +106,7 @@ extern int is_syscall(unsigned long addr extern void arch_switch(void); extern void free_irq(unsigned int, void *); extern int um_in_interrupt(void); -extern int cpu(void); +extern int uml_cpu(void); #endif /* --- ./arch/um/kernel/skas/process_kern.c.~1~ 2003-02-14 07:21:38.000000000 +0100 +++ ./arch/um/kernel/skas/process_kern.c 2003-02-14 18:26:09.000000000 +0100 @@ -60,8 +60,10 @@ void new_thread_handler(int sig) thread_wait(¤t->thread.mode.skas.switch_buf, current->thread.mode.skas.fork_buf); +#ifdef CONFIG_SMP if(current->thread.prev_sched != NULL) schedule_tail(current->thread.prev_sched); +#endif current->thread.prev_sched = NULL; n = run_kernel_thread(fn, arg, ¤t->thread.exec_buf); @@ -91,8 +93,10 @@ void fork_handler(int sig) current->thread.mode.skas.fork_buf); force_flush_all(); +#ifdef CONFIG_SMP if(current->thread.prev_sched != NULL) schedule_tail(current->thread.prev_sched); +#endif current->thread.prev_sched = NULL; unblock_signals(); @@ -133,7 +137,7 @@ int copy_thread_skas(int nr, unsigned lo void init_idle_skas(void) { - cpu_tasks[current->processor].pid = os_getpid(); + cpu_tasks[cpu()].pid = os_getpid(); } extern void start_kernel(void); --- ./arch/um/kernel/skas/trap_user.c.~1~ 2003-02-14 07:21:38.000000000 +0100 +++ ./arch/um/kernel/skas/trap_user.c 2003-02-14 18:26:33.000000000 +0100 @@ -42,7 +42,7 @@ void user_signal(int sig, union uml_pt_r struct signal_info *info; if(sig == SIGVTALRM) - missed_ticks[cpu()]++; + missed_ticks[uml_cpu()]++; regs->skas.is_user = 1; regs->skas.fault_addr = 0; regs->skas.fault_type = 0; --- ./arch/um/kernel/tt/ptproxy/proxy.c.~1~ 2003-02-14 07:21:38.000000000 +0100 +++ ./arch/um/kernel/tt/ptproxy/proxy.c 2003-02-14 17:59:03.000000000 +0100 @@ -292,12 +292,7 @@ void fake_child_exit(void) errno); } -char gdb_init_string[] = -"att 1 -b panic -b stop -handle SIGWINCH nostop noprint pass -"; +char gdb_init_string[] = "att 1\nb panic\nb stop\nhandle SIGWINCH nostop noprint pass\n"; int start_debugger(char *prog, int startup, int stop, int *fd_out) { --- ./arch/um/kernel/tt/exec_kern.c.~1~ 2003-02-14 07:21:38.000000000 +0100 +++ ./arch/um/kernel/tt/exec_kern.c 2003-02-14 17:59:52.000000000 +0100 @@ -46,7 +46,7 @@ void flush_thread_tt(void) do_exit(SIGKILL); } - if(current->processor == 0) + if(cpu() == 0) forward_interrupts(new_pid); current->thread.request.op = OP_EXEC; current->thread.request.u.exec.pid = new_pid; --- ./arch/um/kernel/tt/process_kern.c.~1~ 2003-02-14 07:21:38.000000000 +0100 +++ ./arch/um/kernel/tt/process_kern.c 2003-02-14 18:19:20.000000000 +0100 @@ -39,7 +39,7 @@ void *_switch_to_tt(void *prev, void *ne to->thread.prev_sched = from; - cpu = from->processor; + cpu = from->cpu; if(cpu == 0) forward_interrupts(to->thread.mode.tt.extern_pid); #ifdef CONFIG_SMP @@ -125,8 +125,10 @@ static void new_thread_handler(int sig) free_page(current->thread.temp_stack); set_cmdline("(kernel thread)"); force_flush_all(); +#ifdef CONFIG_SMP if(current->thread.prev_sched != NULL) schedule_tail(current->thread.prev_sched); +#endif current->thread.prev_sched = NULL; change_sig(SIGUSR1, 1); change_sig(SIGVTALRM, 1); @@ -165,8 +167,10 @@ static void finish_fork_handler(int sig) protect_memory(uml_reserved, high_physmem - uml_reserved, 1, 1, 0, 1); task_protections((unsigned long) current); +#ifdef CONFIG_SMP if(current->thread.prev_sched != NULL) schedule_tail(current->thread.prev_sched); +#endif current->thread.prev_sched = NULL; free_page(current->thread.temp_stack); @@ -300,7 +304,7 @@ int do_proc_op(void *t, int proc_id) pid = thread->request.u.exec.pid; do_exec(thread->mode.tt.extern_pid, pid); thread->mode.tt.extern_pid = pid; - cpu_tasks[task->processor].pid = pid; + cpu_tasks[task->cpu].pid = pid; break; case OP_FORK: attach_process(thread->request.u.fork.pid); --- ./arch/um/kernel/tt/gdb_kern.c.~1~ 2003-02-14 07:21:38.000000000 +0100 +++ ./arch/um/kernel/tt/gdb_kern.c 2003-02-14 18:02:29.000000000 +0100 @@ -5,6 +5,7 @@ #include "linux/init.h" #include "linux/config.h" +#include "asm/types.h" #include "mconsole_kern.h" #ifdef CONFIG_MCONSOLE --- ./arch/um/kernel/process_kern.c.~1~ 2003-02-14 07:21:38.000000000 +0100 +++ ./arch/um/kernel/process_kern.c 2003-02-14 18:23:32.000000000 +0100 @@ -124,7 +124,7 @@ void set_current(void *t) { struct task_struct *task = t; - cpu_tasks[task->processor] = ((struct cpu_task) + cpu_tasks[task->cpu] = ((struct cpu_task) { external_pid(task), task }); } @@ -360,7 +360,7 @@ int clear_user_proc(void *buf, int size) int smp_sigio_handler(void) { #ifdef CONFIG_SMP - int cpu = current->processor; + int cpu = cpu(); IPI_handler(cpu); if(cpu != 0) @@ -374,9 +374,9 @@ int um_in_interrupt(void) return(in_interrupt()); } -int cpu(void) +int uml_cpu(void) { - return(current->processor); + return(current->cpu); } /* --- ./arch/um/kernel/config.c.in.~1~ 2003-02-14 07:21:38.000000000 +0100 +++ ./arch/um/kernel/config.c.in 2003-02-14 18:12:08.000000000 +0100 @@ -7,9 +7,7 @@ #include #include "init.h" -static __initdata char *config = " -CONFIG -"; +static __initdata char *config = "FIXME"; static int __init print_config(char *line, int *add) { --- ./arch/um/kernel/time_kern.c.~1~ 2003-02-14 07:21:38.000000000 +0100 +++ ./arch/um/kernel/time_kern.c 2003-02-14 18:13:35.000000000 +0100 @@ -37,7 +37,7 @@ int __attribute__ ((__section__ (".unpro void timer_irq(union uml_pt_regs *regs) { - int cpu = current->processor, ticks = missed_ticks[cpu]; + int cpu = current->cpu, ticks = missed_ticks[cpu]; if(!timer_irq_inited) return; missed_ticks[cpu] = 0; @@ -123,7 +123,7 @@ void timer_handler(int sig, union uml_pt #ifdef CONFIG_SMP update_process_times(user_context(UPT_SP(regs))); #endif - if(current->processor == 0) + if(current->cpu == 0) timer_irq(regs); } --- ./arch/um/kernel/ksyms.c.~1~ 2003-02-14 07:21:38.000000000 +0100 +++ ./arch/um/kernel/ksyms.c 2003-02-14 18:17:10.000000000 +0100 @@ -64,8 +64,6 @@ EXPORT_SYMBOL(dump_thread); */ EXPORT_SYMBOL(sys_open); EXPORT_SYMBOL(sys_lseek); -EXPORT_SYMBOL(sys_read); -EXPORT_SYMBOL(sys_wait4); #ifdef CONFIG_SMP --- ./arch/um/kernel/trap_user.c.~1~ 2003-02-14 07:21:38.000000000 +0100 +++ ./arch/um/kernel/trap_user.c 2003-02-14 18:22:48.000000000 +0100 @@ -107,7 +107,7 @@ extern int timer_irq_inited, missed_tick void alarm_handler(int sig, struct sigcontext sc) { if(!timer_irq_inited) return; - missed_ticks[cpu()]++; + missed_ticks[uml_cpu()]++; if(sig == SIGALRM) switch_timers(0);