2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
6 #include <exec/types.h>
7 #include <aros/libcall.h>
9 #error "PrepareContext() has been changed. Additional tagList param, etc."
10 #error "This one here needs to be rewritten!"
12 /*****************************************************************************
16 AROS_LH3I(APTR
, PrepareContext
,
19 AROS_LHA(APTR
, stackPointer
, A0
),
20 AROS_LHA(APTR
, entryPoint
, A1
),
21 AROS_LHA(APTR
, fallBack
, A2
),
24 struct ExecBase
*, SysBase
, 6, Exec
)
27 Allocates the space required to hold a new set of registers on the
28 Stack given by stackPointer and clears the area except for pc which
29 is set to the address given by entryPoint.
32 stackPointer - Pointer to a scpecific stack
33 entryPoint - Address of the function to call when the new context
35 fallBack - Address to be called when the entryPoint function ended
39 The new Stackpointer with the underlying context.
42 This function is for internal use by exec only.
44 This function is processor dependant.
57 ******************************************************************************/
60 UBYTE
*sp
=(UBYTE
*)stackPointer
;
64 mc68000 version. As long as no FPU is in use this works for the
65 other mc680xx brands as well.
68 /* Push fallback address */
72 /* Now push the context. Prepare a rts first (pc). */
74 *(APTR
*)sp
=entryPoint
;
76 /* Push 15 registers */
85 } /* PrepareContext */