Hi,
        I still don't understand what stack copy is. How do you know how much 
stack 
to copy? What about allocating  4kb stack for every thread and only changing 
the register that points to the stack (it is probably a7 not a5 sorry). The 
problem might be that ErrSetjump uses the same buffer for the registers thus 
not allowing for nested set?

regards,
        Miro Pomsar


On Wednesday 20 April 2005 17:03, Zakai Hamilton wrote:
> OK... I am writing an environment for PalmOS and because its very module
> oriented, I wanted Cooperative multitasking using ErrSetJump and
> ErrLongJump and storing/restoring stacks via dynamic memory. Its a long
> story and I will post it once it works but I am stuck on writing the saved
> stack back to the real stack.
>
> The idea is that after I use ErrLongJump to jump to the yield function to
> continue the code, I want to restore the stack that was saved previously in
> the yield before I used ErrSetJump there.
>
> The funny thing is that I can save and restore a stack if I do the Save and
> then the Restore function one after each other but I cannot Save in one
> place and Restore in another if ErrSetJump and ErrLongJump happens
> inbetween. Any ideas why that would happen? (I get the "run68k.c,
> Line:4425, Unhandled instr" error when it tries to use MemMove to copy from
> the saved stack to the real stack).
>
> Note that the copying code is fine... otherwise I wouldnt able to Save to
> the stack and then Restore from the stack. The problem is when I save the
> stack in one place of execution and restore it at another location.

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/

Reply via email to