This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: {make,set,swap}context broken on powerpc32


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]