Josh DuBois wrote:
> 
>    My first question to the group is: does anyone know of a good place
> to put the TEB thread-info structures on the PPC architecture?  On Intel
> they get stored in the fs register, and on non-intel sparc there's some
> thread-local storage pointer the OS gives you.  It _looks_ like
> linuxthreads for PPC puts all its thread info in a big list, so that's
> what I've done (in a hacky way) for linuxppc.  I feel like it should
> change eventually, though (I'm just shooting for something that works
> for the time being) because finding the current thread means getting a
> pointer you think is on the stack and then searching the whole list for
> a TEB with a stack that could contain that pointer.  Seems slow.
> 
>    Does anyone know of a really _good_ place to put these on the PPC?
> 
>    Looking at a ppc manual I see some general purpose registers -
> spg0-spg3 that are reserved for OS use, but I assume there's no way for
> a user-level program to set them under linux?

Is there really any reason not to just use pthread directly?  We're 
not constrained by binary compatability issues on LinuxPPC (or MacOS X), 
so there's no need to preserve any special registers.

Of course, as I'm writing this I'm trying to remember why I didn't try
this out at MacHack this year when I tried to update the PPC port.  I 
remember going through the same process of trying to find a register that
I could be sure was preserved across library calls, and even consulted
Stan Shebs (one of the gcc PPC developers).  I couldn't find anything 
that seemed appropriate in time, so I just gave up.  I have no recollection
whether using pthreads' local storage even occured to me then.

Also, if you're interested I can send you my original WINE PPC port, circa 
March 99.  I think that I just hacked out any threading at all for that
try.  The only thing that might be of more than curiosity value in it is 
a fix somewhere in the event handling code to byteswap the x,y location 
from a mouse click....

 -Gav

-- 
Gavriel State
CEO
TransGaming Technologies Inc.
[EMAIL PROTECTED]

Reply via email to