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>
13 #include <aros/debug.h>
15 #include "arm_exec_internal.h"
17 AROS_LH0(void, Switch
,
18 struct ExecBase
*, SysBase
, 9, Exec
)
22 struct Task
*this = SysBase
->ThisTask
;
25 If the state is not TS_RUN then the task is already in a list
29 if( (this->tc_State
!= TS_RUN
)
30 && !(this->tc_Flags
& TF_EXCEPT
) )
32 /* Its quite possible that they have interrupts Disabled(),
33 we should fix that here, otherwise we can't switch.
35 We can't call the dispatcher because we need a signal,
38 Have to set the dispatch-required flag.
39 I use SIGUSR1 (maps to SoftInt) because it has less effect on
40 the system clock, and is probably quicker.
43 SysBase
->AttnResched
|= 0x8000;
44 __asm__
__volatile__ ("swi #0\n\t");