Back to index

glibc  2.9
Defines
createthread.c File Reference
#include <nptl/sysdeps/pthread/createthread.c>

Go to the source code of this file.

Defines

#define PREPARE_CREATE
#define TLS_VALUE   &desc.desc

Define Documentation

#define PREPARE_CREATE
Value:
union user_desc_init desc;                                           \
                                                                     \
  /* Describe the thread-local storage segment.  */                         \
                                                                     \
  /* The 'entry_number' field.  The first three bits of the segment         \
     register value select the GDT, ignore them.  We get the index          \
     from the value of the %gs register in the current thread.  */          \
  desc.vals[0] = TLS_GET_GS () >> 3;                                        \
  /* The 'base_addr' field.  Pointer to the TCB.  */                        \
  desc.vals[1] = (unsigned long int) pd;                             \
  /* The 'limit' field.  We use 4GB which is 0xfffff pages.  */                    \
  desc.vals[2] = 0xfffff;                                            \
  /* Collapsed value of the bitfield:                                       \
       .seg_32bit = 1                                                       \
       .contents = 0                                                 \
       .read_exec_only = 0                                           \
       .limit_in_pages = 1                                           \
       .seg_not_present = 0                                          \
       .useable = 1 */                                                      \
  desc.vals[3] = 0x51

Definition at line 22 of file createthread.c.

#define TLS_VALUE   &desc.desc

Definition at line 37 of file createthread.c.