Commit 8420aa16 authored by Anton Blanchard's avatar Anton Blanchard

ppc64: update for recent changes that require switch_to to return prev

parent c8035a29
......@@ -301,6 +301,8 @@ _GLOBAL(_switch)
REST_8GPRS(14, r1)
REST_10GPRS(22, r1)
/* convert old thread to its task_struct for return value */
addi r3,r3,-THREAD
ld r7,_NIP(r1) /* Return to _switch caller in new task */
mtlr r7
addi r1,r1,SWITCH_FRAME_SIZE
......
......@@ -82,11 +82,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 flags;
struct task_struct *last;
#ifdef CONFIG_SMP
/* avoid complexity of lazy save/restore of fpu
......@@ -106,8 +107,9 @@ __switch_to(struct task_struct *prev, struct task_struct *new)
old_thread = &current->thread;
local_irq_save(flags);
_switch(old_thread, new_thread);
last = _switch(old_thread, new_thread);
local_irq_restore(flags);
return last;
}
static void show_tsk_stack(struct task_struct *p, unsigned long sp);
......
......@@ -89,11 +89,13 @@ extern void cvt_df(double *from, float *to, unsigned long *fpscr);
extern int abs(int);
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 void _switch(struct thread_struct *prev, struct thread_struct *next);
extern struct task_struct * _switch(struct thread_struct *prev,
struct thread_struct *next);
struct pt_regs;
extern void dump_regs(struct pt_regs *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment