From: Adam H. <do...@de...> - 2002-03-09 10:19:44
|
There are a few minor issues with the current source, when CONFIG_SMP is enabled. * The use of CONFIG_SMP in a _user file(it gets the value defined in the system installed headers). * If fcntl(F_SETOWN) fails, check to see if the current owner is the one we were trying to set, before printing the warning. * Define mmu_gathers[]. diff -ruN 2.4.18-2um.orig/arch/um/include/process.h 2.4.18-2um/arch/um/include/process.h --- 2.4.18-2um.orig/arch/um/include/process.h Sat Mar 9 03:49:19 2002 +++ 2.4.18-2um/arch/um/include/process.h Sat Mar 9 00:49:28 2002 @@ -11,6 +11,7 @@ extern void sig_handler(int sig, struct sigcontext sc); extern void irq_handler(int sig, struct sigcontext sc); extern void alarm_handler(int sig, struct sigcontext sc); +extern int uml_smp_sigio_handler(void); #endif diff -ruN 2.4.18-2um.orig/arch/um/kernel/irq_user.c 2.4.18-2um/arch/um/kernel/irq_user.c --- 2.4.18-2um.orig/arch/um/kernel/irq_user.c Sat Mar 9 03:49:19 2002 +++ 2.4.18-2um/arch/um/kernel/irq_user.c Sat Mar 9 00:46:43 2002 @@ -42,10 +42,7 @@ struct irq_fd *irq_fd, *next; int i, n; -#ifdef CONFIG_SMP - IPI_handler(hard_smp_processor_id()); - if (hard_smp_processor_id() != 0) return; -#endif + if (uml_smp_sigio_handler()) return; while(1){ if((n = poll(pollfds, pollfds_num, 0)) < 0){ if(errno == EINTR) continue; @@ -238,8 +235,12 @@ void forward_ipi(int fd, int pid) { - if(fcntl(fd, F_SETOWN, pid) < 0) - printk("forward_ipi: F_SETOWN failed, errno = %d\n", errno); + if(fcntl(fd, F_SETOWN, pid) < 0){ + int save_errno = errno; + if(fcntl(fd, F_GETOWN, 0) != pid){ + printk("forward_ipi: F_SETOWN failed, fd=%i, me=%i, target=%i, errno = %d\n", fd, getpid(), pid, errno); + } + } } void forward_interrupts(int pid) diff -ruN 2.4.18-2um.orig/arch/um/kernel/mem.c 2.4.18-2um/arch/um/kernel/mem.c --- 2.4.18-2um.orig/arch/um/kernel/mem.c Sat Mar 9 03:49:19 2002 +++ 2.4.18-2um/arch/um/kernel/mem.c Fri Mar 8 23:00:21 2002 @@ -15,6 +15,7 @@ #include "asm/pgalloc.h" #include "asm/bitops.h" #include "asm/uaccess.h" +#include "asm/tlb.h" #include "user_util.h" #include "kern_util.h" #include "mem_user.h" @@ -43,6 +44,10 @@ extern long physmem_size; int kmalloc_ok = 0; + +#ifdef CONFIG_SMP +mmu_gather_t mmu_gathers[NR_CPUS]; +#endif void mem_init(void) { diff -ruN 2.4.18-2um.orig/arch/um/kernel/process_kern.c 2.4.18-2um/arch/um/kernel/process_kern.c --- 2.4.18-2um.orig/arch/um/kernel/process_kern.c Sat Mar 9 03:49:19 2002 +++ 2.4.18-2um/arch/um/kernel/process_kern.c Sat Mar 9 00:49:07 2002 @@ -736,6 +736,15 @@ struct task_struct *task = t; return(task->thread.request.u.trace_on.restore_state); +} + +int uml_smp_sigio_handler(void) +{ +#ifdef CONFIG_SMP + IPI_handler(hard_smp_processor_id()); + if (hard_smp_processor_id() != 0) return(1); +#endif + return(0); } /* |