@@ -80,7 +80,7 @@ static inline void set_current(struct task_struct *task)
{ external_pid(), task });
}
-extern void arch_switch_to(struct task_struct *to);
+extern void arch_switch_to(struct task_struct *from, struct task_struct *to);
void *__switch_to(struct task_struct *from, struct task_struct *to)
{
@@ -88,7 +88,7 @@ void *__switch_to(struct task_struct *from, struct task_struct *to)
set_current(to);
switch_threads(&from->thread.switch_buf, &to->thread.switch_buf);
- arch_switch_to(current);
+ arch_switch_to(from, to);
return current->thread.prev_sched;
}
@@ -145,7 +145,7 @@ void fork_handler(void)
* arch_switch_to isn't needed. We could want to apply this to
* improve performance. -bb
*/
- arch_switch_to(current);
+ arch_switch_to(NULL, current);
current->thread.prev_sched = NULL;
@@ -11,7 +11,7 @@
extern int arch_switch_tls(struct task_struct *to);
-void arch_switch_to(struct task_struct *to)
+void arch_switch_to(struct task_struct *from, struct task_struct *to)
{
int err = arch_switch_tls(to);
if (!err)
@@ -80,7 +80,7 @@ SYSCALL_DEFINE2(arch_prctl, int, option, unsigned long, arg2)
return arch_prctl(current, option, (unsigned long __user *) arg2);
}
-void arch_switch_to(struct task_struct *to)
+void arch_switch_to(struct task_struct *from, struct task_struct *to)
{
if ((to->thread.arch.fs == 0) || (to->mm == NULL))
return;
This commit introduces additional argument of previous task when context switch happens. New SUBARCH can use the new information to switch tasks in a subarch-specific manner. The patch is particularly required by nommu mode implemented as a SUBARCH of UML. Signed-off-by: Hajime Tazaki <thehajime@gmail.com> --- arch/um/kernel/process.c | 6 +++--- arch/x86/um/ptrace_32.c | 2 +- arch/x86/um/syscalls_64.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-)