# This fixes a warning by moving new_mm from a userspace file, which can't # know anything about file handles because they have embedded list_heads, to # a kernelspace file, which can. Index: um/arch/um/kernel/skas/process.c =================================================================== --- um.orig/arch/um/kernel/skas/process.c 2004-08-10 11:33:02.000000000 -0400 +++ um/arch/um/kernel/skas/process.c 2004-08-10 11:45:10.000000000 -0400 @@ -343,28 +343,6 @@ siglongjmp(initial_jmpbuf, 4); } -int new_mm(int from) -{ - struct proc_mm_op copy; - int n; - int fd = open_file("/proc/mm", of_cloexec(of_write(OPENFLAGS())), 0); - - if(fd < 0) - return(fd); - - if(from != -1){ - copy = ((struct proc_mm_op) { .op = MM_COPY_SEGMENTS, - .u = - { .copy_segments = from } } ); - n = os_write_file(fd, ©, sizeof(copy)); - if(n != sizeof(copy)) - printk("new_mm : /proc/mm copy_segments failed, " - "err = %d\n", -n); - } - - return(fd); -} - void switch_mm_skas(int mm_fd) { int err; Index: um/arch/um/kernel/skas/process_kern.c =================================================================== --- um.orig/arch/um/kernel/skas/process_kern.c 2004-08-10 11:33:02.000000000 -0400 +++ um/arch/um/kernel/skas/process_kern.c 2004-08-10 11:45:10.000000000 -0400 @@ -15,6 +15,8 @@ #include "frame.h" #include "kern.h" #include "mode.h" +#include "filehandle.h" +#include "proc_mm.h" int singlestepping_skas(void) { @@ -134,6 +136,28 @@ return(0); } +int new_mm(int from) +{ + struct proc_mm_op copy; + int n; + int fd = open_file("/proc/mm", of_cloexec(of_write(OPENFLAGS())), 0); + + if(fd < 0) + return(fd); + + if(from != -1){ + copy = ((struct proc_mm_op) { .op = MM_COPY_SEGMENTS, + .u = + { .copy_segments = from } } ); + n = os_write_file(fd, ©, sizeof(copy)); + if(n != sizeof(copy)) + printk("new_mm : /proc/mm copy_segments failed, " + "err = %d\n", -n); + } + + return(fd); +} + void init_idle_skas(void) { cpu_tasks[current->processor].pid = os_getpid();