165
165
* sources). Calls up to high level code to do all the work.
167
167
ENTRY(inthandler)
170
movel %d0,%sp@(PT_OFF_ORIG_D0)
172
170
movew %sp@(PT_OFF_FORMATVEC),%d0 /* put exception # in d0 */
173
171
andl #0x03fc,%d0 /* mask out vector only */
184
182
* Beware - when entering resume, prev (the current task) is
185
* in a0, next (the new task) is in a1,so don't change these
183
* in a0, next (the new task) is in a1, so don't change these
186
184
* registers until their contents are no longer needed.
187
* This is always called in supervisor mode, so don't bother to save
188
* and restore sr; user's process sr is actually in the stack.
191
movel %a0, %d1 /* get prev thread in d1 */
193
movel %a2,%a0@(TASK_THREAD+THREAD_USP)
187
movew %sr,%d1 /* save current status */
188
movew %d1,%a0@(TASK_THREAD+THREAD_SR)
189
movel %a0,%d1 /* get prev thread in d1 */
195
190
SAVE_SWITCH_STACK
196
191
movel %sp,%a0@(TASK_THREAD+THREAD_KSP) /* save kernel stack pointer */
197
movel %a1@(TASK_THREAD+THREAD_KSP),%sp /* restore new thread stack */
192
RDUSP /* movel %usp,%a3 */
193
movel %a3,%a0@(TASK_THREAD+THREAD_USP) /* save thread user stack */
195
movel %a1@(TASK_THREAD+THREAD_USP),%a3 /* restore thread user stack */
196
WRUSP /* movel %a3,%usp */
197
movel %a1@(TASK_THREAD+THREAD_KSP),%sp /* restore new kernel stack */
198
movew %a1@(TASK_THREAD+THREAD_SR),%d7 /* restore new status */
198
200
RESTORE_SWITCH_STACK
200
movel %a1@(TASK_THREAD+THREAD_USP),%a0 /* restore thread user stack */