C (67/254)

From:Colin Wenzel
Date:19 Apr 00 at 14:16:31
Subject:Re: How to change stack

On 19-Apr-00, Andrzej J. Debicki wrote:
> Hello,
> But inside the program. I'd like to increase task stack. Please
> provide me tith some example.
>

exec.library/StackSwap exec.library/StackSwap

NAME
StackSwap - EXEC supported method of replacing task's stack (V37)

SYNOPSIS
StackSwap(newStack)
A0

VOID StackSwap(struct StackSwapStruct *);

FUNCTION
This function will, in an EXEC supported manner, swap the
stack of your task with the given values in StackSwap.
The StackSwapStruct structure will then contain the values
of the old stack such that the old stack can be restored.
This function is new in V37.

NOTE
If you do a stack swap, only the new stack is set up.
This function does not copy the stack or do anything else
other than set up the new stack for the task. It is
generally required that you restore your stack before
exiting.

INPUTS
newStack - A structure that contains the values for the
new upper and lower stack bounds and the new stack
pointer. This structure will have its values
replaced by those in you task such that you can
restore the stack later.

RESULTS
newStack - The structure will now contain the old stack.
This means that StackSwap(foo); StackSwap(foo);
will effectively do nothing.

/* exec/tasks.h
* Stack swap structure as passed to StackSwap()
*/

struct StackSwapStruct {
APTR stk_Lower; /* Lowest byte of stack */
ULONG stk_Upper; /* Upper end of stack (size + Lowest) */
APTR stk_Pointer; /* Stack pointer at switch point */
};

-------------------------------------
Colin Wenzel. Australia.

EMAIL: mailto:colstv@hotkey.net.au
URL: http://www.hotkey.net.au/~colstv/
ICQ: 17608330
AMIGA: 4000T, 68060/50, 150Mb RAM,
OS 3.5, EGS Spectrum.
---------------------------------------

------------------------------------------------------------------------
Whatever you want, chances are you'll find it at one of the hundreds
of sites in The PointClick Network--like Disney.com, eCost.com,
FogDog.com and many more. You get paid as you shop and an additional
10% off any purchase, anytime.
http://click.egroups.com/1/2994/1/_/451227/_/956150340/
------------------------------------------------------------------------