Commit fada4013 authored by Andrew Morton's avatar Andrew Morton Committed by David S. Miller

[PATCH] ppc64 update for do_fork() change

This updates ppc64 for the do_fork() semantics change.
parent a193c746
...@@ -300,7 +300,6 @@ int sys_clone(unsigned long clone_flags, unsigned long p2, unsigned long p3, ...@@ -300,7 +300,6 @@ int sys_clone(unsigned long clone_flags, unsigned long p2, unsigned long p3,
unsigned long p4, unsigned long p5, unsigned long p6, unsigned long p4, unsigned long p5, unsigned long p6,
struct pt_regs *regs) struct pt_regs *regs)
{ {
struct task_struct *p;
unsigned long parent_tidptr = 0; unsigned long parent_tidptr = 0;
unsigned long child_tidptr = 0; unsigned long child_tidptr = 0;
...@@ -320,36 +319,29 @@ int sys_clone(unsigned long clone_flags, unsigned long p2, unsigned long p3, ...@@ -320,36 +319,29 @@ int sys_clone(unsigned long clone_flags, unsigned long p2, unsigned long p3,
if (regs->msr & MSR_FP) if (regs->msr & MSR_FP)
giveup_fpu(current); giveup_fpu(current);
p = do_fork(clone_flags & ~CLONE_IDLETASK, p2, regs, 0, return do_fork(clone_flags & ~CLONE_IDLETASK, p2, regs, 0,
(int *)parent_tidptr, (int *)child_tidptr); (int *)parent_tidptr, (int *)child_tidptr);
return IS_ERR(p) ? PTR_ERR(p) : p->pid;
} }
int sys_fork(unsigned long p1, unsigned long p2, unsigned long p3, int sys_fork(unsigned long p1, unsigned long p2, unsigned long p3,
unsigned long p4, unsigned long p5, unsigned long p6, unsigned long p4, unsigned long p5, unsigned long p6,
struct pt_regs *regs) struct pt_regs *regs)
{ {
struct task_struct *p;
if (regs->msr & MSR_FP) if (regs->msr & MSR_FP)
giveup_fpu(current); giveup_fpu(current);
p = do_fork(SIGCHLD, regs->gpr[1], regs, 0, NULL, NULL); return do_fork(SIGCHLD, regs->gpr[1], regs, 0, NULL, NULL);
return IS_ERR(p) ? PTR_ERR(p) : p->pid;
} }
int sys_vfork(unsigned long p1, unsigned long p2, unsigned long p3, int sys_vfork(unsigned long p1, unsigned long p2, unsigned long p3,
unsigned long p4, unsigned long p5, unsigned long p6, unsigned long p4, unsigned long p5, unsigned long p6,
struct pt_regs *regs) struct pt_regs *regs)
{ {
struct task_struct *p;
if (regs->msr & MSR_FP) if (regs->msr & MSR_FP)
giveup_fpu(current); giveup_fpu(current);
p = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->gpr[1], regs, 0, return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->gpr[1], regs, 0,
NULL, NULL); NULL, NULL);
return IS_ERR(p) ? PTR_ERR(p) : p->pid;
} }
int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2, int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2,
......
...@@ -610,10 +610,11 @@ int __devinit __cpu_up(unsigned int cpu) ...@@ -610,10 +610,11 @@ int __devinit __cpu_up(unsigned int cpu)
/* create a process for the processor */ /* create a process for the processor */
/* only regs.msr is actually used, and 0 is OK for it */ /* only regs.msr is actually used, and 0 is OK for it */
memset(&regs, 0, sizeof(struct pt_regs)); memset(&regs, 0, sizeof(struct pt_regs));
p = do_fork(CLONE_VM|CLONE_IDLETASK, 0, &regs, 0, NULL, NULL); p = copy_process(CLONE_VM|CLONE_IDLETASK, 0, &regs, 0, NULL, NULL);
if (IS_ERR(p)) if (IS_ERR(p))
panic("failed fork for CPU %u: %li", cpu, PTR_ERR(p)); panic("failed fork for CPU %u: %li", cpu, PTR_ERR(p));
wake_up_forked_process(p);
init_idle(p, cpu); init_idle(p, cpu);
unhash_process(p); unhash_process(p);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment