Commit 3bfa3454 authored by Richard Henderson's avatar Richard Henderson

[ALPHA] Update for do_fork changes.

From Marc Zyngier <mzyngier@freesurf.fr>.
parent 2e815fb5
...@@ -235,23 +235,18 @@ int ...@@ -235,23 +235,18 @@ int
alpha_clone(unsigned long clone_flags, unsigned long usp, int *parent_tid, alpha_clone(unsigned long clone_flags, unsigned long usp, int *parent_tid,
int *child_tid, unsigned long tls_value, struct pt_regs *regs) int *child_tid, unsigned long tls_value, struct pt_regs *regs)
{ {
struct task_struct *p;
if (!usp) if (!usp)
usp = rdusp(); usp = rdusp();
p = do_fork(clone_flags & ~CLONE_IDLETASK, usp, regs, 0, return do_fork(clone_flags & ~CLONE_IDLETASK, usp, regs, 0,
parent_tid, child_tid); parent_tid, child_tid);
return IS_ERR(p) ? PTR_ERR(p) : p->pid;
} }
int int
alpha_vfork(struct pt_regs *regs) alpha_vfork(struct pt_regs *regs)
{ {
struct task_struct *p; return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, rdusp(),
p = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, rdusp(),
regs, 0, NULL, NULL); regs, 0, NULL, NULL);
return IS_ERR(p) ? PTR_ERR(p) : p->pid;
} }
/* /*
......
...@@ -417,7 +417,12 @@ fork_by_hand(void) ...@@ -417,7 +417,12 @@ fork_by_hand(void)
/* Don't care about the contents of regs since we'll never /* Don't care about the contents of regs since we'll never
reschedule the forked task. */ reschedule the forked task. */
struct pt_regs regs; struct pt_regs regs;
return do_fork(CLONE_VM|CLONE_IDLETASK, 0, &regs, 0, NULL, NULL); int pid;
pid = do_fork(CLONE_VM|CLONE_IDLETASK, 0, &regs, 0, NULL, NULL);
if (pid < 0)
return NULL;
return find_task_by_pid (pid);
} }
/* /*
...@@ -436,7 +441,7 @@ smp_boot_one_cpu(int cpuid) ...@@ -436,7 +441,7 @@ smp_boot_one_cpu(int cpuid)
wish. We can't use kernel_thread since we must avoid wish. We can't use kernel_thread since we must avoid
rescheduling the child. */ rescheduling the child. */
idle = fork_by_hand(); idle = fork_by_hand();
if (IS_ERR(idle)) if (!idle)
panic("failed fork for CPU %d", cpuid); panic("failed fork for CPU %d", cpuid);
init_idle(idle, cpuid); init_idle(idle, cpuid);
......
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