aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/m68knommu/kernel/asm-offsets.c1
-rw-r--r--arch/m68knommu/platform/coldfire/entry.S16
2 files changed, 17 insertions, 0 deletions
diff --git a/arch/m68knommu/kernel/asm-offsets.c b/arch/m68knommu/kernel/asm-offsets.c
index fd0c685a7f11..c785d07c02cc 100644
--- a/arch/m68knommu/kernel/asm-offsets.c
+++ b/arch/m68knommu/kernel/asm-offsets.c
@@ -87,6 +87,7 @@ int main(void)
87 DEFINE(TI_TASK, offsetof(struct thread_info, task)); 87 DEFINE(TI_TASK, offsetof(struct thread_info, task));
88 DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain)); 88 DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain));
89 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); 89 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
90 DEFINE(TI_PREEMPTCOUNT, offsetof(struct thread_info, preempt_count));
90 DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); 91 DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
91 92
92 return 0; 93 return 0;
diff --git a/arch/m68knommu/platform/coldfire/entry.S b/arch/m68knommu/platform/coldfire/entry.S
index 111b66dc737b..1af7c1d650f6 100644
--- a/arch/m68knommu/platform/coldfire/entry.S
+++ b/arch/m68knommu/platform/coldfire/entry.S
@@ -106,6 +106,22 @@ ret_from_exception:
106 btst #5,%sp@(PT_SR) /* check if returning to kernel */ 106 btst #5,%sp@(PT_SR) /* check if returning to kernel */
107 jeq Luser_return /* if so, skip resched, signals */ 107 jeq Luser_return /* if so, skip resched, signals */
108 108
109#ifdef CONFIG_PREEMPT
110 movel %sp,%d1 /* get thread_info pointer */
111 andl #-THREAD_SIZE,%d1 /* at base of kernel stack */
112 movel %d1,%a0
113 movel %a0@(TI_FLAGS),%d1 /* get thread_info->flags */
114 andl #_TIF_NEED_RESCHED,%d1
115 jeq Lkernel_return
116
117 movel %a0@(TI_PREEMPTCOUNT),%d1
118 cmpl #0,%d1
119 jne Lkernel_return
120
121 pea Lkernel_return
122 jmp preempt_schedule_irq /* preempt the kernel */
123#endif
124
109Lkernel_return: 125Lkernel_return:
110 moveml %sp@,%d1-%d5/%a0-%a2 126 moveml %sp@,%d1-%d5/%a0-%a2
111 lea %sp@(32),%sp /* space for 8 regs */ 127 lea %sp@(32),%sp /* space for 8 regs */