Commit 9b05a69e authored by Namhyung Kim's avatar Namhyung Kim Committed by Linus Torvalds

ptrace: change signature of arch_ptrace()

Fix up the arguments to arch_ptrace() to take account of the fact that
@addr and @data are now unsigned long rather than long as of a preceding
patch in this series.
Signed-off-by: default avatarNamhyung Kim <namhyung@gmail.com>
Cc: <linux-arch@vger.kernel.org>
Acked-by: default avatarRoland McGrath <roland@redhat.com>
Acked-by: default avatarDavid Howells <dhowells@redhat.com>
Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 9fed81dc
...@@ -269,7 +269,8 @@ void ptrace_disable(struct task_struct *child) ...@@ -269,7 +269,8 @@ void ptrace_disable(struct task_struct *child)
user_disable_single_step(child); user_disable_single_step(child);
} }
long arch_ptrace(struct task_struct *child, long request, long addr, long data) long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ {
unsigned long tmp; unsigned long tmp;
size_t copied; size_t copied;
...@@ -292,7 +293,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) ...@@ -292,7 +293,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
case PTRACE_PEEKUSR: case PTRACE_PEEKUSR:
force_successful_syscall_return(); force_successful_syscall_return();
ret = get_reg(child, addr); ret = get_reg(child, addr);
DBG(DBG_MEM, ("peek $%ld->%#lx\n", addr, ret)); DBG(DBG_MEM, ("peek $%lu->%#lx\n", addr, ret));
break; break;
/* When I and D space are separate, this will have to be fixed. */ /* When I and D space are separate, this will have to be fixed. */
...@@ -302,7 +303,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) ...@@ -302,7 +303,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
break; break;
case PTRACE_POKEUSR: /* write the specified register */ case PTRACE_POKEUSR: /* write the specified register */
DBG(DBG_MEM, ("poke $%ld<-%#lx\n", addr, data)); DBG(DBG_MEM, ("poke $%lu<-%#lx\n", addr, data));
ret = put_reg(child, addr, data); ret = put_reg(child, addr, data);
break; break;
default: default:
......
...@@ -1075,7 +1075,8 @@ static int ptrace_sethbpregs(struct task_struct *tsk, long num, ...@@ -1075,7 +1075,8 @@ static int ptrace_sethbpregs(struct task_struct *tsk, long num,
} }
#endif #endif
long arch_ptrace(struct task_struct *child, long request, long addr, long data) long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ {
int ret; int ret;
......
...@@ -146,7 +146,8 @@ static int ptrace_setregs(struct task_struct *tsk, const void __user *uregs) ...@@ -146,7 +146,8 @@ static int ptrace_setregs(struct task_struct *tsk, const void __user *uregs)
return ret; return ret;
} }
long arch_ptrace(struct task_struct *child, long request, long addr, long data) long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ {
int ret; int ret;
......
...@@ -240,7 +240,8 @@ void user_disable_single_step(struct task_struct *child) ...@@ -240,7 +240,8 @@ void user_disable_single_step(struct task_struct *child)
clear_tsk_thread_flag(child, TIF_SINGLESTEP); clear_tsk_thread_flag(child, TIF_SINGLESTEP);
} }
long arch_ptrace(struct task_struct *child, long request, long addr, long data) long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ {
int ret; int ret;
unsigned long __user *datap = (unsigned long __user *)data; unsigned long __user *datap = (unsigned long __user *)data;
......
...@@ -76,7 +76,8 @@ ptrace_disable(struct task_struct *child) ...@@ -76,7 +76,8 @@ ptrace_disable(struct task_struct *child)
* (in user space) where the result of the ptrace call is written (instead of * (in user space) where the result of the ptrace call is written (instead of
* being returned). * being returned).
*/ */
long arch_ptrace(struct task_struct *child, long request, long addr, long data) long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ {
int ret; int ret;
unsigned long __user *datap = (unsigned long __user *)data; unsigned long __user *datap = (unsigned long __user *)data;
...@@ -141,7 +142,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) ...@@ -141,7 +142,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
break; break;
} }
data += sizeof(long); data += sizeof(unsigned long);
} }
break; break;
...@@ -165,7 +166,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) ...@@ -165,7 +166,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
} }
put_reg(child, i, tmp); put_reg(child, i, tmp);
data += sizeof(long); data += sizeof(unsigned long);
} }
break; break;
......
...@@ -126,7 +126,8 @@ ptrace_disable(struct task_struct *child) ...@@ -126,7 +126,8 @@ ptrace_disable(struct task_struct *child)
} }
long arch_ptrace(struct task_struct *child, long request, long addr, long data) long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ {
int ret; int ret;
unsigned long __user *datap = (unsigned long __user *)data; unsigned long __user *datap = (unsigned long __user *)data;
......
...@@ -254,7 +254,8 @@ void ptrace_disable(struct task_struct *child) ...@@ -254,7 +254,8 @@ void ptrace_disable(struct task_struct *child)
user_disable_single_step(child); user_disable_single_step(child);
} }
long arch_ptrace(struct task_struct *child, long request, long addr, long data) long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ {
unsigned long tmp; unsigned long tmp;
int ret; int ret;
......
...@@ -50,7 +50,8 @@ void ptrace_disable(struct task_struct *child) ...@@ -50,7 +50,8 @@ void ptrace_disable(struct task_struct *child)
user_disable_single_step(child); user_disable_single_step(child);
} }
long arch_ptrace(struct task_struct *child, long request, long addr, long data) long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ {
int ret; int ret;
...@@ -120,7 +121,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) ...@@ -120,7 +121,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
ret = -EFAULT; ret = -EFAULT;
break; break;
} }
data += sizeof(long); data += sizeof(unsigned long);
} }
ret = 0; ret = 0;
break; break;
...@@ -135,7 +136,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) ...@@ -135,7 +136,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
break; break;
} }
h8300_put_reg(child, i, tmp); h8300_put_reg(child, i, tmp);
data += sizeof(long); data += sizeof(unsigned long);
} }
ret = 0; ret = 0;
break; break;
......
...@@ -1177,7 +1177,8 @@ ptrace_disable (struct task_struct *child) ...@@ -1177,7 +1177,8 @@ ptrace_disable (struct task_struct *child)
} }
long long
arch_ptrace (struct task_struct *child, long request, long addr, long data) arch_ptrace (struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ {
switch (request) { switch (request) {
case PTRACE_PEEKTEXT: case PTRACE_PEEKTEXT:
......
...@@ -622,7 +622,8 @@ void ptrace_disable(struct task_struct *child) ...@@ -622,7 +622,8 @@ void ptrace_disable(struct task_struct *child)
} }
long long
arch_ptrace(struct task_struct *child, long request, long addr, long data) arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ {
int ret; int ret;
......
...@@ -156,7 +156,8 @@ void user_disable_single_step(struct task_struct *child) ...@@ -156,7 +156,8 @@ void user_disable_single_step(struct task_struct *child)
singlestep_disable(child); singlestep_disable(child);
} }
long arch_ptrace(struct task_struct *child, long request, long addr, long data) long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ {
unsigned long tmp; unsigned long tmp;
int i, ret = 0; int i, ret = 0;
...@@ -200,7 +201,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) ...@@ -200,7 +201,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
* into internal fpu reg representation * into internal fpu reg representation
*/ */
if (FPU_IS_EMU && (addr < 45) && !(addr % 3)) { if (FPU_IS_EMU && (addr < 45) && !(addr % 3)) {
data = (unsigned long)data << 15; data <<= 15;
data = (data & 0xffff0000) | data = (data & 0xffff0000) |
((data & 0x0000ffff) >> 1); ((data & 0x0000ffff) >> 1);
} }
...@@ -215,7 +216,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) ...@@ -215,7 +216,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
ret = put_user(tmp, (unsigned long *)data); ret = put_user(tmp, (unsigned long *)data);
if (ret) if (ret)
break; break;
data += sizeof(long); data += sizeof(unsigned long);
} }
break; break;
...@@ -229,7 +230,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) ...@@ -229,7 +230,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
tmp |= get_reg(child, PT_SR) & ~SR_MASK; tmp |= get_reg(child, PT_SR) & ~SR_MASK;
} }
put_reg(child, i, tmp); put_reg(child, i, tmp);
data += sizeof(long); data += sizeof(unsigned long);
} }
break; break;
......
...@@ -112,7 +112,8 @@ void ptrace_disable(struct task_struct *child) ...@@ -112,7 +112,8 @@ void ptrace_disable(struct task_struct *child)
user_disable_single_step(child); user_disable_single_step(child);
} }
long arch_ptrace(struct task_struct *child, long request, long addr, long data) long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ {
int ret; int ret;
...@@ -184,7 +185,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) ...@@ -184,7 +185,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
ret = -EFAULT; ret = -EFAULT;
break; break;
} }
data += sizeof(long); data += sizeof(unsigned long);
} }
ret = 0; ret = 0;
break; break;
...@@ -204,7 +205,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) ...@@ -204,7 +205,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
tmp |= get_reg(child, PT_SR) & ~(SR_MASK << 16); tmp |= get_reg(child, PT_SR) & ~(SR_MASK << 16);
} }
put_reg(child, i, tmp); put_reg(child, i, tmp);
data += sizeof(long); data += sizeof(unsigned long);
} }
ret = 0; ret = 0;
break; break;
......
...@@ -73,7 +73,8 @@ static microblaze_reg_t *reg_save_addr(unsigned reg_offs, ...@@ -73,7 +73,8 @@ static microblaze_reg_t *reg_save_addr(unsigned reg_offs,
return (microblaze_reg_t *)((char *)regs + reg_offs); return (microblaze_reg_t *)((char *)regs + reg_offs);
} }
long arch_ptrace(struct task_struct *child, long request, long addr, long data) long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ {
int rval; int rval;
unsigned long val = 0; unsigned long val = 0;
......
...@@ -255,7 +255,8 @@ int ptrace_set_watch_regs(struct task_struct *child, ...@@ -255,7 +255,8 @@ int ptrace_set_watch_regs(struct task_struct *child,
return 0; return 0;
} }
long arch_ptrace(struct task_struct *child, long request, long addr, long data) long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ {
int ret; int ret;
......
...@@ -295,7 +295,8 @@ void ptrace_disable(struct task_struct *child) ...@@ -295,7 +295,8 @@ void ptrace_disable(struct task_struct *child)
/* /*
* handle the arch-specific side of process tracing * handle the arch-specific side of process tracing
*/ */
long arch_ptrace(struct task_struct *child, long request, long addr, long data) long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ {
unsigned long tmp; unsigned long tmp;
int ret; int ret;
......
...@@ -110,7 +110,8 @@ void user_enable_block_step(struct task_struct *task) ...@@ -110,7 +110,8 @@ void user_enable_block_step(struct task_struct *task)
pa_psw(task)->l = 0; pa_psw(task)->l = 0;
} }
long arch_ptrace(struct task_struct *child, long request, long addr, long data) long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ {
unsigned long tmp; unsigned long tmp;
long ret = -EIO; long ret = -EIO;
...@@ -120,8 +121,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) ...@@ -120,8 +121,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
/* Read the word at location addr in the USER area. For ptraced /* Read the word at location addr in the USER area. For ptraced
processes, the kernel saves all regs on a syscall. */ processes, the kernel saves all regs on a syscall. */
case PTRACE_PEEKUSR: case PTRACE_PEEKUSR:
if ((addr & (sizeof(long)-1)) || if ((addr & (sizeof(unsigned long)-1)) ||
(unsigned long) addr >= sizeof(struct pt_regs)) addr >= sizeof(struct pt_regs))
break; break;
tmp = *(unsigned long *) ((char *) task_regs(child) + addr); tmp = *(unsigned long *) ((char *) task_regs(child) + addr);
ret = put_user(tmp, (unsigned long *) data); ret = put_user(tmp, (unsigned long *) data);
...@@ -151,8 +152,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) ...@@ -151,8 +152,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
break; break;
} }
if ((addr & (sizeof(long)-1)) || if ((addr & (sizeof(unsigned long)-1)) ||
(unsigned long) addr >= sizeof(struct pt_regs)) addr >= sizeof(struct pt_regs))
break; break;
if ((addr >= PT_GR1 && addr <= PT_GR31) || if ((addr >= PT_GR1 && addr <= PT_GR31) ||
addr == PT_IAOQ0 || addr == PT_IAOQ1 || addr == PT_IAOQ0 || addr == PT_IAOQ1 ||
......
...@@ -1406,8 +1406,8 @@ static long ppc_del_hwdebug(struct task_struct *child, long addr, long data) ...@@ -1406,8 +1406,8 @@ static long ppc_del_hwdebug(struct task_struct *child, long addr, long data)
* Here are the old "legacy" powerpc specific getregs/setregs ptrace calls, * Here are the old "legacy" powerpc specific getregs/setregs ptrace calls,
* we mark them as obsolete now, they will be removed in a future version * we mark them as obsolete now, they will be removed in a future version
*/ */
static long arch_ptrace_old(struct task_struct *child, long request, long addr, static long arch_ptrace_old(struct task_struct *child, long request,
long data) unsigned long addr, unsigned long data)
{ {
switch (request) { switch (request) {
case PPC_PTRACE_GETREGS: /* Get GPRs 0 - 31. */ case PPC_PTRACE_GETREGS: /* Get GPRs 0 - 31. */
...@@ -1434,7 +1434,8 @@ static long arch_ptrace_old(struct task_struct *child, long request, long addr, ...@@ -1434,7 +1434,8 @@ static long arch_ptrace_old(struct task_struct *child, long request, long addr,
return -EPERM; return -EPERM;
} }
long arch_ptrace(struct task_struct *child, long request, long addr, long data) long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ {
int ret = -EPERM; int ret = -EPERM;
...@@ -1446,11 +1447,11 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) ...@@ -1446,11 +1447,11 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
ret = -EIO; ret = -EIO;
/* convert to index and check */ /* convert to index and check */
#ifdef CONFIG_PPC32 #ifdef CONFIG_PPC32
index = (unsigned long) addr >> 2; index = addr >> 2;
if ((addr & 3) || (index > PT_FPSCR) if ((addr & 3) || (index > PT_FPSCR)
|| (child->thread.regs == NULL)) || (child->thread.regs == NULL))
#else #else
index = (unsigned long) addr >> 3; index = addr >> 3;
if ((addr & 7) || (index > PT_FPSCR)) if ((addr & 7) || (index > PT_FPSCR))
#endif #endif
break; break;
...@@ -1474,11 +1475,11 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) ...@@ -1474,11 +1475,11 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
ret = -EIO; ret = -EIO;
/* convert to index and check */ /* convert to index and check */
#ifdef CONFIG_PPC32 #ifdef CONFIG_PPC32
index = (unsigned long) addr >> 2; index = addr >> 2;
if ((addr & 3) || (index > PT_FPSCR) if ((addr & 3) || (index > PT_FPSCR)
|| (child->thread.regs == NULL)) || (child->thread.regs == NULL))
#else #else
index = (unsigned long) addr >> 3; index = addr >> 3;
if ((addr & 7) || (index > PT_FPSCR)) if ((addr & 7) || (index > PT_FPSCR))
#endif #endif
break; break;
......
...@@ -343,7 +343,8 @@ poke_user(struct task_struct *child, addr_t addr, addr_t data) ...@@ -343,7 +343,8 @@ poke_user(struct task_struct *child, addr_t addr, addr_t data)
return __poke_user(child, addr, data); return __poke_user(child, addr, data);
} }
long arch_ptrace(struct task_struct *child, long request, long addr, long data) long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ {
ptrace_area parea; ptrace_area parea;
int copied, ret; int copied, ret;
......
...@@ -325,7 +325,8 @@ void ptrace_disable(struct task_struct *child) ...@@ -325,7 +325,8 @@ void ptrace_disable(struct task_struct *child)
} }
long long
arch_ptrace(struct task_struct *child, long request, long addr, long data) arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ {
int ret; int ret;
unsigned long __user *datap = (void __user *)data; unsigned long __user *datap = (void __user *)data;
......
...@@ -365,7 +365,8 @@ const struct user_regset_view *task_user_regset_view(struct task_struct *task) ...@@ -365,7 +365,8 @@ const struct user_regset_view *task_user_regset_view(struct task_struct *task)
return &user_sh_native_view; return &user_sh_native_view;
} }
long arch_ptrace(struct task_struct *child, long request, long addr, long data) long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ {
struct user * dummy = NULL; struct user * dummy = NULL;
unsigned long __user *datap = (unsigned long __user *)data; unsigned long __user *datap = (unsigned long __user *)data;
...@@ -383,17 +384,17 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) ...@@ -383,17 +384,17 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
if (addr < sizeof(struct pt_regs)) if (addr < sizeof(struct pt_regs))
tmp = get_stack_long(child, addr); tmp = get_stack_long(child, addr);
else if (addr >= (long) &dummy->fpu && else if (addr >= (unsigned long) &dummy->fpu &&
addr < (long) &dummy->u_fpvalid) { addr < (unsigned long) &dummy->u_fpvalid) {
if (!tsk_used_math(child)) { if (!tsk_used_math(child)) {
if (addr == (long)&dummy->fpu.fpscr) if (addr == (unsigned long)&dummy->fpu.fpscr)
tmp = FPSCR_INIT; tmp = FPSCR_INIT;
else else
tmp = 0; tmp = 0;
} else } else
tmp = ((long *)child->thread.xstate) tmp = ((unsigned long *)child->thread.xstate)
[(addr - (long)&dummy->fpu) >> 2]; [(addr - (long)&dummy->fpu) >> 2];
} else if (addr == (long) &dummy->u_fpvalid) } else if (addr == (unsigned long) &dummy->u_fpvalid)
tmp = !!tsk_used_math(child); tmp = !!tsk_used_math(child);
else if (addr == PT_TEXT_ADDR) else if (addr == PT_TEXT_ADDR)
tmp = child->mm->start_code; tmp = child->mm->start_code;
...@@ -417,13 +418,13 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) ...@@ -417,13 +418,13 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
if (addr < sizeof(struct pt_regs)) if (addr < sizeof(struct pt_regs))
ret = put_stack_long(child, addr, data); ret = put_stack_long(child, addr, data);
else if (addr >= (long) &dummy->fpu && else if (addr >= (unsigned long) &dummy->fpu &&
addr < (long) &dummy->u_fpvalid) { addr < (unsigned long) &dummy->u_fpvalid) {
set_stopped_child_used_math(child); set_stopped_child_used_math(child);
((long *)child->thread.xstate) ((unsigned long *)child->thread.xstate)
[(addr - (long)&dummy->fpu) >> 2] = data; [(addr - (long)&dummy->fpu) >> 2] = data;
ret = 0; ret = 0;
} else if (addr == (long) &dummy->u_fpvalid) { } else if (addr == (unsigned long) &dummy->u_fpvalid) {
conditional_stopped_child_used_math(data, child); conditional_stopped_child_used_math(data, child);
ret = 0; ret = 0;
} }
......
...@@ -383,7 +383,8 @@ const struct user_regset_view *task_user_regset_view(struct task_struct *task) ...@@ -383,7 +383,8 @@ const struct user_regset_view *task_user_regset_view(struct task_struct *task)
return &user_sh64_native_view; return &user_sh64_native_view;
} }
long arch_ptrace(struct task_struct *child, long request, long addr, long data) long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ {
int ret; int ret;
...@@ -471,7 +472,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) ...@@ -471,7 +472,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
return ret; return ret;
} }
asmlinkage int sh64_ptrace(long request, long pid, long addr, long data) asmlinkage int sh64_ptrace(long request, long pid,
unsigned long addr, unsigned long data)
{ {
#define WPC_DBRMODE 0x0d104008 #define WPC_DBRMODE 0x0d104008
static unsigned long first_call; static unsigned long first_call;
......
...@@ -323,7 +323,8 @@ const struct user_regset_view *task_user_regset_view(struct task_struct *task) ...@@ -323,7 +323,8 @@ const struct user_regset_view *task_user_regset_view(struct task_struct *task)
return &user_sparc32_view; return &user_sparc32_view;
} }
long arch_ptrace(struct task_struct *child, long request, long addr, long data) long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ {
unsigned long addr2 = current->thread.kregs->u_regs[UREG_I4]; unsigned long addr2 = current->thread.kregs->u_regs[UREG_I4];
const struct user_regset_view *view; const struct user_regset_view *view;
......
...@@ -969,7 +969,8 @@ struct fps { ...@@ -969,7 +969,8 @@ struct fps {
unsigned long fsr; unsigned long fsr;
}; };
long arch_ptrace(struct task_struct *child, long request, long addr, long data) long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ {
const struct user_regset_view *view = task_user_regset_view(current); const struct user_regset_view *view = task_user_regset_view(current);
unsigned long addr2 = task_pt_regs(current)->u_regs[UREG_I4]; unsigned long addr2 = task_pt_regs(current)->u_regs[UREG_I4];
...@@ -977,8 +978,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) ...@@ -977,8 +978,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
struct fps __user *fps; struct fps __user *fps;
int ret; int ret;
pregs = (struct pt_regs __user *) (unsigned long) addr; pregs = (struct pt_regs __user *) addr;
fps = (struct fps __user *) (unsigned long) addr; fps = (struct fps __user *) addr;
switch (request) { switch (request) {
case PTRACE_PEEKUSR: case PTRACE_PEEKUSR:
......
...@@ -45,7 +45,8 @@ void ptrace_disable(struct task_struct *child) ...@@ -45,7 +45,8 @@ void ptrace_disable(struct task_struct *child)
clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
} }
long arch_ptrace(struct task_struct *child, long request, long addr, long data) long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ {
unsigned long __user *datap = (long __user __force *)data; unsigned long __user *datap = (long __user __force *)data;
unsigned long tmp; unsigned long tmp;
...@@ -98,7 +99,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) ...@@ -98,7 +99,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
if (!access_ok(VERIFY_WRITE, datap, PTREGS_SIZE)) if (!access_ok(VERIFY_WRITE, datap, PTREGS_SIZE))
break; break;
childregs = (long *)task_pt_regs(child); childregs = (long *)task_pt_regs(child);
for (i = 0; i < sizeof(struct pt_regs)/sizeof(long); ++i) { for (i = 0; i < sizeof(struct pt_regs)/sizeof(unsigned long);
++i) {
ret = __put_user(childregs[i], &datap[i]); ret = __put_user(childregs[i], &datap[i]);
if (ret != 0) if (ret != 0)
break; break;
...@@ -109,7 +111,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) ...@@ -109,7 +111,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
if (!access_ok(VERIFY_READ, datap, PTREGS_SIZE)) if (!access_ok(VERIFY_READ, datap, PTREGS_SIZE))
break; break;
childregs = (long *)task_pt_regs(child); childregs = (long *)task_pt_regs(child);
for (i = 0; i < sizeof(struct pt_regs)/sizeof(long); ++i) { for (i = 0; i < sizeof(struct pt_regs)/sizeof(unsigned long);
++i) {
ret = __get_user(childregs[i], &datap[i]); ret = __get_user(childregs[i], &datap[i]);
if (ret != 0) if (ret != 0)
break; break;
......
...@@ -42,10 +42,11 @@ void ptrace_disable(struct task_struct *child) ...@@ -42,10 +42,11 @@ void ptrace_disable(struct task_struct *child)
extern int peek_user(struct task_struct * child, long addr, long data); extern int peek_user(struct task_struct * child, long addr, long data);
extern int poke_user(struct task_struct * child, long addr, long data); extern int poke_user(struct task_struct * child, long addr, long data);
long arch_ptrace(struct task_struct *child, long request, long addr, long data) long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ {
int i, ret; int i, ret;
unsigned long __user *p = (void __user *)(unsigned long)data; unsigned long __user *p = (void __user *)data;
switch (request) { switch (request) {
/* read word at location addr. */ /* read word at location addr. */
......
...@@ -203,8 +203,8 @@ int set_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child) ...@@ -203,8 +203,8 @@ int set_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)
(unsigned long *) &fpregs); (unsigned long *) &fpregs);
} }
long subarch_ptrace(struct task_struct *child, long request, long addr, long subarch_ptrace(struct task_struct *child, long request,
long data) unsigned long addr, unsigned long data)
{ {
return -EIO; return -EIO;
} }
...@@ -175,8 +175,8 @@ int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) ...@@ -175,8 +175,8 @@ int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
return restore_fp_registers(userspace_pid[cpu], fpregs); return restore_fp_registers(userspace_pid[cpu], fpregs);
} }
long subarch_ptrace(struct task_struct *child, long request, long addr, long subarch_ptrace(struct task_struct *child, long request,
long data) unsigned long addr, unsigned long data)
{ {
int ret = -EIO; int ret = -EIO;
......
...@@ -801,7 +801,8 @@ void ptrace_disable(struct task_struct *child) ...@@ -801,7 +801,8 @@ void ptrace_disable(struct task_struct *child)
static const struct user_regset_view user_x86_32_view; /* Initialized below. */ static const struct user_regset_view user_x86_32_view; /* Initialized below. */
#endif #endif
long arch_ptrace(struct task_struct *child, long request, long addr, long data) long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ {
int ret; int ret;
unsigned long __user *datap = (unsigned long __user *)data; unsigned long __user *datap = (unsigned long __user *)data;
...@@ -888,14 +889,14 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) ...@@ -888,14 +889,14 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
#if defined CONFIG_X86_32 || defined CONFIG_IA32_EMULATION #if defined CONFIG_X86_32 || defined CONFIG_IA32_EMULATION
case PTRACE_GET_THREAD_AREA: case PTRACE_GET_THREAD_AREA:
if (addr < 0) if ((int) addr < 0)
return -EIO; return -EIO;
ret = do_get_thread_area(child, addr, ret = do_get_thread_area(child, addr,
(struct user_desc __user *) data); (struct user_desc __user *) data);
break; break;
case PTRACE_SET_THREAD_AREA: case PTRACE_SET_THREAD_AREA:
if (addr < 0) if ((int) addr < 0)
return -EIO; return -EIO;
ret = do_set_thread_area(child, addr, ret = do_set_thread_area(child, addr,
(struct user_desc __user *) data, 0); (struct user_desc __user *) data, 0);
......
...@@ -256,7 +256,8 @@ int ptrace_pokeusr(struct task_struct *child, long regno, long val) ...@@ -256,7 +256,8 @@ int ptrace_pokeusr(struct task_struct *child, long regno, long val)
return 0; return 0;
} }
long arch_ptrace(struct task_struct *child, long request, long addr, long data) long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{ {
int ret = -EPERM; int ret = -EPERM;
......
...@@ -100,7 +100,8 @@ ...@@ -100,7 +100,8 @@
#include <linux/sched.h> /* For struct task_struct. */ #include <linux/sched.h> /* For struct task_struct. */
extern long arch_ptrace(struct task_struct *child, long request, long addr, long data); extern long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data);
extern int ptrace_traceme(void); extern int ptrace_traceme(void);
extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len); extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len);
extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len); extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment