diff options
Diffstat (limited to 'arch/um/kernel')
-rw-r--r-- | arch/um/kernel/process.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index 91bd68eaba20..62a4e0e12c9c 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c | |||
@@ -81,12 +81,12 @@ static inline void set_current(struct task_struct *task) | |||
81 | { external_pid(task), task }); | 81 | { external_pid(task), task }); |
82 | } | 82 | } |
83 | 83 | ||
84 | extern void arch_switch_to(struct task_struct *from, struct task_struct *to); | 84 | extern void arch_switch_to(struct task_struct *to); |
85 | 85 | ||
86 | void *_switch_to(void *prev, void *next, void *last) | 86 | void *_switch_to(void *prev, void *next, void *last) |
87 | { | 87 | { |
88 | struct task_struct *from = prev; | 88 | struct task_struct *from = prev; |
89 | struct task_struct *to= next; | 89 | struct task_struct *to = next; |
90 | 90 | ||
91 | to->thread.prev_sched = from; | 91 | to->thread.prev_sched = from; |
92 | set_current(to); | 92 | set_current(to); |
@@ -94,16 +94,15 @@ void *_switch_to(void *prev, void *next, void *last) | |||
94 | do { | 94 | do { |
95 | current->thread.saved_task = NULL; | 95 | current->thread.saved_task = NULL; |
96 | 96 | ||
97 | switch_threads(&from->thread.switch_buf, | 97 | switch_threads(&from->thread.switch_buf, &to->thread.switch_buf); |
98 | &to->thread.switch_buf); | ||
99 | 98 | ||
100 | arch_switch_to(current->thread.prev_sched, current); | 99 | arch_switch_to(current); |
101 | 100 | ||
102 | if (current->thread.saved_task) | 101 | if (current->thread.saved_task) |
103 | show_regs(&(current->thread.regs)); | 102 | show_regs(&(current->thread.regs)); |
104 | next= current->thread.saved_task; | 103 | next = current->thread.saved_task; |
105 | prev= current; | 104 | prev = current; |
106 | } while(current->thread.saved_task); | 105 | } while (current->thread.saved_task); |
107 | 106 | ||
108 | return current->thread.prev_sched; | 107 | return current->thread.prev_sched; |
109 | 108 | ||
@@ -161,8 +160,6 @@ void new_thread_handler(void) | |||
161 | void fork_handler(void) | 160 | void fork_handler(void) |
162 | { | 161 | { |
163 | force_flush_all(); | 162 | force_flush_all(); |
164 | if (current->thread.prev_sched == NULL) | ||
165 | panic("blech"); | ||
166 | 163 | ||
167 | schedule_tail(current->thread.prev_sched); | 164 | schedule_tail(current->thread.prev_sched); |
168 | 165 | ||
@@ -171,7 +168,7 @@ void fork_handler(void) | |||
171 | * arch_switch_to isn't needed. We could want to apply this to | 168 | * arch_switch_to isn't needed. We could want to apply this to |
172 | * improve performance. -bb | 169 | * improve performance. -bb |
173 | */ | 170 | */ |
174 | arch_switch_to(current->thread.prev_sched, current); | 171 | arch_switch_to(current); |
175 | 172 | ||
176 | current->thread.prev_sched = NULL; | 173 | current->thread.prev_sched = NULL; |
177 | 174 | ||