2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Native version of Switch().
9 #include <exec/execbase.h>
10 #include <proto/exec.h>
12 AROS_LH0(void, Switch
,
13 struct ExecBase
*, SysBase
, 9, Exec
)
17 struct Task
*this = SysBase
->ThisTask
;
20 If the state is not TS_RUN then the task is already in a list
25 if( (this->tc_State
!= TS_RUN
)
26 && !(this->tc_Flags
& TF_EXCEPT
) )
28 /* Its quite possible that they have interrupts Disabled(),
29 we should fix that here, otherwise we can't switch.
31 We can't call the dispatcher because we need a signal,
34 Have to set the dispatch-required flag.
35 I use SIGUSR1 (maps to SoftInt) because it has less effect on
36 the system clock, and is probably quicker.
39 SysBase
->AttnResched
|= 0x8000;
40 __asm__
__volatile__ ("move.l %d7,-(%sp)\n\t"
43 "move.l (%sp)+,%d7\n\t");