r4493@vps: verhaegs | 2007-04-19 14:44:00 -0400
[AROS.git] / rom / exec / preparecontext.c
blobb979e7960226f1be7ecd6929563823c18a3eff65
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: PrepareContext() - Prepare a task context for dispatch.
6 Lang: english
7 */
9 #include <exec/types.h>
10 #include <aros/libcall.h>
11 #include <exec/execbase.h>
12 #include <utility/tagitem.h>
14 /*****i***********************************************************************
16 NAME */
17 AROS_LH4(BOOL, PrepareContext,
19 /* SYNOPSIS */
20 AROS_LHA(struct Task *, task, A0),
21 AROS_LHA(APTR, entryPoint, A1),
22 AROS_LHA(APTR, fallBack, A2),
23 AROS_LHA(struct TagItem *, tagList, A3),
25 /* LOCATION */
26 struct ExecBase *, SysBase, 6, Exec)
28 /* FUNCTION
29 Prepare the context (set of registers) for a new task.
30 The context/stack will be set so that when the entryPoint
31 function returns, the fallback function will be called.
33 INPUTS
34 task - Pointer to task
35 entryPoint - Function to call when the new context
36 comes alive.
37 fallBack - Address of the function to be called
38 when the entryPoint function returns.
39 tagList - Additional options. Like for passing
40 arguments to the entryPoint() functions.
42 RESULT
43 TRUE on success. FALSE on failure.
45 NOTES
46 This function is very CPU dependant. In fact it can differ
47 over different models of the same processor family.
49 EXAMPLE
51 BUGS
53 SEE ALSO
54 Dispatch()
56 INTERNALS
57 This function is required to be implemented in the $(KERNEL).
59 ******************************************************************************/
61 AROS_LIBFUNC_INIT
63 /* This function is too CPU dependant to be described here, but
64 basically you effectively do a state save (similar to in
65 Dispatch()) but of a context that has not been run yet.
68 #ifndef __CXREF__
69 #error The PrepareContext() function was not implemented in the kernel.
70 #endif
72 AROS_LIBFUNC_EXIT
73 } /* PrepareContext() */