aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/sys-x86_64/ptrace_user.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/um/sys-x86_64/ptrace_user.c
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'arch/um/sys-x86_64/ptrace_user.c')
-rw-r--r--arch/um/sys-x86_64/ptrace_user.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/arch/um/sys-x86_64/ptrace_user.c b/arch/um/sys-x86_64/ptrace_user.c
new file mode 100644
index 000000000000..12e404c6fa46
--- /dev/null
+++ b/arch/um/sys-x86_64/ptrace_user.c
@@ -0,0 +1,51 @@
1/*
2 * Copyright 2003 PathScale, Inc.
3 *
4 * Licensed under the GPL
5 */
6
7#include <stddef.h>
8#include <errno.h>
9#include "ptrace_user.h"
10#include "user.h"
11#include "kern_constants.h"
12
13int ptrace_getregs(long pid, unsigned long *regs_out)
14{
15 if(ptrace(PTRACE_GETREGS, pid, 0, regs_out) < 0)
16 return(-errno);
17 return(0);
18}
19
20int ptrace_setregs(long pid, unsigned long *regs)
21{
22 if(ptrace(PTRACE_SETREGS, pid, 0, regs) < 0)
23 return(-errno);
24 return(0);
25}
26
27void ptrace_pokeuser(unsigned long addr, unsigned long data)
28{
29 panic("ptrace_pokeuser");
30}
31
32#define DS 184
33#define ES 192
34#define __USER_DS 0x2b
35
36void arch_enter_kernel(void *task, int pid)
37{
38}
39
40void arch_leave_kernel(void *task, int pid)
41{
42#ifdef UM_USER_CS
43 if(ptrace(PTRACE_POKEUSR, pid, CS, UM_USER_CS) < 0)
44 printk("POKEUSR CS failed");
45#endif
46
47 if(ptrace(PTRACE_POKEUSR, pid, DS, __USER_DS) < 0)
48 printk("POKEUSR DS failed");
49 if(ptrace(PTRACE_POKEUSR, pid, ES, __USER_DS) < 0)
50 printk("POKEUSR ES failed");
51}