diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/um/sys-x86_64/ptrace.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.c')
-rw-r--r-- | arch/um/sys-x86_64/ptrace.c | 138 |
1 files changed, 138 insertions, 0 deletions
diff --git a/arch/um/sys-x86_64/ptrace.c b/arch/um/sys-x86_64/ptrace.c new file mode 100644 index 000000000000..8c146b2a1e00 --- /dev/null +++ b/arch/um/sys-x86_64/ptrace.c | |||
@@ -0,0 +1,138 @@ | |||
1 | /* | ||
2 | * Copyright 2003 PathScale, Inc. | ||
3 | * | ||
4 | * Licensed under the GPL | ||
5 | */ | ||
6 | |||
7 | #define __FRAME_OFFSETS | ||
8 | #include "asm/ptrace.h" | ||
9 | #include "linux/sched.h" | ||
10 | #include "linux/errno.h" | ||
11 | #include "asm/elf.h" | ||
12 | |||
13 | /* XXX x86_64 */ | ||
14 | unsigned long not_ss; | ||
15 | unsigned long not_ds; | ||
16 | unsigned long not_es; | ||
17 | |||
18 | #define SC_SS(r) (not_ss) | ||
19 | #define SC_DS(r) (not_ds) | ||
20 | #define SC_ES(r) (not_es) | ||
21 | |||
22 | /* determines which flags the user has access to. */ | ||
23 | /* 1 = access 0 = no access */ | ||
24 | #define FLAG_MASK 0x44dd5UL | ||
25 | |||
26 | int putreg(struct task_struct *child, int regno, unsigned long value) | ||
27 | { | ||
28 | unsigned long tmp; | ||
29 | |||
30 | #ifdef TIF_IA32 | ||
31 | /* Some code in the 64bit emulation may not be 64bit clean. | ||
32 | Don't take any chances. */ | ||
33 | if (test_tsk_thread_flag(child, TIF_IA32)) | ||
34 | value &= 0xffffffff; | ||
35 | #endif | ||
36 | switch (regno){ | ||
37 | case FS: | ||
38 | case GS: | ||
39 | case DS: | ||
40 | case ES: | ||
41 | case SS: | ||
42 | case CS: | ||
43 | if (value && (value & 3) != 3) | ||
44 | return -EIO; | ||
45 | value &= 0xffff; | ||
46 | break; | ||
47 | |||
48 | case FS_BASE: | ||
49 | case GS_BASE: | ||
50 | if (!((value >> 48) == 0 || (value >> 48) == 0xffff)) | ||
51 | return -EIO; | ||
52 | break; | ||
53 | |||
54 | case EFLAGS: | ||
55 | value &= FLAG_MASK; | ||
56 | tmp = PT_REGS_EFLAGS(&child->thread.regs) & ~FLAG_MASK; | ||
57 | value |= tmp; | ||
58 | break; | ||
59 | } | ||
60 | |||
61 | PT_REGS_SET(&child->thread.regs, regno, value); | ||
62 | return 0; | ||
63 | } | ||
64 | |||
65 | unsigned long getreg(struct task_struct *child, int regno) | ||
66 | { | ||
67 | unsigned long retval = ~0UL; | ||
68 | switch (regno) { | ||
69 | case FS: | ||
70 | case GS: | ||
71 | case DS: | ||
72 | case ES: | ||
73 | case SS: | ||
74 | case CS: | ||
75 | retval = 0xffff; | ||
76 | /* fall through */ | ||
77 | default: | ||
78 | retval &= PT_REG(&child->thread.regs, regno); | ||
79 | #ifdef TIF_IA32 | ||
80 | if (test_tsk_thread_flag(child, TIF_IA32)) | ||
81 | retval &= 0xffffffff; | ||
82 | #endif | ||
83 | } | ||
84 | return retval; | ||
85 | } | ||
86 | |||
87 | void arch_switch(void) | ||
88 | { | ||
89 | /* XXX | ||
90 | printk("arch_switch\n"); | ||
91 | */ | ||
92 | } | ||
93 | |||
94 | int is_syscall(unsigned long addr) | ||
95 | { | ||
96 | panic("is_syscall"); | ||
97 | } | ||
98 | |||
99 | int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu ) | ||
100 | { | ||
101 | panic("dump_fpu"); | ||
102 | return(1); | ||
103 | } | ||
104 | |||
105 | int get_fpregs(unsigned long buf, struct task_struct *child) | ||
106 | { | ||
107 | panic("get_fpregs"); | ||
108 | return(0); | ||
109 | } | ||
110 | |||
111 | int set_fpregs(unsigned long buf, struct task_struct *child) | ||
112 | { | ||
113 | panic("set_fpregs"); | ||
114 | return(0); | ||
115 | } | ||
116 | |||
117 | int get_fpxregs(unsigned long buf, struct task_struct *tsk) | ||
118 | { | ||
119 | panic("get_fpxregs"); | ||
120 | return(0); | ||
121 | } | ||
122 | |||
123 | int set_fpxregs(unsigned long buf, struct task_struct *tsk) | ||
124 | { | ||
125 | panic("set_fxpregs"); | ||
126 | return(0); | ||
127 | } | ||
128 | |||
129 | /* | ||
130 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
131 | * Emacs will notice this stuff at the end of the file and automatically | ||
132 | * adjust the settings for this buffer only. This must remain at the end | ||
133 | * of the file. | ||
134 | * --------------------------------------------------------------------------- | ||
135 | * Local variables: | ||
136 | * c-file-style: "linux" | ||
137 | * End: | ||
138 | */ | ||