This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / arch / um / kernel / skas / process.c
index a1a6b8d..7e48986 100644 (file)
@@ -78,7 +78,7 @@ static void handle_trap(int pid, union uml_pt_regs *regs)
                panic("handle_trap - continuing to end of syscall failed, "
                      "errno = %d\n", errno);
 
-       CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED));
+       err = waitpid(pid, &status, WUNTRACED);
        if((err < 0) || !WIFSTOPPED(status) || (WSTOPSIG(status) != SIGTRAP))
                panic("handle_trap - failed to wait at end of syscall, "
                      "errno = %d, status = %d\n", errno, status);
@@ -117,7 +117,7 @@ void start_userspace(int cpu)
                panic("start_userspace : clone failed, errno = %d", errno);
 
        do {
-               CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED));
+               n = waitpid(pid, &status, WUNTRACED);
                if(n < 0)
                        panic("start_userspace : wait failed, errno = %d", 
                              errno);
@@ -144,7 +144,7 @@ void userspace(union uml_pt_regs *regs)
                panic("userspace - PTRACE_SYSCALL failed, errno = %d\n", 
                       errno);
        while(1){
-               CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED));
+               err = waitpid(pid, &status, WUNTRACED);
                if(err < 0)
                        panic("userspace - waitpid failed, errno = %d\n", 
                              errno);
@@ -190,7 +190,7 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr,
                void (*handler)(int))
 {
        unsigned long flags;
-       sigjmp_buf switch_buf, fork_buf;
+       jmp_buf switch_buf, fork_buf;
 
        *switch_buf_ptr = &switch_buf;
        *fork_buf_ptr = &fork_buf;
@@ -214,7 +214,7 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr,
 
 void thread_wait(void *sw, void *fb)
 {
-       sigjmp_buf buf, **switch_buf = sw, *fork_buf;
+       jmp_buf buf, **switch_buf = sw, *fork_buf;
 
        *switch_buf = &buf;
        fork_buf = fb;
@@ -276,23 +276,23 @@ void restore_registers(union uml_pt_regs *regs)
 
 void switch_threads(void *me, void *next)
 {
-       sigjmp_buf my_buf, **me_ptr = me, *next_buf = next;
+       jmp_buf my_buf, **me_ptr = me, *next_buf = next;
        
        *me_ptr = &my_buf;
        if(sigsetjmp(my_buf, 1) == 0)
                siglongjmp(*next_buf, 1);
 }
 
-static sigjmp_buf initial_jmpbuf;
+static jmp_buf initial_jmpbuf;
 
 /* XXX Make these percpu */
 static void (*cb_proc)(void *arg);
 static void *cb_arg;
-static sigjmp_buf *cb_back;
+static jmp_buf *cb_back;
 
 int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr)
 {
-       sigjmp_buf **switch_buf = switch_buf_ptr;
+       jmp_buf **switch_buf = switch_buf_ptr;
        int n;
 
        *fork_buf_ptr = &initial_jmpbuf;
@@ -328,7 +328,7 @@ void remove_sigstack(void)
 
 void initial_thread_cb_skas(void (*proc)(void *), void *arg)
 {
-       sigjmp_buf here;
+       jmp_buf here;
 
        cb_proc = proc;
        cb_arg = arg;
@@ -356,6 +356,28 @@ void reboot_skas(void)
        siglongjmp(initial_jmpbuf, 4);
 }
 
+int new_mm(int from)
+{
+       struct proc_mm_op copy;
+       int n, fd = os_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, &copy, 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;