This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: {make,set,swap}context broken on powerpc32
- From: Daniel Jacobowitz <drow at false dot org>
- To: Steven Munroe <munroesj at us dot ibm dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, libc-alpha at sources dot redhat dot com, Paul Mackerras <paulus at samba dot org>, Peter Bergner <bergner at us dot ibm dot com>
- Date: Tue, 12 Dec 2006 20:24:47 -0500
- Subject: Re: {make,set,swap}context broken on powerpc32
- References: <20061212130526.GC29911@devserv.devel.redhat.com> <457F2A36.2090209@us.ibm.com>
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