[haiku-development] Re: TLS init on ppc (was: [PATCH] Attempts to build haiku on linux/ppc)

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 02 Jun 2008 19:15:34 +0200 CEST

Konstantinos Margaritis <markos@xxxxxxxx> wrote:
> On Τρι 27 Μαι 2008, Ingo Weinhold wrote:
> > > But yeah at least the TLS init is not done as I saw.
> > A good deal of the userland support is missing. But the kernel init
> > has to take quite a few more steps after mounting the boot volume
> > before it even starts the init shell. So there are probably more
> > issues before the userland stuff becomes interesting.
> Ok, I was looking at the TLS code in
> src/system/libroot/os/arch/x86/tls.c to see how it works on x86 so
> that I would do the same thing on ppc. But my knowledge of x86 asm is
> close to nil, so I'd really like some help on that. Basically, what
> are the TLS functions supposed to do on x86?

TLS is supposed to give each thread a dedicated storage facility. You cannot
use the same method as the x86 version is using on PPC, though, as it works
by replacing the segments (the x86 assembler has several segment dependent
address registers) on each thread change.
It's been some time since I looked at PPC, but I guess you could implement it
by using one of the reserved registers for it (if there was such thing :-)).
The TLS area itself is part of the thread stack, and that can be kept for PPC as
well, I would guess.

Bye,
   Axel.


Other related posts: