diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-10-05 01:18:40 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-10-05 01:18:40 +0000 |
commit | 012bb3e61e5eced6c610f9e036372bf0c8def2d1 (patch) | |
tree | 87efc733f9b164e8c85c0336f92c8fb7eff6d183 /kernel/fork.c | |
parent | 625a1589d3d6464b5d90b8a0918789e3afffd220 (diff) |
Merge with Linux 2.4.0-test9. Please check DECstation, I had a number
of rejects to fixup while integrating Linus patches. I also found
that this kernel will only boot SMP on Origin; the UP kernel freeze
soon after bootup with SCSI timeout messages. I commit this anyway
since I found that the last CVS versions had the same problem.
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 64dd0f995..b93b0b0e4 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -500,15 +500,18 @@ out_release: static inline int copy_sighand(unsigned long clone_flags, struct task_struct * tsk) { + struct signal_struct *sig; + if (clone_flags & CLONE_SIGHAND) { atomic_inc(¤t->sig->count); return 0; } - tsk->sig = kmem_cache_alloc(sigact_cachep, GFP_KERNEL); - if (!tsk->sig) + sig = kmem_cache_alloc(sigact_cachep, GFP_KERNEL); + tsk->sig = sig; + if (!sig) return -1; - spin_lock_init(&tsk->sig->siglock); - atomic_set(&tsk->sig->count, 1); + spin_lock_init(&sig->siglock); + atomic_set(&sig->count, 1); memcpy(tsk->sig->action, current->sig->action, sizeof(tsk->sig->action)); return 0; } @@ -528,10 +531,15 @@ static inline void copy_flags(unsigned long clone_flags, struct task_struct *p) /* * Ok, this is the main fork-routine. It copies the system process - * information (task[nr]) and sets up the necessary registers. It - * also copies the data segment in its entirety. + * information (task[nr]) and sets up the necessary registers. It also + * copies the data segment in its entirety. The "stack_start" and + * "stack_top" arguments are simply passed along to the platform + * specific copy_thread() routine. Most platforms ignore stack_top. + * For an example that's using stack_top, see + * arch/ia64/kernel/process.c. */ -int do_fork(unsigned long clone_flags, unsigned long usp, struct pt_regs *regs) +int do_fork(unsigned long clone_flags, unsigned long stack_start, + struct pt_regs *regs, unsigned long stack_top) { int retval = -ENOMEM; struct task_struct *p; @@ -591,9 +599,7 @@ int do_fork(unsigned long clone_flags, unsigned long usp, struct pt_regs *regs) spin_lock_init(&p->alloc_lock); p->sigpending = 0; - sigemptyset(&p->signal); - p->sigqueue = NULL; - p->sigqueue_tail = &p->sigqueue; + init_sigpending(&p->pending); p->it_real_value = p->it_virt_value = p->it_prof_value = 0; p->it_real_incr = p->it_virt_incr = p->it_prof_incr = 0; @@ -628,7 +634,7 @@ int do_fork(unsigned long clone_flags, unsigned long usp, struct pt_regs *regs) goto bad_fork_cleanup_fs; if (copy_mm(clone_flags, p)) goto bad_fork_cleanup_sighand; - retval = copy_thread(0, clone_flags, usp, p, regs); + retval = copy_thread(0, clone_flags, stack_start, stack_top, p, regs); if (retval) goto bad_fork_cleanup_sighand; p->semundo = NULL; |