This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / arch / um / sys-x86_64 / ptrace_user.c
1 /*
2  * Copyright 2003 PathScale, Inc.
3  *
4  * Licensed under the GPL
5  */
6
7 #include <stddef.h>
8 #include <errno.h>
9 #define __FRAME_OFFSETS
10 #include <sys/ptrace.h>
11 #include <asm/ptrace.h>
12 #include "user.h"
13 #include "kern_constants.h"
14
15 int ptrace_getregs(long pid, unsigned long *regs_out)
16 {
17         if(ptrace(PTRACE_GETREGS, pid, 0, regs_out) < 0)
18                 return(-errno);
19         return(0);
20 }
21
22 int ptrace_setregs(long pid, unsigned long *regs)
23 {
24         if(ptrace(PTRACE_SETREGS, pid, 0, regs) < 0)
25                 return(-errno);
26         return(0);
27 }
28
29 void ptrace_pokeuser(unsigned long addr, unsigned long data)
30 {
31         panic("ptrace_pokeuser");
32 }
33
34 #define DS 184
35 #define ES 192
36 #define __USER_DS     0x2b
37
38 void arch_enter_kernel(void *task, int pid)
39 {
40 }
41
42 void arch_leave_kernel(void *task, int pid)
43 {
44 #ifdef UM_USER_CS
45         if(ptrace(PTRACE_POKEUSER, pid, CS, UM_USER_CS) < 0)
46                 tracer_panic("POKEUSER CS failed");
47 #endif
48
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");
53 }
54
55 /*
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
59  * of the file.
60  * ---------------------------------------------------------------------------
61  * Local variables:
62  * c-file-style: "linux"
63  * End:
64  */