upgrade to linux 2.6.10-1.12_FC2
[linux-2.6.git] / arch / um / kernel / skas / process.c
index cb748f8..33e4620 100644 (file)
@@ -30,7 +30,7 @@
 
 int is_skas_winch(int pid, int fd, void *data)
 {
-       if(pid != getpid())
+       if(pid != os_getpid())
                return(0);
 
        register_winch_irq(-1, fd, -1, data);
@@ -64,7 +64,7 @@ static void handle_trap(int pid, union uml_pt_regs *regs, int local_using_sysemu
 
        syscall_nr = PT_SYSCALL_NR(regs->skas.regs);
        UPT_SYSCALL_NR(regs) = syscall_nr;
-       if(syscall_nr < 1){
+       if(syscall_nr < 0){
                relay_signal(SIGTRAP, regs);
                return;
        }
@@ -139,17 +139,16 @@ void start_userspace(int cpu)
 
 void userspace(union uml_pt_regs *regs)
 {
-       int err, status, op, pid = userspace_pid[0];
+       int err, status, op, pt_syscall_parm, pid = userspace_pid[0];
        int local_using_sysemu; /*To prevent races if using_sysemu changes under us.*/
 
        restore_registers(regs);
                
        local_using_sysemu = get_using_sysemu();
 
-       if (local_using_sysemu)
-               err = ptrace(PTRACE_SYSEMU, pid, 0, 0);
-       else
-               err = ptrace(PTRACE_SYSCALL, pid, 0, 0);
+       pt_syscall_parm = local_using_sysemu ? PTRACE_SYSEMU : PTRACE_SYSCALL;
+       err = ptrace(pt_syscall_parm, pid, 0, 0);
+
        if(err)
                panic("userspace - PTRACE_%s failed, errno = %d\n",
                       local_using_sysemu ? "SYSEMU" : "SYSCALL", errno);
@@ -189,13 +188,10 @@ void userspace(union uml_pt_regs *regs)
 
                /*Now we ended the syscall, so re-read local_using_sysemu.*/
                local_using_sysemu = get_using_sysemu();
+               pt_syscall_parm = local_using_sysemu ? PTRACE_SYSEMU : PTRACE_SYSCALL;
 
-               if (local_using_sysemu)
-                       op = singlestepping_skas() ? PTRACE_SINGLESTEP :
-                               PTRACE_SYSEMU;
-               else
-                       op = singlestepping_skas() ? PTRACE_SINGLESTEP :
-                               PTRACE_SYSCALL;
+               op = singlestepping(NULL) ? PTRACE_SINGLESTEP :
+                       pt_syscall_parm;
 
                err = ptrace(op, pid, 0, 0);
                if(err)
@@ -389,7 +385,7 @@ void switch_mm_skas(int mm_fd)
 void kill_off_processes_skas(void)
 {
 #warning need to loop over userspace_pids in kill_off_processes_skas
-       os_kill_process(userspace_pid[0], 1);
+       os_kill_ptraced_process(userspace_pid[0], 1);
 }
 
 void init_registers(int pid)