{make,set,swap}context broken on powerpc32
Daniel Jacobowitz
drow@false.org
Wed Dec 13 01:31:00 GMT 2006
On Tue, Dec 12, 2006 at 04:16:22PM -0600, Steven Munroe wrote:
> >One thing is that swapcontext syscall restores r2 (for 32-bit processes)
> >from the saved registers. As it is used by swapcontext and setcontext
> >syscalls, that in itself is a problem - can't you getcontext in one
> >thread and setcontext in another one?
> >
>
> The getcontext/setcontext context is more like a coroutine call and can
> not (should not) change the thread pointer (or the thread struct or the
> kernels internal thread). So it is more like a N to M thread model.
If you getcontext in one thread and setcontext in another, even if you
leave r2 alone, aren't you going to have other subtler problems? I
doubt GCC expects function calls to clobber the address of __thread
variables.
--
Daniel Jacobowitz
CodeSourcery
More information about the Libc-alpha
mailing list