_scheduler_task_suspend:
movem.l a0-a6/d0-d7,-(a7) ;* save the registers
movea.l _thread_queue,a3 ;* get the current thread
move.l a7,stackp(a3) ;* save the stack pointer
movea.l nexttask(a3),a4 ;* save the next task in a4
move.l #$0,nexttask(a3) ;* null the next pointer
jmp skip_null ;* normally start next thread
;* unneeded code deleted
skip_null:
move.w pid(a4),d0 ;* check if this is null task
bne new_task ;* not the null task, so execute
movea.l nexttask(a4),a4 ;* load the next task (might be null)
new_task:
move.l a4,_thread_queue ;* set the current thread ptr
move.l stackp(a4),a7 ;* restore the stack pointer
movem.l (a7)+,d0-d7/a0-a6 ;* restore registers
rte ;* kickstart new thread