aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/kernel/ptrace.c
diff options
context:
space:
mode:
authorPetr Tesarik <ptesarik@suse.cz>2008-02-11 16:43:05 -0500
committerTony Luck <tony.luck@intel.com>2008-03-05 18:48:47 -0500
commiteac738e6cea16bfbd7b9018d60d009aedd2d14b6 (patch)
tree479a44d5e39403cfb57432aa57b2d0cfed90f41f /arch/ia64/kernel/ptrace.c
parente868a55c2a8cb72b66d7137fbcc54b82016e98eb (diff)
[IA64] convert sys_ptrace to arch_ptrace
Convert sys_ptrace() to arch_ptrace(). Signed-off-by: Petr Tesarik <ptesarik@suse.cz> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/kernel/ptrace.c')
-rw-r--r--arch/ia64/kernel/ptrace.c42
1 files changed, 3 insertions, 39 deletions
diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c
index e82fe296c2c0..1dfff5a8f365 100644
--- a/arch/ia64/kernel/ptrace.c
+++ b/arch/ia64/kernel/ptrace.c
@@ -1470,46 +1470,13 @@ ptrace_disable (struct task_struct *child)
1470 child_psr->tb = 0; 1470 child_psr->tb = 0;
1471} 1471}
1472 1472
1473asmlinkage long 1473long
1474sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data) 1474arch_ptrace (struct task_struct *child, long request, long addr, long data)
1475{ 1475{
1476 struct pt_regs *pt; 1476 struct pt_regs *pt;
1477 struct task_struct *child;
1478 struct switch_stack *sw; 1477 struct switch_stack *sw;
1479 long ret; 1478 long ret;
1480 1479
1481 lock_kernel();
1482 ret = -EPERM;
1483 if (request == PTRACE_TRACEME) {
1484 ret = ptrace_traceme();
1485 goto out;
1486 }
1487
1488 ret = -ESRCH;
1489 read_lock(&tasklist_lock);
1490 {
1491 child = find_task_by_pid(pid);
1492 if (child)
1493 get_task_struct(child);
1494 }
1495 read_unlock(&tasklist_lock);
1496 if (!child)
1497 goto out;
1498 ret = -EPERM;
1499 if (pid == 1) /* no messing around with init! */
1500 goto out_tsk;
1501
1502 if (request == PTRACE_ATTACH) {
1503 ret = ptrace_attach(child);
1504 if (!ret)
1505 arch_ptrace_attach(child);
1506 goto out_tsk;
1507 }
1508
1509 ret = ptrace_check_attach(child, request == PTRACE_KILL);
1510 if (ret < 0)
1511 goto out_tsk;
1512
1513 pt = task_pt_regs(child); 1480 pt = task_pt_regs(child);
1514 sw = (struct switch_stack *) (child->thread.ksp + 16); 1481 sw = (struct switch_stack *) (child->thread.ksp + 16);
1515 1482
@@ -1594,7 +1561,7 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data)
1594 */ 1561 */
1595 if (child->exit_state == EXIT_ZOMBIE) 1562 if (child->exit_state == EXIT_ZOMBIE)
1596 /* already dead */ 1563 /* already dead */
1597 goto out_tsk; 1564 return 0;
1598 child->exit_code = SIGKILL; 1565 child->exit_code = SIGKILL;
1599 1566
1600 ptrace_disable(child); 1567 ptrace_disable(child);
@@ -1643,9 +1610,6 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data)
1643 goto out_tsk; 1610 goto out_tsk;
1644 } 1611 }
1645 out_tsk: 1612 out_tsk:
1646 put_task_struct(child);
1647 out:
1648 unlock_kernel();
1649 return ret; 1613 return ret;
1650} 1614}
1651 1615