(C) 1998 AROS - The Amiga Research OS


NAME
#include <exec/tasks.h>
#include <proto/exec.h>

void StackSwap ( sss)

LOCATION
In SysBase at offset 122

SYNOPSIS
struct StackSwapStruct * sss

FUNCTION
Changes the stack used by a task. The StackSwapStruct will contain the value of the old stack such that the stack can be reset to the previous version by another call to StackSwap().

When the stack is swapped, the data on the stack(s) will not be altered, so the stack may not be set up for you. It is generally required that you replace your stack before exiting from the current stack frame (procedure, function call etc.).

INPUTS
sss
A structure containing the values for the upper, lower and current bounds of the stack you wish to use. The values will be replaced by the current values and you can restore the values later.

RESULT
The program will be running on a new stack and sss will contain the old stack.

Calling StackSwap() twice consequtively will effectively do nothing.

EXAMPLE

SEE ALSO
AddTask(), RemTask()

NOTES
Returning from the function that you call StackSwap() in can have unexpected results.

BUGS

INTERNALS
This function MUST be replaced in $(KERNEL) or $(ARCH).

HISTORY