]> git.hungrycats.org Git - linux/commitdiff
PPC32: Make switch_to return the previous task in the `last' argument
authorPaul Mackerras <paulus@samba.org>
Sat, 22 Feb 2003 23:28:57 +0000 (10:28 +1100)
committerPaul Mackerras <paulus@samba.org>
Sat, 22 Feb 2003 23:28:57 +0000 (10:28 +1100)
arch/ppc/kernel/process.c
include/asm-ppc/system.h

index 0194e65053e9a6f3e507e0b6a966cbed458e6cb8..803c73301b9de10d676aa91ef04b017ee943a3f7 100644 (file)
@@ -197,10 +197,12 @@ dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpregs)
        return 1;
 }
 
-void __switch_to(struct task_struct *prev, struct task_struct *new)
+struct task_struct *__switch_to(struct task_struct *prev,
+       struct task_struct *new)
 {
        struct thread_struct *new_thread, *old_thread;
        unsigned long s;
+       struct task_struct *last;
        
        local_irq_save(s);
 #if CHECK_STACK
@@ -244,8 +246,9 @@ void __switch_to(struct task_struct *prev, struct task_struct *new)
                new->thread.regs->msr |= MSR_VEC;
        new_thread = &new->thread;
        old_thread = &current->thread;
-       _switch(old_thread, new_thread);
+       last = _switch(old_thread, new_thread);
        local_irq_restore(s);
+       return last;
 }
 
 void show_regs(struct pt_regs * regs)
index 837f9bc6bab5ed81ebccb9737e3b9b8d9b9aa2fe..baf8f15678366abcd06bcbca742b1caf79fc7c98 100644 (file)
@@ -86,8 +86,9 @@ struct device_node;
 extern void note_scsi_host(struct device_node *, void *);
 
 struct task_struct;
-extern void __switch_to(struct task_struct *, struct task_struct *);
-#define switch_to(prev, next, last)    __switch_to((prev), (next))
+extern struct task_struct *__switch_to(struct task_struct *,
+       struct task_struct *);
+#define switch_to(prev, next, last)    ((last) = __switch_to((prev), (next)))
 
 struct thread_struct;
 extern struct task_struct *_switch(struct thread_struct *prev,