diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2015-03-25 02:33:38 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2015-03-25 02:33:38 +0100 |
commit | 9ca47fe88f480d0137356e82f5ad12f0ca65f399 (patch) | |
tree | 49cd894aa49b072ab95a3005122b4d92efad9586 /sysdeps/mach | |
parent | 189754f96136b0122d286d90de97026e9505fd74 (diff) | |
parent | 5eb8bf00737bafdeb78b0df2688876f538d74857 (diff) |
Merge branch 't/tls' into refs/top-bases/tschwinge/Roger_Whittaker
Diffstat (limited to 'sysdeps/mach')
-rw-r--r-- | sysdeps/mach/hurd/bits/libc-lock.h | 6 | ||||
-rw-r--r-- | sysdeps/mach/hurd/i386/init-first.c | 8 | ||||
-rw-r--r-- | sysdeps/mach/hurd/i386/tls.h | 10 | ||||
-rw-r--r-- | sysdeps/mach/thread_state.h | 2 |
4 files changed, 13 insertions, 13 deletions
diff --git a/sysdeps/mach/hurd/bits/libc-lock.h b/sysdeps/mach/hurd/bits/libc-lock.h index a0f83728e4..0a7fb0bf8c 100644 --- a/sysdeps/mach/hurd/bits/libc-lock.h +++ b/sysdeps/mach/hurd/bits/libc-lock.h @@ -20,9 +20,9 @@ #define _BITS_LIBC_LOCK_H 1 #if (_LIBC - 0) || (_CTHREADS_ - 0) -#if (_LIBC - 0) -#include <tls.h> -#endif +# if (_LIBC - 0) +# include <tls.h> +# endif #include <cthreads.h> typedef struct mutex __libc_lock_t; diff --git a/sysdeps/mach/hurd/i386/init-first.c b/sysdeps/mach/hurd/i386/init-first.c index 1a587dcc8d..064561a63d 100644 --- a/sysdeps/mach/hurd/i386/init-first.c +++ b/sysdeps/mach/hurd/i386/init-first.c @@ -112,9 +112,7 @@ init1 (int argc, char *arg0, ...) then after the environment pointers there is no Hurd data block; the argument strings start there. */ if ((void *) d == argv[0]) - { - return; - } + return; #ifndef SHARED __libc_enable_secure = d->flags & EXEC_SECURE; @@ -192,8 +190,8 @@ init (int *data) assert (d->phdrsz % sizeof (ElfW(Phdr)) == 0); } - /* We need to setup TLS before starting sigthread */ - extern void __pthread_initialize_minimal(void); + /* We need to setup TLS before starting the signal thread. */ + extern void __pthread_initialize_minimal (void); __pthread_initialize_minimal (); #endif diff --git a/sysdeps/mach/hurd/i386/tls.h b/sysdeps/mach/hurd/i386/tls.h index 1b6fe67af2..3fc3e2cfaa 100644 --- a/sysdeps/mach/hurd/i386/tls.h +++ b/sysdeps/mach/hurd/i386/tls.h @@ -37,6 +37,8 @@ # define __i386_set_gdt(thr, sel, desc) ((void) (thr), (void) (sel), (void) (desc), MIG_BAD_ID) # endif +#define __i386_selector_is_ldt(sel) (!!((sel) & 4)) + # include <errno.h> # include <assert.h> @@ -108,7 +110,7 @@ _hurd_tls_init (tcbhead_t *tcb, int secondcall) /* Fetch the selector set by the first call. */ int sel; asm ("mov %%gs, %w0" : "=q" (sel) : "0" (0)); - if (__builtin_expect (sel, 0x48) & 4) /* LDT selector */ + if (__glibc_unlikely (__i386_selector_is_ldt(sel))) { kern_return_t err = __i386_set_ldt (self, sel, &desc, 1); assert_perror (err); @@ -189,7 +191,7 @@ _hurd_tls_fork (thread_t child, thread_t orig, struct i386_thread_state *state) kern_return_t err; unsigned int count = 1; - if (__builtin_expect (sel, 0x48) & 4) /* LDT selector */ + if (__glibc_unlikely (__i386_selector_is_ldt(sel))) err = __i386_get_ldt (orig, sel, 1, &_desc, &count); else err = __i386_get_gdt (orig, sel, &desc); @@ -198,7 +200,7 @@ _hurd_tls_fork (thread_t child, thread_t orig, struct i386_thread_state *state) if (err) return err; - if (__builtin_expect (sel, 0x48) & 4) /* LDT selector */ + if (__glibc_unlikely (__i386_selector_is_ldt(sel))) err = __i386_set_ldt (child, sel, &desc, 1); else err = __i386_set_gdt (child, &sel, desc); @@ -222,7 +224,7 @@ _hurd_tls_new (thread_t child, struct i386_thread_state *state, tcbhead_t *tcb) tcb->tcb = tcb; tcb->self = child; - if (__builtin_expect (sel, 0x48) & 4) /* LDT selector */ + if (__glibc_unlikely (__i386_selector_is_ldt(sel))) err = __i386_set_ldt (child, sel, &desc, 1); else err = __i386_set_gdt (child, &sel, desc); diff --git a/sysdeps/mach/thread_state.h b/sysdeps/mach/thread_state.h index 357c8bfbea..a6d3634070 100644 --- a/sysdeps/mach/thread_state.h +++ b/sysdeps/mach/thread_state.h @@ -38,7 +38,7 @@ #endif #endif #ifndef MACHINE_THREAD_STATE_FIX_NEW -#define MACHINE_THREAD_STATE_FIX_NEW(ts) +# define MACHINE_THREAD_STATE_FIX_NEW(ts) #endif /* These functions are of use in machine-dependent signal trampoline |