[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: [RFC][PATCH] _UC_TLSBASE for all ports
Martin Husemann <martin%duskware.de@localhost> wrote:
> However, for a dummie like me who hasn't seen the code in question, could
> you please explain how they handle the stack pointer in the context?
- get current ucontext_t wht getcontext();
- allocate a stack with malloc(), add it to ucontext_t (uc_stack field)
- call makecontext() to set the target function and argument
- call swapcontext()
swapcontext(3) uses setcontext(2), which setup the stack pointer
according to what has been specified in ucontext_t. As far as I
understand, setcontext(2) offers an MI interface and takes care of the
MD problems, included those related to the stack.
Main Index |
Thread Index |