diff options
Diffstat (limited to 'arch/sparc/kernel/process.c')
| -rw-r--r-- | arch/sparc/kernel/process.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/arch/sparc/kernel/process.c b/arch/sparc/kernel/process.c index e7f35198ae34..36431f377dee 100644 --- a/arch/sparc/kernel/process.c +++ b/arch/sparc/kernel/process.c | |||
| @@ -419,14 +419,26 @@ asmlinkage int sparc_do_fork(unsigned long clone_flags, | |||
| 419 | unsigned long stack_size) | 419 | unsigned long stack_size) |
| 420 | { | 420 | { |
| 421 | unsigned long parent_tid_ptr, child_tid_ptr; | 421 | unsigned long parent_tid_ptr, child_tid_ptr; |
| 422 | unsigned long orig_i1 = regs->u_regs[UREG_I1]; | ||
| 423 | long ret; | ||
| 422 | 424 | ||
| 423 | parent_tid_ptr = regs->u_regs[UREG_I2]; | 425 | parent_tid_ptr = regs->u_regs[UREG_I2]; |
| 424 | child_tid_ptr = regs->u_regs[UREG_I4]; | 426 | child_tid_ptr = regs->u_regs[UREG_I4]; |
| 425 | 427 | ||
| 426 | return do_fork(clone_flags, stack_start, | 428 | ret = do_fork(clone_flags, stack_start, |
| 427 | regs, stack_size, | 429 | regs, stack_size, |
| 428 | (int __user *) parent_tid_ptr, | 430 | (int __user *) parent_tid_ptr, |
| 429 | (int __user *) child_tid_ptr); | 431 | (int __user *) child_tid_ptr); |
| 432 | |||
| 433 | /* If we get an error and potentially restart the system | ||
| 434 | * call, we're screwed because copy_thread() clobbered | ||
| 435 | * the parent's %o1. So detect that case and restore it | ||
| 436 | * here. | ||
| 437 | */ | ||
| 438 | if ((unsigned long)ret >= -ERESTART_RESTARTBLOCK) | ||
| 439 | regs->u_regs[UREG_I1] = orig_i1; | ||
| 440 | |||
| 441 | return ret; | ||
| 430 | } | 442 | } |
| 431 | 443 | ||
| 432 | /* Copy a Sparc thread. The fork() return value conventions | 444 | /* Copy a Sparc thread. The fork() return value conventions |
