]> Pileus Git - ~andy/linux/blobdiff - arch/arc/kernel/ctx_sw.c
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
[~andy/linux] / arch / arc / kernel / ctx_sw.c
index 60844dac6132a0c689d53351603ac448295598bb..34410eb1a308e7d801abbc6ece893db54975f9c7 100644 (file)
@@ -23,10 +23,6 @@ __switch_to(struct task_struct *prev_task, struct task_struct *next_task)
        unsigned int tmp;
        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 */
@@ -44,8 +40,9 @@ __switch_to(struct task_struct *prev_task, struct task_struct *next_task)
                "st.a    r24, [sp, -4]   \n\t"
 #ifndef CONFIG_ARC_CURR_IN_REG
                "st.a    r25, [sp, -4]   \n\t"
+#else
+               "sub     sp, sp, 4      \n\t"   /* usual r25 placeholder */
 #endif
-               "sub     sp, sp, %4      \n\t"  /* create gutter at top */
 
                /* set ksp of outgoing task in tsk->thread.ksp */
                "st.as   sp, [%3, %1]    \n\t"
@@ -76,10 +73,10 @@ __switch_to(struct task_struct *prev_task, struct task_struct *next_task)
 
                /* start loading it's CALLEE reg file */
 
-               "add    sp, sp, %4     \n\t"    /* skip gutter at top */
-
 #ifndef CONFIG_ARC_CURR_IN_REG
                "ld.ab   r25, [sp, 4]   \n\t"
+#else
+               "add    sp, sp, 4       \n\t"
 #endif
                "ld.ab   r24, [sp, 4]   \n\t"
                "ld.ab   r23, [sp, 4]   \n\t"
@@ -100,8 +97,7 @@ __switch_to(struct task_struct *prev_task, struct task_struct *next_task)
                /* FP/BLINK restore generated by gcc (standard func epilogue */
 
                : "=r"(tmp)
-               : "n"((TASK_THREAD + THREAD_KSP) / 4), "r"(next), "r"(prev),
-                 "n"(num_words_to_skip * 4)
+               : "n"((TASK_THREAD + THREAD_KSP) / 4), "r"(next), "r"(prev)
                : "blink"
        );