2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
9 #include <exec/types.h>
10 #include <exec/execbase.h>
11 #include <aros/libcall.h>
12 #include <aros/atomic.h>
13 #include <proto/kernel.h>
15 #include "exec_intern.h"
17 /*****************************************************************************
20 #include <proto/exec.h>
22 AROS_LH0(void, Reschedule
,
27 struct ExecBase
*, SysBase
, 8, Exec
)
30 Give up the CPU time to other tasks (if there are any).
39 This function was private in AmigaOS(tm) up to v3.1. There's no guarantee
40 that it will continue to exist in other systems.
52 ******************************************************************************/
56 AROS_ATOMIC_OR(SysBase
->AttnResched
, ARF_AttnSwitch
); /* Set scheduling attention */
58 if (SysBase
->TDNestCnt
< 0) /* If task switching enabled */
60 if (SysBase
->IDNestCnt
< 0) /* And interrupts enabled */
62 D(bug("[Reschedule] Calling scheduler, KernelBase 0x%p\n", KernelBase
));
63 KrnSchedule(); /* Call scheduler */
66 * FIXME: On m68k-amiga we should request software interrupt here.
67 * Next Enable() will actually enable interrupts, and the interrupt should
68 * happen instantly, with no delay. kernel.resource will see ARF_AttnSwitch
69 * flag and perform rescheduling.
71 * On other machines we emulate this explicitly in our Enable() function.
72 * There we will check AttnResched value we just set.