Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 96126
b: refs/heads/master
c: 1e38c12
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed May 7, 2008
1 parent 53aa19d commit 65d3e22
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5816339310b2d9623cf413d33e538b45e815da5d
refs/heads/master: 1e38c126c9252b612697e34f43b1b3371c8ee31d
20 changes: 16 additions & 4 deletions trunk/arch/sparc/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,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
Expand Down
18 changes: 15 additions & 3 deletions trunk/arch/sparc64/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,8 @@ asmlinkage long sparc_do_fork(unsigned long clone_flags,
unsigned long stack_size)
{
int __user *parent_tid_ptr, *child_tid_ptr;
unsigned long orig_i1 = regs->u_regs[UREG_I1];
long ret;

#ifdef CONFIG_COMPAT
if (test_thread_flag(TIF_32BIT)) {
Expand All @@ -515,9 +517,19 @@ asmlinkage long sparc_do_fork(unsigned long clone_flags,
child_tid_ptr = (int __user *) regs->u_regs[UREG_I4];
}

return do_fork(clone_flags, stack_start,
regs, stack_size,
parent_tid_ptr, child_tid_ptr);
ret = do_fork(clone_flags, stack_start,
regs, stack_size,
parent_tid_ptr, 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
Expand Down

0 comments on commit 65d3e22

Please sign in to comment.