2 Copyright © 1995-2009, The AROS Development Team. All rights reserved.
5 Desc: NewStackSwap() - Call a function with swapped stack.
9 /*****************************************************************************
12 #include <exec/tasks.h>
13 #include <proto/exec.h>
15 AROS_LH3(IPTR
, NewStackSwap
,
18 AROS_LHA(struct StackSwapStruct
*, sss
, A0
),
19 AROS_LHA(LONG_FUNC
, entry
, A1
),
20 AROS_LHA(struct StackSwapArgs
*, args
, A2
),
23 struct ExecBase
*, SysBase
, 134, Exec
)
26 Calls a function with a new stack.
29 sss - A structure containing the values for the upper, lower
30 and current bounds of the stack you wish to use.
31 entry - Address of the function to call.
32 args - A structure (actually an array) containing up to 8
36 A value actually returned by your function. The function will be
37 running on a new stack.
44 Do not attempt to pass in a prebuilt stack - it will be erased.
50 This function MUST be replaced in $(KERNEL) or $(ARCH).
52 ******************************************************************************/
56 /* For an example see the NewStackSwap() function in either i386 or
59 Note that you must save any state information on the stack that is
60 used in the current process, for example you should really save
63 Note that even if you do save that information, it is not a good
64 idea to return from the procedure that StackSwap() was invoked in
65 as the stack will be quite incorrect.
69 #error The function NewStackSwap() has not been implemented in the kernel.
75 } /* NewStackSwap() */