2 Copyright © 1995-2015, 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
33 function arguments. May be NULL.
36 The value returned by your function.
39 This function is mostly compatible with MorphOS's NewPPCStackSwap()
45 Do not attempt to pass in a prebuilt stack - it will be erased.
51 This function MUST be replaced in $(KERNEL) or $(ARCH).
53 ******************************************************************************/
57 /* For an example see the NewStackSwap() function in either i386 or
60 Note that you must save any state information on the stack that is
61 used in the current process, for example you should really save
64 Note that even if you do save that information, it is not a good
65 idea to return from the procedure that StackSwap() was invoked in
66 as the stack will be quite incorrect.
70 #error The function NewStackSwap() has not been implemented in the kernel.
76 } /* NewStackSwap() */