Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-drm-fsl-dcu.git] / arch / sparc / kernel / rtrap_64.S
index afa2a9e3d0a0c6734785dfaafc68538d7e393b51..39f0c662f4c81dcdf3050926a5a9525d352933a3 100644 (file)
 #define                RTRAP_PSTATE_IRQOFF     (PSTATE_TSO|PSTATE_PEF|PSTATE_PRIV)
 #define                RTRAP_PSTATE_AG_IRQOFF  (PSTATE_TSO|PSTATE_PEF|PSTATE_PRIV|PSTATE_AG)
 
+#ifdef CONFIG_CONTEXT_TRACKING
+# define SCHEDULE_USER schedule_user
+#else
+# define SCHEDULE_USER schedule
+#endif
+
                .text
                .align                  32
 __handle_preemption:
-               call                    schedule
+               call                    SCHEDULE_USER
                 wrpr                   %g0, RTRAP_PSTATE, %pstate
                ba,pt                   %xcc, __handle_preemption_continue
                 wrpr                   %g0, RTRAP_PSTATE_IRQOFF, %pstate
@@ -306,12 +312,10 @@ to_kernel:
                 nop
                cmp                     %l4, 0
                bne,pn                  %xcc, kern_fpucheck
-                sethi                  %hi(PREEMPT_ACTIVE), %l6
-               stw                     %l6, [%g6 + TI_PRE_COUNT]
-               call                    schedule
+                nop
+               call                    preempt_schedule_irq
                 nop
                ba,pt                   %xcc, rtrap
-                stw                    %g0, [%g6 + TI_PRE_COUNT]
 #endif
 kern_fpucheck: ldub                    [%g6 + TI_FPDEPTH], %l5
                brz,pt                  %l5, rt_continue