diff options
| author | Linus Torvalds <torvalds@home.transmeta.com> | 2003-05-20 04:35:09 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2003-05-20 04:35:09 -0700 |
| commit | bb37b84ada551883274bec90df9c919931d9d6c1 (patch) | |
| tree | d42f51fb4a65b4f3f6b48a87b449def3bfd3db1c | |
| parent | da94c7b259f87666cbf84b36a3a73d25a4c0137b (diff) | |
| parent | 68494a35f259ca0e764403f9b93f3af2666afb1a (diff) | |
Merge penguin:v2.5/linux
into home.transmeta.com:/home/torvalds/v2.5/linux
| -rw-r--r-- | arch/alpha/kernel/process.c | 13 | ||||
| -rw-r--r-- | arch/alpha/kernel/ptrace.c | 14 | ||||
| -rw-r--r-- | arch/alpha/kernel/smp.c | 9 | ||||
| -rw-r--r-- | arch/arm/kernel/sys_arm.c | 14 |
4 files changed, 21 insertions, 29 deletions
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c index 768e2fb81dee..473a4adf767f 100644 --- a/arch/alpha/kernel/process.c +++ b/arch/alpha/kernel/process.c @@ -235,23 +235,18 @@ int alpha_clone(unsigned long clone_flags, unsigned long usp, int *parent_tid, int *child_tid, unsigned long tls_value, struct pt_regs *regs) { - struct task_struct *p; - if (!usp) usp = rdusp(); - p = do_fork(clone_flags & ~CLONE_IDLETASK, usp, regs, 0, - parent_tid, child_tid); - return IS_ERR(p) ? PTR_ERR(p) : p->pid; + return do_fork(clone_flags & ~CLONE_IDLETASK, usp, regs, 0, + parent_tid, child_tid); } int alpha_vfork(struct pt_regs *regs) { - struct task_struct *p; - p = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, rdusp(), - regs, 0, NULL, NULL); - return IS_ERR(p) ? PTR_ERR(p) : p->pid; + return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, rdusp(), + regs, 0, NULL, NULL); } /* diff --git a/arch/alpha/kernel/ptrace.c b/arch/alpha/kernel/ptrace.c index 26da8d1e30f1..6bb4b2aeb2ad 100644 --- a/arch/alpha/kernel/ptrace.c +++ b/arch/alpha/kernel/ptrace.c @@ -366,8 +366,8 @@ do_sys_ptrace(long request, long pid, long addr, long data, ret = -EIO; if ((unsigned long) data > _NSIG) break; - /* Mark single stepping. */ - child->thread_info->bpt_nsaved = -1; + /* Set single stepping. */ + ptrace_set_bpt(child); clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); wake_up_process(child); child->exit_code = data; @@ -397,11 +397,11 @@ syscall_trace(void) return; if (!(current->ptrace & PT_PTRACED)) return; - current->exit_code = SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) - ? 0x80 : 0); - current->state = TASK_STOPPED; - notify_parent(current, SIGCHLD); - schedule(); + /* The 0x80 provides a way for the tracing parent to distinguish + between a syscall stop and SIGTRAP delivery */ + ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) + ? 0x80 : 0)); + /* * This isn't the same as continuing with a signal, but it will do * for normal use. strace only continues with a signal if the diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c index b23cde1f1a99..f23daf3df6e9 100644 --- a/arch/alpha/kernel/smp.c +++ b/arch/alpha/kernel/smp.c @@ -417,7 +417,12 @@ fork_by_hand(void) /* Don't care about the contents of regs since we'll never reschedule the forked task. */ struct pt_regs regs; - return do_fork(CLONE_VM|CLONE_IDLETASK, 0, ®s, 0, NULL, NULL); + int pid; + pid = do_fork(CLONE_VM|CLONE_IDLETASK, 0, ®s, 0, NULL, NULL); + if (pid < 0) + return NULL; + + return find_task_by_pid (pid); } /* @@ -436,7 +441,7 @@ smp_boot_one_cpu(int cpuid) wish. We can't use kernel_thread since we must avoid rescheduling the child. */ idle = fork_by_hand(); - if (IS_ERR(idle)) + if (!idle) panic("failed fork for CPU %d", cpuid); init_idle(idle, cpuid); diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c index 5bfc2997e659..364efedbe884 100644 --- a/arch/arm/kernel/sys_arm.c +++ b/arch/arm/kernel/sys_arm.c @@ -238,9 +238,7 @@ asmlinkage int sys_ipc (uint call, int first, int second, int third, void *ptr, */ asmlinkage int sys_fork(struct pt_regs *regs) { - struct task_struct *p; - p = do_fork(SIGCHLD, regs->ARM_sp, regs, 0, NULL, NULL); - return IS_ERR(p) ? PTR_ERR(p) : p->pid; + return do_fork(SIGCHLD, regs->ARM_sp, regs, 0, NULL, NULL); } /* Clone a task - this clones the calling program thread. @@ -248,8 +246,6 @@ asmlinkage int sys_fork(struct pt_regs *regs) */ asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, struct pt_regs *regs) { - struct task_struct *p; - /* * We don't support SETTID / CLEARTID */ @@ -259,16 +255,12 @@ asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, struct if (!newsp) newsp = regs->ARM_sp; - p = do_fork(clone_flags & ~CLONE_IDLETASK, newsp, regs, 0, NULL, NULL); - - return IS_ERR(p) ? PTR_ERR(p) : p->pid; + return do_fork(clone_flags & ~CLONE_IDLETASK, newsp, regs, 0, NULL, NULL); } asmlinkage int sys_vfork(struct pt_regs *regs) { - struct task_struct *p; - p = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->ARM_sp, regs, 0, NULL, NULL); - return IS_ERR(p) ? PTR_ERR(p) : p->pid; + return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->ARM_sp, regs, 0, NULL, NULL); } /* sys_execve() executes a new program. |
