[POWERPC] Use generic compat_sys_ptrace
This replaces powerpc's compat_sys_ptrace with a compat_arch_ptrace and enables the new generic definition of compat_sys_ptrace instead. Signed-off-by: Roland McGrath <roland@redhat.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
Родитель
1d48d71c06
Коммит
81e695c026
|
@ -85,33 +85,13 @@ static long compat_ptrace_old(struct task_struct *child, long request,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
long compat_sys_ptrace(int request, int pid, unsigned long addr,
|
long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
|
||||||
unsigned long data)
|
compat_ulong_t caddr, compat_ulong_t cdata)
|
||||||
{
|
{
|
||||||
struct task_struct *child;
|
unsigned long addr = caddr;
|
||||||
|
unsigned long data = cdata;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
lock_kernel();
|
|
||||||
if (request == PTRACE_TRACEME) {
|
|
||||||
ret = ptrace_traceme();
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
child = ptrace_get_task_struct(pid);
|
|
||||||
if (IS_ERR(child)) {
|
|
||||||
ret = PTR_ERR(child);
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (request == PTRACE_ATTACH) {
|
|
||||||
ret = ptrace_attach(child);
|
|
||||||
goto out_tsk;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = ptrace_check_attach(child, request == PTRACE_KILL);
|
|
||||||
if (ret < 0)
|
|
||||||
goto out_tsk;
|
|
||||||
|
|
||||||
switch (request) {
|
switch (request) {
|
||||||
/*
|
/*
|
||||||
* Read 4 bytes of the other process' storage
|
* Read 4 bytes of the other process' storage
|
||||||
|
@ -375,9 +355,6 @@ long compat_sys_ptrace(int request, int pid, unsigned long addr,
|
||||||
ret = compat_ptrace_request(child, request, addr, data);
|
ret = compat_ptrace_request(child, request, addr, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
out_tsk:
|
|
||||||
put_task_struct(child);
|
|
||||||
out:
|
|
||||||
unlock_kernel();
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,6 +55,8 @@ struct pt_regs {
|
||||||
|
|
||||||
#ifdef __powerpc64__
|
#ifdef __powerpc64__
|
||||||
|
|
||||||
|
#define __ARCH_WANT_COMPAT_SYS_PTRACE
|
||||||
|
|
||||||
#define STACK_FRAME_OVERHEAD 112 /* size of minimum stack frame */
|
#define STACK_FRAME_OVERHEAD 112 /* size of minimum stack frame */
|
||||||
|
|
||||||
/* Size of dummy stack frame allocated when calling signal handler. */
|
/* Size of dummy stack frame allocated when calling signal handler. */
|
||||||
|
|
Загрузка…
Ссылка в новой задаче