2 * Copyright 2003 PathScale, Inc.
4 * Licensed under the GPL
9 #define __FRAME_OFFSETS
10 #include <sys/ptrace.h>
11 #include <asm/ptrace.h>
13 #include "kern_constants.h"
15 int ptrace_getregs(long pid, unsigned long *regs_out)
17 if(ptrace(PTRACE_GETREGS, pid, 0, regs_out) < 0)
22 int ptrace_setregs(long pid, unsigned long *regs)
24 if(ptrace(PTRACE_SETREGS, pid, 0, regs) < 0)
29 void ptrace_pokeuser(unsigned long addr, unsigned long data)
31 panic("ptrace_pokeuser");
36 #define __USER_DS 0x2b
38 void arch_enter_kernel(void *task, int pid)
42 void arch_leave_kernel(void *task, int pid)
45 if(ptrace(PTRACE_POKEUSER, pid, CS, UM_USER_CS) < 0)
46 tracer_panic("POKEUSER CS failed");
49 if(ptrace(PTRACE_POKEUSER, pid, DS, __USER_DS) < 0)
50 tracer_panic("POKEUSER DS failed");
51 if(ptrace(PTRACE_POKEUSER, pid, ES, __USER_DS) < 0)
52 tracer_panic("POKEUSER ES failed");
56 * Overrides for Emacs so that we follow Linus's tabbing style.
57 * Emacs will notice this stuff at the end of the file and automatically
58 * adjust the settings for this buffer only. This must remain at the end
60 * ---------------------------------------------------------------------------
62 * c-file-style: "linux"