]> err.no Git - linux-2.6/blobdiff - arch/alpha/kernel/ptrace.c
During VM oom condition, kill all threads in process group
[linux-2.6] / arch / alpha / kernel / ptrace.c
index 9069281313a3973001b9bc8d8bd67f5b6a4aa4eb..eaf4ee5f0c356881c3588a0d5e9689db2ba5556d 100644 (file)
@@ -72,6 +72,13 @@ enum {
        REG_R0 = 0, REG_F0 = 32, REG_FPCR = 63, REG_PC = 64
 };
 
+#define PT_REG(reg) \
+  (PAGE_SIZE*2 - sizeof(struct pt_regs) + offsetof(struct pt_regs, reg))
+
+#define SW_REG(reg) \
+ (PAGE_SIZE*2 - sizeof(struct pt_regs) - sizeof(struct switch_stack) \
+  + offsetof(struct switch_stack, reg))
+
 static int regoff[] = {
        PT_REG(    r0), PT_REG(    r1), PT_REG(    r2), PT_REG(   r3),
        PT_REG(    r4), PT_REG(    r5), PT_REG(    r6), PT_REG(   r7),
@@ -308,9 +315,7 @@ do_sys_ptrace(long request, long pid, long addr, long data,
        /* When I and D space are separate, this will have to be fixed.  */
        case PTRACE_POKETEXT: /* write the word at location addr. */
        case PTRACE_POKEDATA:
-               tmp = data;
-               copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 1);
-               ret = (copied == sizeof(tmp)) ? 0 : -EIO;
+               ret = generic_ptrace_pokedata(child, addr, data);
                break;
 
        case PTRACE_POKEUSR: /* write the specified register */
@@ -363,10 +368,6 @@ do_sys_ptrace(long request, long pid, long addr, long data,
                ret = 0;
                goto out;
 
-       case PTRACE_DETACH:      /* detach a process that was attached. */
-               ret = ptrace_detach(child, data);
-               goto out;
-
        default:
                ret = ptrace_request(child, request, addr, data);
                goto out;