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 @@ -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 @@ -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); --- 2.4.21pre4aa3/arch/um/include/user_util.h.~1~ 2003-02-24 19:12:52.000000000 +0100 +++ 2.4.21pre4aa3/arch/um/include/user_util.h 2003-03-05 11:24:10.000000000 +0100 @@ -88,6 +88,7 @@ extern void write_sigio_workaround(void) extern void arch_check_bugs(void); extern int arch_handle_signal(int sig, union uml_pt_regs *regs); extern int arch_fixup(unsigned long address, void *sc_ptr); +extern void forward_pending_sigio(int target); extern int can_do_skas(void); #endif --- 2.4.21pre4aa3/arch/um/kernel/tt/process_kern.c.~1~ 2003-02-24 19:12:53.000000000 +0100 +++ 2.4.21pre4aa3/arch/um/kernel/tt/process_kern.c 2003-03-05 11:22:04.000000000 +0100 @@ -51,6 +51,8 @@ void *_switch_to_tt(void *prev, void *ne alrm = change_sig(SIGALRM, 0); prof = change_sig(SIGPROF, 0); + forward_pending_sigio(to->thread.mode.tt.extern_pid); + c = 0; set_current(to); --- 2.4.21pre4aa3/arch/um/kernel/process.c.~1~ 2003-02-24 19:12:52.000000000 +0100 +++ 2.4.21pre4aa3/arch/um/kernel/process.c 2003-03-05 11:21:28.000000000 +0100 @@ -240,6 +240,16 @@ int run_kernel_thread(int (*fn)(void *), return(0); } +void forward_pending_sigio(int target) +{ + sigset_t sigs; + + if(sigpending(&sigs)) + panic("forward_pending_sigio : sigpending failed"); + if(sigismember(&sigs, SIGIO)) + kill(target, SIGIO); +} + int can_do_skas(void) { #ifdef UML_CONFIG_MODE_SKAS