diff options
Diffstat (limited to 'arch/arc/kernel/ctx_sw.c')
-rw-r--r-- | arch/arc/kernel/ctx_sw.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arc/kernel/ctx_sw.c b/arch/arc/kernel/ctx_sw.c index 647e37a5165e..fbf739cbaf7d 100644 --- a/arch/arc/kernel/ctx_sw.c +++ b/arch/arc/kernel/ctx_sw.c @@ -24,6 +24,9 @@ __switch_to(struct task_struct *prev_task, struct task_struct *next_task) unsigned int prev = (unsigned int)prev_task; unsigned int next = (unsigned int)next_task; int num_words_to_skip = 1; +#ifdef CONFIG_ARC_CURR_IN_REG + num_words_to_skip++; +#endif __asm__ __volatile__( /* FP/BLINK save generated by gcc (standard function prologue */ @@ -39,7 +42,9 @@ __switch_to(struct task_struct *prev_task, struct task_struct *next_task) "st.a r22, [sp, -4] \n\t" "st.a r23, [sp, -4] \n\t" "st.a r24, [sp, -4] \n\t" +#ifndef CONFIG_ARC_CURR_IN_REG "st.a r25, [sp, -4] \n\t" +#endif "sub sp, sp, %4 \n\t" /* create gutter at top */ /* set ksp of outgoing task in tsk->thread.ksp */ @@ -62,7 +67,9 @@ __switch_to(struct task_struct *prev_task, struct task_struct *next_task) "add sp, sp, %4 \n\t" /* skip gutter at top */ +#ifndef CONFIG_ARC_CURR_IN_REG "ld.ab r25, [sp, 4] \n\t" +#endif "ld.ab r24, [sp, 4] \n\t" "ld.ab r23, [sp, 4] \n\t" "ld.ab r22, [sp, 4] \n\t" |