|
From: Nicholas N. <nj...@ca...> - 2004-08-18 16:11:24
|
Hi,
I'm confused about ThreadState.tls. The field declaration in the
ThreadState type (vg_include.h) looks like:
/* TLS table. This consists of a small number (currently 3) of
entries from the Global Descriptor Table. */
VgLdtEntry tls[VKI_GDT_TLS_ENTRIES];
but in vg_scheduler.c everywhere .tls is treated like a single word,
rather than an array of multiple elements.
eg. in load_thread_state():
VG_(baseBlock)[VGOFF_(tls)] = (UInt)VG_(threads)[tid].tls;
Is this buggy, or am I missing something?
N
|
|
From: Nicholas N. <nj...@ca...> - 2004-08-18 16:32:27
|
On Wed, 18 Aug 2004, Tom Hughes wrote: > The trick you're missing is that VG_(threads)[tid].tls is effectively > a pointer to the three TLS descriptors - it is only that pointer which > is held in the base block, not the actual TLS descriptors themselves > as they are quite large. Right... then I think VGOFF_(tls) should be renamed VGOFF_(tls_ptr) or VGOFF_(tls_array_ptr) to make this clear. Anyone disagree? N |
|
From: Tom H. <th...@cy...> - 2004-08-18 16:35:21
|
In message <Pin...@he...>
Nicholas Nethercote <nj...@ca...> wrote:
> On Wed, 18 Aug 2004, Tom Hughes wrote:
>
>> The trick you're missing is that VG_(threads)[tid].tls is effectively
>> a pointer to the three TLS descriptors - it is only that pointer which
>> is held in the base block, not the actual TLS descriptors themselves
>> as they are quite large.
>
> Right... then I think VGOFF_(tls) should be renamed VGOFF_(tls_ptr) or
> VGOFF_(tls_array_ptr) to make this clear. Anyone disagree?
Fine by me.
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|