Skip to content

Commit

Permalink
ptrace: change signature of arch_ptrace()
Browse files Browse the repository at this point in the history
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: Namhyung Kim <namhyung@gmail.com>
Cc: <linux-arch@vger.kernel.org>
Acked-by: Roland McGrath <roland@redhat.com>
Acked-by: David Howells <dhowells@redhat.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
namhyung authored and torvalds committed Oct 28, 2010
1 parent 9fed81d commit 9b05a69
Show file tree
Hide file tree
Showing 30 changed files with 101 additions and 70 deletions.
7 changes: 4 additions & 3 deletions arch/alpha/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,8 @@ void ptrace_disable(struct task_struct *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;
size_t copied;
Expand All @@ -292,7 +293,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
case PTRACE_PEEKUSR:
force_successful_syscall_return();
ret = get_reg(child, addr);
DBG(DBG_MEM, ("peek $%ld->%#lx\n", addr, ret));
DBG(DBG_MEM, ("peek $%lu->%#lx\n", addr, ret));
break;

/* When I and D space are separate, this will have to be fixed. */
Expand All @@ -302,7 +303,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
break;

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);
break;
default:
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,8 @@ static int ptrace_sethbpregs(struct task_struct *tsk, long num,
}
#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;

Expand Down
3 changes: 2 additions & 1 deletion arch/avr32/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ static int ptrace_setregs(struct task_struct *tsk, const void __user *uregs)
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;

Expand Down
3 changes: 2 additions & 1 deletion arch/blackfin/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ void user_disable_single_step(struct task_struct *child)
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;
unsigned long __user *datap = (unsigned long __user *)data;
Expand Down
7 changes: 4 additions & 3 deletions arch/cris/arch-v10/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ ptrace_disable(struct task_struct *child)
* (in user space) where the result of the ptrace call is written (instead of
* 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;
unsigned long __user *datap = (unsigned long __user *)data;
Expand Down Expand Up @@ -141,7 +142,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
break;
}

data += sizeof(long);
data += sizeof(unsigned long);
}

break;
Expand All @@ -165,7 +166,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
}

put_reg(child, i, tmp);
data += sizeof(long);
data += sizeof(unsigned long);
}

break;
Expand Down
3 changes: 2 additions & 1 deletion arch/cris/arch-v32/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
unsigned long __user *datap = (unsigned long __user *)data;
Expand Down
3 changes: 2 additions & 1 deletion arch/frv/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,8 @@ void ptrace_disable(struct task_struct *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;
int ret;
Expand Down
7 changes: 4 additions & 3 deletions arch/h8300/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ void ptrace_disable(struct task_struct *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;

Expand Down Expand Up @@ -120,7 +121,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
ret = -EFAULT;
break;
}
data += sizeof(long);
data += sizeof(unsigned long);
}
ret = 0;
break;
Expand All @@ -135,7 +136,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
break;
}
h8300_put_reg(child, i, tmp);
data += sizeof(long);
data += sizeof(unsigned long);
}
ret = 0;
break;
Expand Down
3 changes: 2 additions & 1 deletion arch/ia64/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,8 @@ ptrace_disable (struct task_struct *child)
}

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) {
case PTRACE_PEEKTEXT:
Expand Down
3 changes: 2 additions & 1 deletion arch/m32r/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,8 @@ void ptrace_disable(struct task_struct *child)
}

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;

Expand Down
9 changes: 5 additions & 4 deletions arch/m68k/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ void user_disable_single_step(struct task_struct *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;
int i, ret = 0;
Expand Down Expand Up @@ -200,7 +201,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
* into internal fpu reg representation
*/
if (FPU_IS_EMU && (addr < 45) && !(addr % 3)) {
data = (unsigned long)data << 15;
data <<= 15;
data = (data & 0xffff0000) |
((data & 0x0000ffff) >> 1);
}
Expand All @@ -215,7 +216,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
ret = put_user(tmp, (unsigned long *)data);
if (ret)
break;
data += sizeof(long);
data += sizeof(unsigned long);
}
break;

Expand All @@ -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;
}
put_reg(child, i, tmp);
data += sizeof(long);
data += sizeof(unsigned long);
}
break;

Expand Down
7 changes: 4 additions & 3 deletions arch/m68knommu/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ void ptrace_disable(struct task_struct *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;

Expand Down Expand Up @@ -184,7 +185,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
ret = -EFAULT;
break;
}
data += sizeof(long);
data += sizeof(unsigned long);
}
ret = 0;
break;
Expand All @@ -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);
}
put_reg(child, i, tmp);
data += sizeof(long);
data += sizeof(unsigned long);
}
ret = 0;
break;
Expand Down
3 changes: 2 additions & 1 deletion arch/microblaze/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ static microblaze_reg_t *reg_save_addr(unsigned 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;
unsigned long val = 0;
Expand Down
3 changes: 2 additions & 1 deletion arch/mips/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ int ptrace_set_watch_regs(struct task_struct *child,
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;

Expand Down
3 changes: 2 additions & 1 deletion arch/mn10300/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ void ptrace_disable(struct task_struct *child)
/*
* 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;
int ret;
Expand Down
11 changes: 6 additions & 5 deletions arch/parisc/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ void user_enable_block_step(struct task_struct *task)
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;
long ret = -EIO;
Expand All @@ -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
processes, the kernel saves all regs on a syscall. */
case PTRACE_PEEKUSR:
if ((addr & (sizeof(long)-1)) ||
(unsigned long) addr >= sizeof(struct pt_regs))
if ((addr & (sizeof(unsigned long)-1)) ||
addr >= sizeof(struct pt_regs))
break;
tmp = *(unsigned long *) ((char *) task_regs(child) + addr);
ret = put_user(tmp, (unsigned long *) data);
Expand Down Expand Up @@ -151,8 +152,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
break;
}

if ((addr & (sizeof(long)-1)) ||
(unsigned long) addr >= sizeof(struct pt_regs))
if ((addr & (sizeof(unsigned long)-1)) ||
addr >= sizeof(struct pt_regs))
break;
if ((addr >= PT_GR1 && addr <= PT_GR31) ||
addr == PT_IAOQ0 || addr == PT_IAOQ1 ||
Expand Down
15 changes: 8 additions & 7 deletions arch/powerpc/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
* 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,
long data)
static long arch_ptrace_old(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{
switch (request) {
case PPC_PTRACE_GETREGS: /* Get GPRs 0 - 31. */
Expand All @@ -1434,7 +1434,8 @@ static long arch_ptrace_old(struct task_struct *child, long request, long addr,
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;

Expand All @@ -1446,11 +1447,11 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
ret = -EIO;
/* convert to index and check */
#ifdef CONFIG_PPC32
index = (unsigned long) addr >> 2;
index = addr >> 2;
if ((addr & 3) || (index > PT_FPSCR)
|| (child->thread.regs == NULL))
#else
index = (unsigned long) addr >> 3;
index = addr >> 3;
if ((addr & 7) || (index > PT_FPSCR))
#endif
break;
Expand All @@ -1474,11 +1475,11 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
ret = -EIO;
/* convert to index and check */
#ifdef CONFIG_PPC32
index = (unsigned long) addr >> 2;
index = addr >> 2;
if ((addr & 3) || (index > PT_FPSCR)
|| (child->thread.regs == NULL))
#else
index = (unsigned long) addr >> 3;
index = addr >> 3;
if ((addr & 7) || (index > PT_FPSCR))
#endif
break;
Expand Down
3 changes: 2 additions & 1 deletion arch/s390/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,8 @@ poke_user(struct task_struct *child, addr_t addr, addr_t 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;
int copied, ret;
Expand Down
3 changes: 2 additions & 1 deletion arch/score/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,8 @@ void ptrace_disable(struct task_struct *child)
}

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;
unsigned long __user *datap = (void __user *)data;
Expand Down
Loading

0 comments on commit 9b05a69

Please sign in to comment.