diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-10-16 04:26:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 12:43:05 -0400 |
commit | 42fda66387daa53538ae13a2c858396aaf037158 (patch) | |
tree | 77955a91a958fde7be47cb0ff23ac9e1248217db /arch/um/include | |
parent | a1ff5878d2628bbe1e42821c024c96f48318f683 (diff) |
uml: throw out CONFIG_MODE_TT
This patchset throws out tt mode, which has been non-functional for a while.
This is done in phases, interspersed with code cleanups on the affected files.
The removal is done as follows:
remove all code, config options, and files which depend on
CONFIG_MODE_TT
get rid of the CHOOSE_MODE macro, which decided whether to
call tt-mode or skas-mode code, and replace invocations with their
skas portions
replace all now-trivial procedures with their skas equivalents
There are now a bunch of now-redundant pieces of data structures, including
mode-specific pieces of the thread structure, pt_regs, and mm_context. These
are all replaced with their skas-specific contents.
As part of the ongoing style compliance project, I made a style pass over all
files that were changed. There are three such patches, one for each phase,
covering the files affected by that phase but no later ones.
I noticed that we weren't freeing the LDT state associated with a process when
it exited, so that's fixed in one of the later patches.
The last patch is a tidying patch which I've had for a while, but which caused
inexplicable crashes under tt mode. Since that is no longer a problem, this
can now go in.
This patch:
Start getting rid of tt mode support.
This patch throws out CONFIG_MODE_TT and all config options, code, and files
which depend on it.
CONFIG_MODE_SKAS is gone and everything that depends on it is included
unconditionally.
The few changed lines are in re-written Kconfig help, lines which needed
something skas-related removed from them, and a few more which weren't
strictly deletions.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/include')
-rw-r--r-- | arch/um/include/as-layout.h | 1 | ||||
-rw-r--r-- | arch/um/include/choose-mode.h | 18 | ||||
-rw-r--r-- | arch/um/include/common-offsets.h | 3 | ||||
-rw-r--r-- | arch/um/include/irq_user.h | 4 | ||||
-rw-r--r-- | arch/um/include/kern_util.h | 6 | ||||
-rw-r--r-- | arch/um/include/mode.h | 19 | ||||
-rw-r--r-- | arch/um/include/mode_kern.h | 6 | ||||
-rw-r--r-- | arch/um/include/os.h | 26 | ||||
-rw-r--r-- | arch/um/include/sysdep-i386/ptrace.h | 23 | ||||
-rw-r--r-- | arch/um/include/sysdep-i386/sigcontext.h | 4 | ||||
-rw-r--r-- | arch/um/include/sysdep-i386/thread.h | 3 | ||||
-rw-r--r-- | arch/um/include/sysdep-x86_64/ptrace.h | 21 | ||||
-rw-r--r-- | arch/um/include/sysdep-x86_64/thread.h | 4 | ||||
-rw-r--r-- | arch/um/include/tt/debug.h | 18 | ||||
-rw-r--r-- | arch/um/include/tt/mmu-tt.h | 12 | ||||
-rw-r--r-- | arch/um/include/tt/mode-tt.h | 23 | ||||
-rw-r--r-- | arch/um/include/tt/mode_kern_tt.h | 40 | ||||
-rw-r--r-- | arch/um/include/tt/tt.h | 37 | ||||
-rw-r--r-- | arch/um/include/tt/uaccess-tt.h | 46 | ||||
-rw-r--r-- | arch/um/include/um_mmu.h | 23 | ||||
-rw-r--r-- | arch/um/include/um_uaccess.h | 8 |
21 files changed, 1 insertions, 344 deletions
diff --git a/arch/um/include/as-layout.h b/arch/um/include/as-layout.h index fccf187bf4e1..e44f32940f8a 100644 --- a/arch/um/include/as-layout.h +++ b/arch/um/include/as-layout.h | |||
@@ -28,7 +28,6 @@ extern unsigned long _unprotected_end; | |||
28 | extern unsigned long brk_start; | 28 | extern unsigned long brk_start; |
29 | 29 | ||
30 | extern int linux_main(int argc, char **argv); | 30 | extern int linux_main(int argc, char **argv); |
31 | extern void set_cmdline(char *cmd); | ||
32 | 31 | ||
33 | extern void (*sig_info[])(int, union uml_pt_regs *); | 32 | extern void (*sig_info[])(int, union uml_pt_regs *); |
34 | 33 | ||
diff --git a/arch/um/include/choose-mode.h b/arch/um/include/choose-mode.h index b87b36a87d91..51a387626da2 100644 --- a/arch/um/include/choose-mode.h +++ b/arch/um/include/choose-mode.h | |||
@@ -8,26 +8,8 @@ | |||
8 | 8 | ||
9 | #include "uml-config.h" | 9 | #include "uml-config.h" |
10 | 10 | ||
11 | #if defined(UML_CONFIG_MODE_TT) && defined(UML_CONFIG_MODE_SKAS) | ||
12 | #define CHOOSE_MODE(tt, skas) (mode_tt ? (tt) : (skas)) | ||
13 | |||
14 | extern int mode_tt; | ||
15 | static inline void *__choose_mode(void *tt, void *skas) { | ||
16 | return mode_tt ? tt : skas; | ||
17 | } | ||
18 | |||
19 | #define __CHOOSE_MODE(tt, skas) (*( (typeof(tt) *) __choose_mode(&(tt), &(skas)))) | ||
20 | |||
21 | #elif defined(UML_CONFIG_MODE_SKAS) | ||
22 | #define CHOOSE_MODE(tt, skas) (skas) | 11 | #define CHOOSE_MODE(tt, skas) (skas) |
23 | 12 | ||
24 | #elif defined(UML_CONFIG_MODE_TT) | ||
25 | #define CHOOSE_MODE(tt, skas) (tt) | ||
26 | |||
27 | #else | ||
28 | #error CONFIG_MODE_SKAS and CONFIG_MODE_TT are both disabled | ||
29 | #endif | ||
30 | |||
31 | #define CHOOSE_MODE_PROC(tt, skas, args...) \ | 13 | #define CHOOSE_MODE_PROC(tt, skas, args...) \ |
32 | CHOOSE_MODE(tt(args), skas(args)) | 14 | CHOOSE_MODE(tt(args), skas(args)) |
33 | 15 | ||
diff --git a/arch/um/include/common-offsets.h b/arch/um/include/common-offsets.h index 2378ff42e41c..439b91f141a5 100644 --- a/arch/um/include/common-offsets.h +++ b/arch/um/include/common-offsets.h | |||
@@ -1,9 +1,6 @@ | |||
1 | /* for use by sys-$SUBARCH/kernel-offsets.c */ | 1 | /* for use by sys-$SUBARCH/kernel-offsets.c */ |
2 | 2 | ||
3 | DEFINE(KERNEL_MADV_REMOVE, MADV_REMOVE); | 3 | DEFINE(KERNEL_MADV_REMOVE, MADV_REMOVE); |
4 | #ifdef CONFIG_MODE_TT | ||
5 | OFFSET(HOST_TASK_EXTERN_PID, task_struct, thread.mode.tt.extern_pid); | ||
6 | #endif | ||
7 | 4 | ||
8 | OFFSET(HOST_TASK_REGS, task_struct, thread.regs); | 5 | OFFSET(HOST_TASK_REGS, task_struct, thread.regs); |
9 | OFFSET(HOST_TASK_PID, task_struct, pid); | 6 | OFFSET(HOST_TASK_PID, task_struct, pid); |
diff --git a/arch/um/include/irq_user.h b/arch/um/include/irq_user.h index 15d311b9be9e..741cb7d6f859 100644 --- a/arch/um/include/irq_user.h +++ b/arch/um/include/irq_user.h | |||
@@ -30,8 +30,4 @@ extern void deactivate_fd(int fd, int irqnum); | |||
30 | extern int deactivate_all_fds(void); | 30 | extern int deactivate_all_fds(void); |
31 | extern int activate_ipi(int fd, int pid); | 31 | extern int activate_ipi(int fd, int pid); |
32 | 32 | ||
33 | #ifdef CONFIG_MODE_TT | ||
34 | extern void forward_interrupts(int pid); | ||
35 | #endif | ||
36 | |||
37 | #endif | 33 | #endif |
diff --git a/arch/um/include/kern_util.h b/arch/um/include/kern_util.h index b84b5dadb958..578156db3039 100644 --- a/arch/um/include/kern_util.h +++ b/arch/um/include/kern_util.h | |||
@@ -34,9 +34,6 @@ extern int nsyscalls; | |||
34 | UML_ROUND_DOWN(((unsigned long) addr) + PAGE_SIZE - 1) | 34 | UML_ROUND_DOWN(((unsigned long) addr) + PAGE_SIZE - 1) |
35 | 35 | ||
36 | extern int kernel_fork(unsigned long flags, int (*fn)(void *), void * arg); | 36 | extern int kernel_fork(unsigned long flags, int (*fn)(void *), void * arg); |
37 | #ifdef UML_CONFIG_MODE_TT | ||
38 | extern unsigned long stack_sp(unsigned long page); | ||
39 | #endif | ||
40 | extern int kernel_thread_proc(void *data); | 37 | extern int kernel_thread_proc(void *data); |
41 | extern void syscall_segv(int sig); | 38 | extern void syscall_segv(int sig); |
42 | extern int current_pid(void); | 39 | extern int current_pid(void); |
@@ -82,9 +79,6 @@ extern void check_stack_overflow(void *ptr); | |||
82 | extern void relay_signal(int sig, union uml_pt_regs *regs); | 79 | extern void relay_signal(int sig, union uml_pt_regs *regs); |
83 | extern int user_context(unsigned long sp); | 80 | extern int user_context(unsigned long sp); |
84 | extern void timer_irq(union uml_pt_regs *regs); | 81 | extern void timer_irq(union uml_pt_regs *regs); |
85 | #ifdef CONFIG_MODE_TT | ||
86 | extern void unprotect_stack(unsigned long stack); | ||
87 | #endif | ||
88 | extern void do_uml_exitcalls(void); | 82 | extern void do_uml_exitcalls(void); |
89 | extern int attach_debugger(int idle_pid, int pid, int stop); | 83 | extern int attach_debugger(int idle_pid, int pid, int stop); |
90 | extern int config_gdb(char *str); | 84 | extern int config_gdb(char *str); |
diff --git a/arch/um/include/mode.h b/arch/um/include/mode.h index 786cf563eb05..fcce95cbc16a 100644 --- a/arch/um/include/mode.h +++ b/arch/um/include/mode.h | |||
@@ -6,25 +6,6 @@ | |||
6 | #ifndef __MODE_H__ | 6 | #ifndef __MODE_H__ |
7 | #define __MODE_H__ | 7 | #define __MODE_H__ |
8 | 8 | ||
9 | #include "uml-config.h" | ||
10 | |||
11 | #ifdef UML_CONFIG_MODE_TT | ||
12 | #include "mode-tt.h" | ||
13 | #endif | ||
14 | |||
15 | #ifdef UML_CONFIG_MODE_SKAS | ||
16 | #include "mode-skas.h" | 9 | #include "mode-skas.h" |
17 | #endif | ||
18 | 10 | ||
19 | #endif | 11 | #endif |
20 | |||
21 | /* | ||
22 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
23 | * Emacs will notice this stuff at the end of the file and automatically | ||
24 | * adjust the settings for this buffer only. This must remain at the end | ||
25 | * of the file. | ||
26 | * --------------------------------------------------------------------------- | ||
27 | * Local variables: | ||
28 | * c-file-style: "linux" | ||
29 | * End: | ||
30 | */ | ||
diff --git a/arch/um/include/mode_kern.h b/arch/um/include/mode_kern.h index 88e5e77bf517..b2a44c0dcd00 100644 --- a/arch/um/include/mode_kern.h +++ b/arch/um/include/mode_kern.h | |||
@@ -6,12 +6,6 @@ | |||
6 | #ifndef __MODE_KERN_H__ | 6 | #ifndef __MODE_KERN_H__ |
7 | #define __MODE_KERN_H__ | 7 | #define __MODE_KERN_H__ |
8 | 8 | ||
9 | #ifdef CONFIG_MODE_TT | ||
10 | #include "mode_kern_tt.h" | ||
11 | #endif | ||
12 | |||
13 | #ifdef CONFIG_MODE_SKAS | ||
14 | #include "mode_kern_skas.h" | 9 | #include "mode_kern_skas.h" |
15 | #endif | ||
16 | 10 | ||
17 | #endif | 11 | #endif |
diff --git a/arch/um/include/os.h b/arch/um/include/os.h index c0803e67fc67..208d9b91fc93 100644 --- a/arch/um/include/os.h +++ b/arch/um/include/os.h | |||
@@ -178,11 +178,7 @@ extern void check_host_supports_tls(int *supports_tls, int *tls_min); | |||
178 | 178 | ||
179 | /* Make sure they are clear when running in TT mode. Required by | 179 | /* Make sure they are clear when running in TT mode. Required by |
180 | * SEGV_MAYBE_FIXABLE */ | 180 | * SEGV_MAYBE_FIXABLE */ |
181 | #ifdef UML_CONFIG_MODE_SKAS | ||
182 | #define clear_can_do_skas() do { ptrace_faultinfo = proc_mm = 0; } while (0) | 181 | #define clear_can_do_skas() do { ptrace_faultinfo = proc_mm = 0; } while (0) |
183 | #else | ||
184 | #define clear_can_do_skas() do {} while (0) | ||
185 | #endif | ||
186 | 182 | ||
187 | /* mem.c */ | 183 | /* mem.c */ |
188 | extern int create_mem_file(unsigned long long len); | 184 | extern int create_mem_file(unsigned long long len); |
@@ -193,18 +189,11 @@ extern int os_process_parent(int pid); | |||
193 | extern void os_stop_process(int pid); | 189 | extern void os_stop_process(int pid); |
194 | extern void os_kill_process(int pid, int reap_child); | 190 | extern void os_kill_process(int pid, int reap_child); |
195 | extern void os_kill_ptraced_process(int pid, int reap_child); | 191 | extern void os_kill_ptraced_process(int pid, int reap_child); |
196 | #ifdef UML_CONFIG_MODE_TT | ||
197 | extern void os_usr1_process(int pid); | ||
198 | #endif | ||
199 | extern long os_ptrace_ldt(long pid, long addr, long data); | 192 | extern long os_ptrace_ldt(long pid, long addr, long data); |
200 | 193 | ||
201 | extern int os_getpid(void); | 194 | extern int os_getpid(void); |
202 | extern int os_getpgrp(void); | 195 | extern int os_getpgrp(void); |
203 | 196 | ||
204 | #ifdef UML_CONFIG_MODE_TT | ||
205 | extern void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int)); | ||
206 | extern void stop(void); | ||
207 | #endif | ||
208 | extern void init_new_thread_signals(void); | 197 | extern void init_new_thread_signals(void); |
209 | extern int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr); | 198 | extern int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr); |
210 | 199 | ||
@@ -217,18 +206,6 @@ extern int os_drop_memory(void *addr, int length); | |||
217 | extern int can_drop_memory(void); | 206 | extern int can_drop_memory(void); |
218 | extern void os_flush_stdout(void); | 207 | extern void os_flush_stdout(void); |
219 | 208 | ||
220 | /* tt.c | ||
221 | * for tt mode only (will be deleted in future...) | ||
222 | */ | ||
223 | extern void forward_ipi(int fd, int pid); | ||
224 | extern void kill_child_dead(int pid); | ||
225 | extern int wait_for_stop(int pid, int sig, int cont_type, void *relay); | ||
226 | extern int protect_memory(unsigned long addr, unsigned long len, | ||
227 | int r, int w, int x, int must_succeed); | ||
228 | extern void forward_pending_sigio(int target); | ||
229 | extern int start_fork_tramp(void *arg, unsigned long temp_stack, | ||
230 | int clone_flags, int (*tramp)(void *)); | ||
231 | |||
232 | /* uaccess.c */ | 209 | /* uaccess.c */ |
233 | extern unsigned long __do_user_copy(void *to, const void *from, int n, | 210 | extern unsigned long __do_user_copy(void *to, const void *from, int n, |
234 | void **fault_addr, void **fault_catcher, | 211 | void **fault_addr, void **fault_catcher, |
@@ -281,9 +258,6 @@ extern void os_dump_core(void); | |||
281 | extern void switch_timers(int to_real); | 258 | extern void switch_timers(int to_real); |
282 | extern void idle_sleep(int secs); | 259 | extern void idle_sleep(int secs); |
283 | extern int set_interval(int is_virtual); | 260 | extern int set_interval(int is_virtual); |
284 | #ifdef CONFIG_MODE_TT | ||
285 | extern void enable_timer(void); | ||
286 | #endif | ||
287 | extern void disable_timer(void); | 261 | extern void disable_timer(void); |
288 | extern void uml_idle_timer(void); | 262 | extern void uml_idle_timer(void); |
289 | extern unsigned long long os_nsecs(void); | 263 | extern unsigned long long os_nsecs(void); |
diff --git a/arch/um/include/sysdep-i386/ptrace.h b/arch/um/include/sysdep-i386/ptrace.h index b45a72feb08c..c0ea4dbd042b 100644 --- a/arch/um/include/sysdep-i386/ptrace.h +++ b/arch/um/include/sysdep-i386/ptrace.h | |||
@@ -14,12 +14,7 @@ | |||
14 | #define MAX_REG_NR (UM_FRAME_SIZE / sizeof(unsigned long)) | 14 | #define MAX_REG_NR (UM_FRAME_SIZE / sizeof(unsigned long)) |
15 | #define MAX_REG_OFFSET (UM_FRAME_SIZE) | 15 | #define MAX_REG_OFFSET (UM_FRAME_SIZE) |
16 | 16 | ||
17 | #ifdef UML_CONFIG_PT_PROXY | ||
18 | extern void update_debugregs(int seq); | ||
19 | #else | ||
20 | static inline void update_debugregs(int seq) {} | 17 | static inline void update_debugregs(int seq) {} |
21 | #endif | ||
22 | |||
23 | 18 | ||
24 | /* syscall emulation path in ptrace */ | 19 | /* syscall emulation path in ptrace */ |
25 | 20 | ||
@@ -31,12 +26,6 @@ void set_using_sysemu(int value); | |||
31 | int get_using_sysemu(void); | 26 | int get_using_sysemu(void); |
32 | extern int sysemu_supported; | 27 | extern int sysemu_supported; |
33 | 28 | ||
34 | #ifdef UML_CONFIG_MODE_TT | ||
35 | #include "sysdep/sc.h" | ||
36 | #endif | ||
37 | |||
38 | #ifdef UML_CONFIG_MODE_SKAS | ||
39 | |||
40 | #include "skas_ptregs.h" | 29 | #include "skas_ptregs.h" |
41 | 30 | ||
42 | #define REGS_IP(r) ((r)[HOST_IP]) | 31 | #define REGS_IP(r) ((r)[HOST_IP]) |
@@ -60,20 +49,11 @@ extern int sysemu_supported; | |||
60 | 49 | ||
61 | #define REGS_RESTART_SYSCALL(r) IP_RESTART_SYSCALL(REGS_IP(r)) | 50 | #define REGS_RESTART_SYSCALL(r) IP_RESTART_SYSCALL(REGS_IP(r)) |
62 | 51 | ||
63 | #endif | ||
64 | #ifndef PTRACE_SYSEMU_SINGLESTEP | 52 | #ifndef PTRACE_SYSEMU_SINGLESTEP |
65 | #define PTRACE_SYSEMU_SINGLESTEP 32 | 53 | #define PTRACE_SYSEMU_SINGLESTEP 32 |
66 | #endif | 54 | #endif |
67 | 55 | ||
68 | union uml_pt_regs { | 56 | union uml_pt_regs { |
69 | #ifdef UML_CONFIG_MODE_TT | ||
70 | struct tt_regs { | ||
71 | long syscall; | ||
72 | void *sc; | ||
73 | struct faultinfo faultinfo; | ||
74 | } tt; | ||
75 | #endif | ||
76 | #ifdef UML_CONFIG_MODE_SKAS | ||
77 | struct skas_regs { | 57 | struct skas_regs { |
78 | unsigned long regs[MAX_REG_NR]; | 58 | unsigned long regs[MAX_REG_NR]; |
79 | unsigned long fp[HOST_FP_SIZE]; | 59 | unsigned long fp[HOST_FP_SIZE]; |
@@ -82,13 +62,10 @@ union uml_pt_regs { | |||
82 | long syscall; | 62 | long syscall; |
83 | int is_user; | 63 | int is_user; |
84 | } skas; | 64 | } skas; |
85 | #endif | ||
86 | }; | 65 | }; |
87 | 66 | ||
88 | #define EMPTY_UML_PT_REGS { } | 67 | #define EMPTY_UML_PT_REGS { } |
89 | 68 | ||
90 | extern int mode_tt; | ||
91 | |||
92 | #define UPT_SC(r) ((r)->tt.sc) | 69 | #define UPT_SC(r) ((r)->tt.sc) |
93 | #define UPT_IP(r) \ | 70 | #define UPT_IP(r) \ |
94 | __CHOOSE_MODE(SC_IP(UPT_SC(r)), REGS_IP((r)->skas.regs)) | 71 | __CHOOSE_MODE(SC_IP(UPT_SC(r)), REGS_IP((r)->skas.regs)) |
diff --git a/arch/um/include/sysdep-i386/sigcontext.h b/arch/um/include/sysdep-i386/sigcontext.h index 23fd2644d7ed..8658634ca4f4 100644 --- a/arch/um/include/sysdep-i386/sigcontext.h +++ b/arch/um/include/sysdep-i386/sigcontext.h | |||
@@ -30,11 +30,7 @@ | |||
30 | #define SEGV_IS_FIXABLE(fi) ((fi)->trap_no == 14) | 30 | #define SEGV_IS_FIXABLE(fi) ((fi)->trap_no == 14) |
31 | 31 | ||
32 | /* SKAS3 has no trap_no on i386, but get_skas_faultinfo() sets it to 0. */ | 32 | /* SKAS3 has no trap_no on i386, but get_skas_faultinfo() sets it to 0. */ |
33 | #ifdef UML_CONFIG_MODE_SKAS | ||
34 | #define SEGV_MAYBE_FIXABLE(fi) ((fi)->trap_no == 0 && ptrace_faultinfo) | 33 | #define SEGV_MAYBE_FIXABLE(fi) ((fi)->trap_no == 0 && ptrace_faultinfo) |
35 | #else | ||
36 | #define SEGV_MAYBE_FIXABLE(fi) 0 | ||
37 | #endif | ||
38 | 34 | ||
39 | extern unsigned long *sc_sigmask(void *sc_ptr); | 35 | extern unsigned long *sc_sigmask(void *sc_ptr); |
40 | extern int sc_get_fpregs(unsigned long buf, void *sc_ptr); | 36 | extern int sc_get_fpregs(unsigned long buf, void *sc_ptr); |
diff --git a/arch/um/include/sysdep-i386/thread.h b/arch/um/include/sysdep-i386/thread.h index 243fed44d780..0cf7bf6e9e04 100644 --- a/arch/um/include/sysdep-i386/thread.h +++ b/arch/um/include/sysdep-i386/thread.h | |||
@@ -4,8 +4,5 @@ | |||
4 | #include <kern_constants.h> | 4 | #include <kern_constants.h> |
5 | 5 | ||
6 | #define TASK_DEBUGREGS(task) ((unsigned long *) &(((char *) (task))[HOST_TASK_DEBUGREGS])) | 6 | #define TASK_DEBUGREGS(task) ((unsigned long *) &(((char *) (task))[HOST_TASK_DEBUGREGS])) |
7 | #ifdef UML_CONFIG_MODE_TT | ||
8 | #define TASK_EXTERN_PID(task) *((int *) &(((char *) (task))[HOST_TASK_EXTERN_PID])) | ||
9 | #endif | ||
10 | 7 | ||
11 | #endif | 8 | #endif |
diff --git a/arch/um/include/sysdep-x86_64/ptrace.h b/arch/um/include/sysdep-x86_64/ptrace.h index 62403bd99661..ff525bda4c11 100644 --- a/arch/um/include/sysdep-x86_64/ptrace.h +++ b/arch/um/include/sysdep-x86_64/ptrace.h | |||
@@ -1,5 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright 2003 PathScale, Inc. | 2 | * Copyright 2003 PathScale, Inc. |
3 | * Copyright (C) 2003 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) | ||
3 | * | 4 | * |
4 | * Licensed under the GPL | 5 | * Licensed under the GPL |
5 | */ | 6 | */ |
@@ -14,11 +15,6 @@ | |||
14 | #define MAX_REG_OFFSET (UM_FRAME_SIZE) | 15 | #define MAX_REG_OFFSET (UM_FRAME_SIZE) |
15 | #define MAX_REG_NR ((MAX_REG_OFFSET) / sizeof(unsigned long)) | 16 | #define MAX_REG_NR ((MAX_REG_OFFSET) / sizeof(unsigned long)) |
16 | 17 | ||
17 | #ifdef UML_CONFIG_MODE_TT | ||
18 | #include "sysdep/sc.h" | ||
19 | #endif | ||
20 | |||
21 | #ifdef UML_CONFIG_MODE_SKAS | ||
22 | #include "skas_ptregs.h" | 18 | #include "skas_ptregs.h" |
23 | 19 | ||
24 | #define REGS_IP(r) ((r)[HOST_IP]) | 20 | #define REGS_IP(r) ((r)[HOST_IP]) |
@@ -88,21 +84,10 @@ | |||
88 | 84 | ||
89 | #define REGS_ERR(r) ((r)->fault_type) | 85 | #define REGS_ERR(r) ((r)->fault_type) |
90 | 86 | ||
91 | #endif | ||
92 | |||
93 | #include "choose-mode.h" | 87 | #include "choose-mode.h" |
94 | 88 | ||
95 | /* XXX */ | 89 | /* XXX */ |
96 | union uml_pt_regs { | 90 | union uml_pt_regs { |
97 | #ifdef UML_CONFIG_MODE_TT | ||
98 | struct tt_regs { | ||
99 | long syscall; | ||
100 | unsigned long orig_rax; | ||
101 | void *sc; | ||
102 | struct faultinfo faultinfo; | ||
103 | } tt; | ||
104 | #endif | ||
105 | #ifdef UML_CONFIG_MODE_SKAS | ||
106 | struct skas_regs { | 91 | struct skas_regs { |
107 | unsigned long regs[MAX_REG_NR]; | 92 | unsigned long regs[MAX_REG_NR]; |
108 | unsigned long fp[HOST_FP_SIZE]; | 93 | unsigned long fp[HOST_FP_SIZE]; |
@@ -110,14 +95,10 @@ union uml_pt_regs { | |||
110 | long syscall; | 95 | long syscall; |
111 | int is_user; | 96 | int is_user; |
112 | } skas; | 97 | } skas; |
113 | #endif | ||
114 | }; | 98 | }; |
115 | 99 | ||
116 | #define EMPTY_UML_PT_REGS { } | 100 | #define EMPTY_UML_PT_REGS { } |
117 | 101 | ||
118 | /* XXX */ | ||
119 | extern int mode_tt; | ||
120 | |||
121 | #define UPT_RBX(r) __CHOOSE_MODE(SC_RBX(UPT_SC(r)), REGS_RBX((r)->skas.regs)) | 102 | #define UPT_RBX(r) __CHOOSE_MODE(SC_RBX(UPT_SC(r)), REGS_RBX((r)->skas.regs)) |
122 | #define UPT_RCX(r) __CHOOSE_MODE(SC_RCX(UPT_SC(r)), REGS_RCX((r)->skas.regs)) | 103 | #define UPT_RCX(r) __CHOOSE_MODE(SC_RCX(UPT_SC(r)), REGS_RCX((r)->skas.regs)) |
123 | #define UPT_RDX(r) __CHOOSE_MODE(SC_RDX(UPT_SC(r)), REGS_RDX((r)->skas.regs)) | 104 | #define UPT_RDX(r) __CHOOSE_MODE(SC_RDX(UPT_SC(r)), REGS_RDX((r)->skas.regs)) |
diff --git a/arch/um/include/sysdep-x86_64/thread.h b/arch/um/include/sysdep-x86_64/thread.h index cbef3e1697f4..d73d0b0afdb7 100644 --- a/arch/um/include/sysdep-x86_64/thread.h +++ b/arch/um/include/sysdep-x86_64/thread.h | |||
@@ -3,8 +3,4 @@ | |||
3 | 3 | ||
4 | #include <kern_constants.h> | 4 | #include <kern_constants.h> |
5 | 5 | ||
6 | #ifdef UML_CONFIG_MODE_TT | ||
7 | #define TASK_EXTERN_PID(task) *((int *) &(((char *) (task))[HOST_TASK_EXTERN_PID])) | ||
8 | #endif | ||
9 | |||
10 | #endif | 6 | #endif |
diff --git a/arch/um/include/tt/debug.h b/arch/um/include/tt/debug.h deleted file mode 100644 index 9778fa838296..000000000000 --- a/arch/um/include/tt/debug.h +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) and | ||
3 | * Lars Brinkhoff. | ||
4 | * Licensed under the GPL | ||
5 | */ | ||
6 | |||
7 | #ifndef __UML_TT_DEBUG_H | ||
8 | #define __UML_TT_DEBUG_H | ||
9 | |||
10 | extern int debugger_proxy(int status, pid_t pid); | ||
11 | extern void child_proxy(pid_t pid, int status); | ||
12 | extern void init_proxy (pid_t pid, int waiting, int status); | ||
13 | extern int start_debugger(char *prog, int startup, int stop, int *debugger_fd); | ||
14 | extern void fake_child_exit(void); | ||
15 | extern int gdb_config(char *str); | ||
16 | extern int gdb_remove(int unused); | ||
17 | |||
18 | #endif | ||
diff --git a/arch/um/include/tt/mmu-tt.h b/arch/um/include/tt/mmu-tt.h deleted file mode 100644 index 572a78b22587..000000000000 --- a/arch/um/include/tt/mmu-tt.h +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __TT_MMU_H | ||
7 | #define __TT_MMU_H | ||
8 | |||
9 | struct mmu_context_tt { | ||
10 | }; | ||
11 | |||
12 | #endif | ||
diff --git a/arch/um/include/tt/mode-tt.h b/arch/um/include/tt/mode-tt.h deleted file mode 100644 index 2823cd56eea2..000000000000 --- a/arch/um/include/tt/mode-tt.h +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __MODE_TT_H__ | ||
7 | #define __MODE_TT_H__ | ||
8 | |||
9 | #include "sysdep/ptrace.h" | ||
10 | |||
11 | enum { OP_NONE, OP_EXEC, OP_FORK, OP_TRACE_ON, OP_REBOOT, OP_HALT, OP_CB }; | ||
12 | |||
13 | extern int tracing_pid; | ||
14 | |||
15 | extern int tracer(int (*init_proc)(void *), void *sp); | ||
16 | extern void sig_handler_common_tt(int sig, void *sc); | ||
17 | extern void syscall_handler_tt(int sig, union uml_pt_regs *regs); | ||
18 | extern void reboot_tt(void); | ||
19 | extern void halt_tt(void); | ||
20 | extern int is_tracer_winch(int pid, int fd, void *data); | ||
21 | extern void kill_off_processes_tt(void); | ||
22 | |||
23 | #endif | ||
diff --git a/arch/um/include/tt/mode_kern_tt.h b/arch/um/include/tt/mode_kern_tt.h deleted file mode 100644 index a4fc63057195..000000000000 --- a/arch/um/include/tt/mode_kern_tt.h +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __TT_MODE_KERN_H__ | ||
7 | #define __TT_MODE_KERN_H__ | ||
8 | |||
9 | #include "linux/sched.h" | ||
10 | #include "asm/page.h" | ||
11 | #include "asm/ptrace.h" | ||
12 | #include "asm/uaccess.h" | ||
13 | |||
14 | extern void switch_to_tt(void *prev, void *next); | ||
15 | extern void flush_thread_tt(void); | ||
16 | extern void start_thread_tt(struct pt_regs *regs, unsigned long eip, | ||
17 | unsigned long esp); | ||
18 | extern int copy_thread_tt(int nr, unsigned long clone_flags, unsigned long sp, | ||
19 | unsigned long stack_top, struct task_struct *p, | ||
20 | struct pt_regs *regs); | ||
21 | extern void release_thread_tt(struct task_struct *task); | ||
22 | extern void initial_thread_cb_tt(void (*proc)(void *), void *arg); | ||
23 | extern void init_idle_tt(void); | ||
24 | extern void flush_tlb_kernel_range_tt(unsigned long start, unsigned long end); | ||
25 | extern void flush_tlb_kernel_vm_tt(void); | ||
26 | extern void __flush_tlb_one_tt(unsigned long addr); | ||
27 | extern void flush_tlb_range_tt(struct vm_area_struct *vma, | ||
28 | unsigned long start, unsigned long end); | ||
29 | extern void flush_tlb_mm_tt(struct mm_struct *mm); | ||
30 | extern void force_flush_all_tt(void); | ||
31 | extern long execute_syscall_tt(void *r); | ||
32 | extern void before_mem_tt(unsigned long brk_start); | ||
33 | extern unsigned long set_task_sizes_tt(unsigned long *task_size_out); | ||
34 | extern int start_uml_tt(void); | ||
35 | extern int external_pid_tt(struct task_struct *task); | ||
36 | extern int thread_pid_tt(struct task_struct *task); | ||
37 | |||
38 | #define kmem_end_tt (host_task_size - ABOVE_KMEM) | ||
39 | |||
40 | #endif | ||
diff --git a/arch/um/include/tt/tt.h b/arch/um/include/tt/tt.h deleted file mode 100644 index acb8356e1f98..000000000000 --- a/arch/um/include/tt/tt.h +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __TT_H__ | ||
7 | #define __TT_H__ | ||
8 | |||
9 | #include "sysdep/ptrace.h" | ||
10 | |||
11 | extern int gdb_pid; | ||
12 | extern int debug; | ||
13 | extern int debug_stop; | ||
14 | extern int debug_trace; | ||
15 | |||
16 | extern int honeypot; | ||
17 | |||
18 | extern int fork_tramp(void *sig_stack); | ||
19 | extern int do_proc_op(void *t, int proc_id); | ||
20 | extern int tracer(int (*init_proc)(void *), void *sp); | ||
21 | extern void attach_process(int pid); | ||
22 | extern void tracer_panic(char *format, ...) | ||
23 | __attribute__ ((format (printf, 1, 2))); | ||
24 | extern void set_init_pid(int pid); | ||
25 | extern int set_user_mode(void *task); | ||
26 | extern void set_tracing(void *t, int tracing); | ||
27 | extern int is_tracing(void *task); | ||
28 | extern void syscall_handler(int sig, union uml_pt_regs *regs); | ||
29 | extern void exit_kernel(int pid, void *task); | ||
30 | extern void do_syscall(void *task, int pid, int local_using_sysemu); | ||
31 | extern void do_sigtrap(void *task); | ||
32 | extern int is_valid_pid(int pid); | ||
33 | extern void remap_data(void *segment_start, void *segment_end, int w); | ||
34 | extern long execute_syscall_tt(void *r); | ||
35 | |||
36 | #endif | ||
37 | |||
diff --git a/arch/um/include/tt/uaccess-tt.h b/arch/um/include/tt/uaccess-tt.h deleted file mode 100644 index 13a64f61fcf4..000000000000 --- a/arch/um/include/tt/uaccess-tt.h +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __TT_UACCESS_H | ||
7 | #define __TT_UACCESS_H | ||
8 | |||
9 | #include "linux/string.h" | ||
10 | #include "linux/sched.h" | ||
11 | #include "asm/processor.h" | ||
12 | #include "asm/errno.h" | ||
13 | #include "asm/current.h" | ||
14 | #include "asm/a.out.h" | ||
15 | #include "uml_uaccess.h" | ||
16 | |||
17 | #define ABOVE_KMEM (16 * 1024 * 1024) | ||
18 | |||
19 | extern unsigned long end_vm; | ||
20 | extern unsigned long uml_physmem; | ||
21 | |||
22 | #define is_stack(addr, size) \ | ||
23 | (((unsigned long) (addr) < STACK_TOP) && \ | ||
24 | ((unsigned long) (addr) >= STACK_TOP - ABOVE_KMEM) && \ | ||
25 | (((unsigned long) (addr) + (size)) <= STACK_TOP)) | ||
26 | |||
27 | #define access_ok_tt(type, addr, size) \ | ||
28 | (is_stack(addr, size)) | ||
29 | |||
30 | extern int __do_copy_from_user(void *to, const void *from, int n, | ||
31 | void **fault_addr, void **fault_catcher); | ||
32 | extern int __do_strncpy_from_user(char *dst, const char *src, size_t n, | ||
33 | void **fault_addr, void **fault_catcher); | ||
34 | extern int __do_clear_user(void *mem, size_t len, void **fault_addr, | ||
35 | void **fault_catcher); | ||
36 | extern int __do_strnlen_user(const char *str, unsigned long n, | ||
37 | void **fault_addr, void **fault_catcher); | ||
38 | |||
39 | extern int copy_from_user_tt(void *to, const void __user *from, int n); | ||
40 | extern int copy_to_user_tt(void __user *to, const void *from, int n); | ||
41 | extern int strncpy_from_user_tt(char *dst, const char __user *src, int count); | ||
42 | extern int __clear_user_tt(void __user *mem, int len); | ||
43 | extern int clear_user_tt(void __user *mem, int len); | ||
44 | extern int strnlen_user_tt(const void __user *str, int len); | ||
45 | |||
46 | #endif | ||
diff --git a/arch/um/include/um_mmu.h b/arch/um/include/um_mmu.h index 0fa643238300..2461be6b0a60 100644 --- a/arch/um/include/um_mmu.h +++ b/arch/um/include/um_mmu.h | |||
@@ -8,33 +8,10 @@ | |||
8 | 8 | ||
9 | #include "uml-config.h" | 9 | #include "uml-config.h" |
10 | #include "choose-mode.h" | 10 | #include "choose-mode.h" |
11 | |||
12 | #ifdef UML_CONFIG_MODE_TT | ||
13 | #include "mmu-tt.h" | ||
14 | #endif | ||
15 | |||
16 | #ifdef UML_CONFIG_MODE_SKAS | ||
17 | #include "mmu-skas.h" | 11 | #include "mmu-skas.h" |
18 | #endif | ||
19 | 12 | ||
20 | typedef union mm_context { | 13 | typedef union mm_context { |
21 | #ifdef UML_CONFIG_MODE_TT | ||
22 | struct mmu_context_tt tt; | ||
23 | #endif | ||
24 | #ifdef UML_CONFIG_MODE_SKAS | ||
25 | struct mmu_context_skas skas; | 14 | struct mmu_context_skas skas; |
26 | #endif | ||
27 | } mm_context_t; | 15 | } mm_context_t; |
28 | 16 | ||
29 | #endif | 17 | #endif |
30 | |||
31 | /* | ||
32 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
33 | * Emacs will notice this stuff at the end of the file and automatically | ||
34 | * adjust the settings for this buffer only. This must remain at the end | ||
35 | * of the file. | ||
36 | * --------------------------------------------------------------------------- | ||
37 | * Local variables: | ||
38 | * c-file-style: "linux" | ||
39 | * End: | ||
40 | */ | ||
diff --git a/arch/um/include/um_uaccess.h b/arch/um/include/um_uaccess.h index 5126a99b5961..6757ee768ccb 100644 --- a/arch/um/include/um_uaccess.h +++ b/arch/um/include/um_uaccess.h | |||
@@ -7,15 +7,7 @@ | |||
7 | #define __ARCH_UM_UACCESS_H | 7 | #define __ARCH_UM_UACCESS_H |
8 | 8 | ||
9 | #include "choose-mode.h" | 9 | #include "choose-mode.h" |
10 | |||
11 | #ifdef CONFIG_MODE_TT | ||
12 | #include "uaccess-tt.h" | ||
13 | #endif | ||
14 | |||
15 | #ifdef CONFIG_MODE_SKAS | ||
16 | #include "uaccess-skas.h" | 10 | #include "uaccess-skas.h" |
17 | #endif | ||
18 | |||
19 | #include "asm/fixmap.h" | 11 | #include "asm/fixmap.h" |
20 | 12 | ||
21 | #define __under_task_size(addr, size) \ | 13 | #define __under_task_size(addr, size) \ |