pthreads-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pthreads-hackers] threadvar and non-fixed size stacks


From: Johan Rydberg
Subject: Re: [Pthreads-hackers] threadvar and non-fixed size stacks
Date: Wed, 30 Jan 2002 21:31:01 +0100

On 2002.01.30 21:11 Jeroen Dekkers wrote:
: On Wed, Jan 30, 2002 at 06:21:06PM +0100, Johan Rydberg wrote:

: We use a thread-specific register for that. On the ia32 architecture,
: that means we use the segment register gs. When we are setting up the
: stack, we load the register with the address of the TSD (Thread
: Specific Data)(see sysdeps/mach/hurd/i386/init-first.c). Then
: __hurd_threadvar_location() just uses %gs to calculate the
: address (see hurd/hurd/threadvar.h). Note however that this
: implementation is not totally finished yet and it's untested.

What to do on host operating systems that do not permit that the
user add or modify segments (in the ia32 case)?

The code:

__asm__ __volatile__ ("lea %%gs:(,%1,4),%0"
                      :"=r" (var)
                      :"r" (__index));

Is this really valid code? I mean, does it really add the base offset
of the segment?  Hmm.  Where the hell are my ia32 books!

: It's nice to hear people are reading the code. Don't hesitate to send
: any comments/patches. :)

:)

--
Johan Rydberg

$ ON F$ERROR("LANGUAGE","ENGLISH","IN_MESSAGE").GT.F$ERROR("NORMAL") -
             THEN EXCUSE/OBJECT=ME


reply via email to

[Prev in Thread] Current Thread [Next in Thread]