diff options
| author | Petr Tesarik <ptesarik@suse.cz> | 2008-02-11 16:43:05 -0500 |
|---|---|---|
| committer | Tony Luck <tony.luck@intel.com> | 2008-03-05 18:48:47 -0500 |
| commit | eac738e6cea16bfbd7b9018d60d009aedd2d14b6 (patch) | |
| tree | 479a44d5e39403cfb57432aa57b2d0cfed90f41f | |
| parent | e868a55c2a8cb72b66d7137fbcc54b82016e98eb (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>
| -rw-r--r-- | arch/ia64/kernel/ptrace.c | 42 | ||||
| -rw-r--r-- | include/asm-ia64/ptrace.h | 2 |
2 files changed, 3 insertions, 41 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 | ||
| 1473 | asmlinkage long | 1473 | long |
| 1474 | sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data) | 1474 | arch_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 | ||
diff --git a/include/asm-ia64/ptrace.h b/include/asm-ia64/ptrace.h index 0bdce7dde1b0..5b5234098783 100644 --- a/include/asm-ia64/ptrace.h +++ b/include/asm-ia64/ptrace.h | |||
| @@ -233,8 +233,6 @@ struct switch_stack { | |||
| 233 | #include <asm/current.h> | 233 | #include <asm/current.h> |
| 234 | #include <asm/page.h> | 234 | #include <asm/page.h> |
| 235 | 235 | ||
| 236 | #define __ARCH_SYS_PTRACE 1 | ||
| 237 | |||
| 238 | /* | 236 | /* |
| 239 | * We use the ia64_psr(regs)->ri to determine which of the three | 237 | * We use the ia64_psr(regs)->ri to determine which of the three |
| 240 | * instructions in bundle (16 bytes) took the sample. Generate | 238 | * instructions in bundle (16 bytes) took the sample. Generate |
