diff options
author | Jeff Dike <jdike@addtoit.com> | 2005-09-16 22:27:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-17 14:49:59 -0400 |
commit | f6e34c6af6f18bd6c66bfb1c6a7c57068412aa73 (patch) | |
tree | 45aebccc135b870a5aff5dcf975325171c7bf891 /arch/um/kernel/tt | |
parent | 6add9f7f529b124938d14ae9db5a952d1272075a (diff) |
[PATCH] uml: _switch_to code consolidation
This patch moves code that is in both switch_to_tt and switch_to_skas to the
top level _switch_to function, keeping us from duplicating code. It is
required for the stack trace patch to work properly.
Signed-off-by: Allan Graves <allan.graves@gmail.com>
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/kernel/tt')
-rw-r--r-- | arch/um/kernel/tt/include/mode_kern-tt.h | 2 | ||||
-rw-r--r-- | arch/um/kernel/tt/process_kern.c | 7 |
2 files changed, 2 insertions, 7 deletions
diff --git a/arch/um/kernel/tt/include/mode_kern-tt.h b/arch/um/kernel/tt/include/mode_kern-tt.h index e0ca0e0b2516..2a35b15c5fef 100644 --- a/arch/um/kernel/tt/include/mode_kern-tt.h +++ b/arch/um/kernel/tt/include/mode_kern-tt.h | |||
@@ -11,7 +11,7 @@ | |||
11 | #include "asm/ptrace.h" | 11 | #include "asm/ptrace.h" |
12 | #include "asm/uaccess.h" | 12 | #include "asm/uaccess.h" |
13 | 13 | ||
14 | extern void *switch_to_tt(void *prev, void *next); | 14 | extern void switch_to_tt(void *prev, void *next); |
15 | extern void flush_thread_tt(void); | 15 | extern void flush_thread_tt(void); |
16 | extern void start_thread_tt(struct pt_regs *regs, unsigned long eip, | 16 | extern void start_thread_tt(struct pt_regs *regs, unsigned long eip, |
17 | unsigned long esp); | 17 | unsigned long esp); |
diff --git a/arch/um/kernel/tt/process_kern.c b/arch/um/kernel/tt/process_kern.c index a189a2b92935..0de05a268b22 100644 --- a/arch/um/kernel/tt/process_kern.c +++ b/arch/um/kernel/tt/process_kern.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include "init.h" | 26 | #include "init.h" |
27 | #include "tt.h" | 27 | #include "tt.h" |
28 | 28 | ||
29 | void *switch_to_tt(void *prev, void *next, void *last) | 29 | int switch_to_tt(void *prev, void *next, void *last) |
30 | { | 30 | { |
31 | struct task_struct *from, *to, *prev_sched; | 31 | struct task_struct *from, *to, *prev_sched; |
32 | unsigned long flags; | 32 | unsigned long flags; |
@@ -36,8 +36,6 @@ void *switch_to_tt(void *prev, void *next, void *last) | |||
36 | from = prev; | 36 | from = prev; |
37 | to = next; | 37 | to = next; |
38 | 38 | ||
39 | to->thread.prev_sched = from; | ||
40 | |||
41 | cpu = from->thread_info->cpu; | 39 | cpu = from->thread_info->cpu; |
42 | if(cpu == 0) | 40 | if(cpu == 0) |
43 | forward_interrupts(to->thread.mode.tt.extern_pid); | 41 | forward_interrupts(to->thread.mode.tt.extern_pid); |
@@ -53,7 +51,6 @@ void *switch_to_tt(void *prev, void *next, void *last) | |||
53 | forward_pending_sigio(to->thread.mode.tt.extern_pid); | 51 | forward_pending_sigio(to->thread.mode.tt.extern_pid); |
54 | 52 | ||
55 | c = 0; | 53 | c = 0; |
56 | set_current(to); | ||
57 | 54 | ||
58 | err = os_write_file(to->thread.mode.tt.switch_pipe[1], &c, sizeof(c)); | 55 | err = os_write_file(to->thread.mode.tt.switch_pipe[1], &c, sizeof(c)); |
59 | if(err != sizeof(c)) | 56 | if(err != sizeof(c)) |
@@ -85,8 +82,6 @@ void *switch_to_tt(void *prev, void *next, void *last) | |||
85 | 82 | ||
86 | flush_tlb_all(); | 83 | flush_tlb_all(); |
87 | local_irq_restore(flags); | 84 | local_irq_restore(flags); |
88 | |||
89 | return(current->thread.prev_sched); | ||
90 | } | 85 | } |
91 | 86 | ||
92 | void release_thread_tt(struct task_struct *task) | 87 | void release_thread_tt(struct task_struct *task) |