diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2015-02-08 19:37:57 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2015-02-08 19:37:57 +0100 |
commit | 5eb8bf00737bafdeb78b0df2688876f538d74857 (patch) | |
tree | f9b8e49d66f3d2bb4819108867ca4b852de49bef /sysdeps/mach | |
parent | db4857c035a52a01f337a8ef6fe70ac08ad66ad5 (diff) |
Address some of Roland McGrath comments
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 8bf5656f26..6850f198cd 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> #include <hurd/threadvar.h> diff --git a/sysdeps/mach/hurd/i386/init-first.c b/sysdeps/mach/hurd/i386/init-first.c index 74b3a5693c..db9c69f3b2 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; @@ -201,8 +199,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 88baeeb3d8..e6ede35a7e 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> @@ -94,7 +96,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 (tcb->self, sel, &desc, 1); assert_perror (err); @@ -153,7 +155,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); @@ -162,7 +164,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); @@ -186,7 +188,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 2e08af2e2d..f7323f7139 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 |