]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - arch/sparc/kernel/process.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[mv-sheeva.git] / arch / sparc / kernel / process.c
index 19186ce8850d15768e8b322a8d3b5a2d79e1728b..da48d248cc17d6d9da5f9cb4faf96d1cb41e17e2 100644 (file)
@@ -139,18 +139,12 @@ void cpu_idle(void)
 
 #endif
 
-extern char reboot_command [];
-
-extern void (*prom_palette)(int);
-
 /* XXX cli/sti -> local_irq_xxx here, check this works once SMP is fixed. */
 void machine_halt(void)
 {
        local_irq_enable();
        mdelay(8);
        local_irq_disable();
-       if (prom_palette)
-               prom_palette (1);
        prom_halt();
        panic("Halt failed!");
 }
@@ -165,8 +159,6 @@ void machine_restart(char * cmd)
 
        p = strchr (reboot_command, '\n');
        if (p) *p = 0;
-       if (prom_palette)
-               prom_palette (1);
        if (cmd)
                prom_reboot(cmd);
        if (*reboot_command)
@@ -365,8 +357,6 @@ void flush_thread(void)
 {
        current_thread_info()->w_saved = 0;
 
-       /* No new signal delivery by default */
-       current->thread.new_signal = 0;
 #ifndef CONFIG_SMP
        if(last_task_used_math == current) {
 #else
@@ -429,14 +419,26 @@ asmlinkage int sparc_do_fork(unsigned long clone_flags,
                              unsigned long stack_size)
 {
        unsigned long parent_tid_ptr, child_tid_ptr;
+       unsigned long orig_i1 = regs->u_regs[UREG_I1];
+       long ret;
 
        parent_tid_ptr = regs->u_regs[UREG_I2];
        child_tid_ptr = regs->u_regs[UREG_I4];
 
-       return do_fork(clone_flags, stack_start,
-                      regs, stack_size,
-                      (int __user *) parent_tid_ptr,
-                      (int __user *) child_tid_ptr);
+       ret = do_fork(clone_flags, stack_start,
+                     regs, stack_size,
+                     (int __user *) parent_tid_ptr,
+                     (int __user *) child_tid_ptr);
+
+       /* If we get an error and potentially restart the system
+        * call, we're screwed because copy_thread() clobbered
+        * the parent's %o1.  So detect that case and restore it
+        * here.
+        */
+       if ((unsigned long)ret >= -ERESTART_RESTARTBLOCK)
+               regs->u_regs[UREG_I1] = orig_i1;
+
+       return ret;
 }
 
 /* Copy a Sparc thread.  The fork() return value conventions
@@ -636,11 +638,6 @@ asmlinkage int sparc_execve(struct pt_regs *regs)
                          (char __user * __user *)regs->u_regs[base + UREG_I2],
                          regs);
        putname(filename);
-       if (error == 0) {
-               task_lock(current);
-               current->ptrace &= ~PT_DTRACE;
-               task_unlock(current);
-       }
 out:
        return error;
 }