X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Falpha%2Fkernel%2Fptrace.c;h=379617048cd84ae2428fc58d7c37dde8ad25bca7;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=aa654cc85369c5b9380b64828dba95cedc70179a;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/arch/alpha/kernel/ptrace.c b/arch/alpha/kernel/ptrace.c index aa654cc85..379617048 100644 --- a/arch/alpha/kernel/ptrace.c +++ b/arch/alpha/kernel/ptrace.c @@ -91,15 +91,15 @@ static int regoff[] = { PT_REG( pc) }; -static long zero; +static unsigned long zero; /* * Get address of register REGNO in task TASK. */ -static long * +static unsigned long * get_reg_addr(struct task_struct * task, unsigned long regno) { - long *addr; + unsigned long *addr; if (regno == 30) { addr = &task->thread_info->pcb.usp; @@ -109,7 +109,7 @@ get_reg_addr(struct task_struct * task, unsigned long regno) zero = 0; addr = &zero; } else { - addr = (long *)((long)task->thread_info + regoff[regno]); + addr = (void *)task->thread_info + regoff[regno]; } return addr; } @@ -117,7 +117,7 @@ get_reg_addr(struct task_struct * task, unsigned long regno) /* * Get contents of register REGNO in task TASK. */ -static long +static unsigned long get_reg(struct task_struct * task, unsigned long regno) { /* Special hack for fpcr -- combine hardware and software bits. */ @@ -135,7 +135,7 @@ get_reg(struct task_struct * task, unsigned long regno) * Write contents of register REGNO in task TASK. */ static int -put_reg(struct task_struct *task, unsigned long regno, long data) +put_reg(struct task_struct *task, unsigned long regno, unsigned long data) { if (regno == 63) { task->thread_info->ieee_state @@ -168,11 +168,11 @@ int ptrace_set_bpt(struct task_struct * child) { int displ, i, res, reg_b, nsaved = 0; - u32 insn, op_code; + unsigned int insn, op_code; unsigned long pc; pc = get_reg(child, REG_PC); - res = read_int(child, pc, &insn); + res = read_int(child, pc, (int *) &insn); if (res < 0) return res; @@ -203,7 +203,8 @@ ptrace_set_bpt(struct task_struct * child) /* install breakpoints: */ for (i = 0; i < nsaved; ++i) { - res = read_int(child, child->thread_info->bpt_addr[i], &insn); + res = read_int(child, child->thread_info->bpt_addr[i], + (int *) &insn); if (res < 0) return res; child->thread_info->bpt_insn[i] = insn; @@ -287,6 +288,8 @@ do_sys_ptrace(long request, long pid, long addr, long data, read_unlock(&tasklist_lock); if (!child) goto out_notsk; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out; if (request == PTRACE_ATTACH) { ret = ptrace_attach(child); @@ -354,7 +357,7 @@ do_sys_ptrace(long request, long pid, long addr, long data, */ case PTRACE_KILL: ret = 0; - if (child->state == TASK_ZOMBIE) + if (child->exit_state == EXIT_ZOMBIE) break; child->exit_code = SIGKILL; /* make sure single-step breakpoint is gone. */