2 * Copyright 2003 PathScale, Inc.
4 * Licensed under the GPL
9 #include "ptrace_user.h"
11 #include "kern_constants.h"
13 int ptrace_getregs(long pid, unsigned long *regs_out)
15 if(ptrace(PTRACE_GETREGS, pid, 0, regs_out) < 0)
20 int ptrace_setregs(long pid, unsigned long *regs)
22 if(ptrace(PTRACE_SETREGS, pid, 0, regs) < 0)
27 int ptrace_setfpregs(long pid, unsigned long *regs)
29 if (ptrace(PTRACE_SETFPREGS, pid, 0, regs) < 0)
34 void ptrace_pokeuser(unsigned long addr, unsigned long data)
36 panic("ptrace_pokeuser");
41 #define __USER_DS 0x2b
43 void arch_enter_kernel(void *task, int pid)
47 void arch_leave_kernel(void *task, int pid)
50 if(ptrace(PTRACE_POKEUSR, pid, CS, UM_USER_CS) < 0)
51 printk("POKEUSR CS failed");
54 if(ptrace(PTRACE_POKEUSR, pid, DS, __USER_DS) < 0)
55 printk("POKEUSR DS failed");
56 if(ptrace(PTRACE_POKEUSR, pid, ES, __USER_DS) < 0)
57 printk("POKEUSR ES failed");