2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
5 #include <exec/types.h>
6 #include <aros/libcall.h>
8 #error "PrepareContext() has been changed. Additional tagList param, etc."
9 #error "This one here needs to be rewritten!"
11 /*****************************************************************************
15 AROS_LH3I(APTR
, PrepareContext
,
18 AROS_LHA(APTR
, stackPointer
, A0
),
19 AROS_LHA(APTR
, entryPoint
, A1
),
20 AROS_LHA(APTR
, fallBack
, A2
),
23 struct ExecBase
*, SysBase
, 9, Exec
)
26 Allocates the space required to hold a new set of registers on the
27 Stack given by stackPointer and clears the area except for pc which
28 is set to the address given by entryPoint.
31 stackPointer - Pointer to a scpecific stack
32 entryPoint - Address of the function to call when the new context
34 fallBack - Address to be called when the entryPoint function ended
38 The new Stackpointer with the underlying context.
41 This function is for internal use by exec only.
43 This function is processor dependant.
56 ******************************************************************************/
59 UBYTE
*sp
=(UBYTE
*)stackPointer
;
63 mc68000 version. As long as no FPU is in use this works for the
64 other mc680xx brands as well.
67 /* Push fallback address */
71 /* Now push the context. First a5. */
75 /* Then a reverse rte (ccr & pc). */
79 *(APTR
*)sp
=entryPoint
;
81 /* Push 14 registers */