Path: utzoo!mnetor!uunet!husc6!hao!ames!ucbcad!pasteur!ucbvax!hoser.berkeley.edu!bryce From: bryce@hoser.berkeley.edu (Bryce Nesbitt) Newsgroups: comp.sys.amiga Subject: ]}{wpoerioiew23 dsflwe Message-ID: <22682@ucbvax.BERKELEY.EDU> Date: 20 Jan 88 20:53:01 GMT Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: bryce@hoser.berkeley.edu (Bryce Nesbitt) Organization: The Logic Foundation Lines: 49 ;NAME ; SetStack -- use a different process stack ; V1.0 Tuesday 19-Jan-88 04:14:15 By Bryce Nesbitt ; ;SYNOPSIS ; SetStack(newstack,size) ; a1 d0 ; ; char *newstack; ; long size; ; ;FUNCTION ; This function points the current process' stack to a new memory ; location. The active part of the old stack is duplicated, so no ; context is lost. SetStack() also tickles the proper fields in the task ; structure to tell the system about the change. At this time it does ; not deallocate the old stack. ; ;USAGE ; Typically this is used by a process that needs a larger stack than it ; might have been started with. The stack size can be found with: ; ; #include "libraries/dosextens.h" ; ... ; stack=*(ULONG *)( ((struct Process *)FindTask(0L))->pr_ReturnAddr ); ; ; Or in English, the long word at the address pointed to by pr_ReturnAddr. ; ;WARNINGS ; A future revision of exec may do stack blowout checking every time a ; process/task is switched out. This protective feature will not be ; available to programs that use funky methods of swapping stacks. ; ; This only works for processes, tasks are not eligible. ; ; Don't skimp on stack... you'll get burned. Any call to the dos.library, ; for example, takes just under 1600 bytes *minimum*. ; ;INPUTS ; newstack - Pointer to memory block for stack. Must be longword aligned. ; size - The size of the block. Must be an even multiple of 4 bytes. ; ;SEE ALSO ; AddTask(),AmigaLine6 |\ /| . Ack! (NAK, SOH, EOT) {o O} . bryce@hoser.berkeley.EDU -or- ucbvax!hoser!bryce (or try "cogsci") (") U "As an engineer, I only set the value of a product... not the cost." -Bryce Nesbitt