Added 'Resident' field to ensure that the handler is included in the
[AROS.git] / rom / exec / reschedule.c
blobb898a41260945a4f99a374ae1c4c58810e1e0b09
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
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 /*****************************************************************************
19 NAME */
20 #include <proto/exec.h>
22 AROS_LH0(void, Reschedule,
24 /* SYNOPSIS */
26 /* LOCATION */
27 struct ExecBase *, SysBase, 8, Exec)
29 /* FUNCTION
30 Give up the CPU time to other tasks (if there are any).
32 INPUTS
33 None
35 RESULT
36 None
38 NOTES
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.
42 EXAMPLE
44 BUGS
46 SEE ALSO
48 INTERNALS
50 HISTORY
52 ******************************************************************************/
54 AROS_LIBFUNC_INIT
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.
74 else
77 } */
80 AROS_LIBFUNC_EXIT
81 } /* Reschedule */