mirror of git://sourceware.org/git/glibc.git
hurd: Fix coding style
This commit is contained in:
parent
c2fb08c78a
commit
6dbe9dcae5
|
|
@ -180,7 +180,7 @@ _hurd_critical_section_lock (void)
|
||||||
struct hurd_sigstate *ss;
|
struct hurd_sigstate *ss;
|
||||||
|
|
||||||
#ifdef __LIBC_NO_TLS
|
#ifdef __LIBC_NO_TLS
|
||||||
if (__LIBC_NO_TLS())
|
if (__LIBC_NO_TLS ())
|
||||||
/* TLS is currently initializing, no need to enter critical section. */
|
/* TLS is currently initializing, no need to enter critical section. */
|
||||||
return NULL;
|
return NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,6 @@ extern mach_port_t __hurd_reply_port0;
|
||||||
|
|
||||||
/* This returns either the TLS reply port variable, or a single-thread variable
|
/* This returns either the TLS reply port variable, or a single-thread variable
|
||||||
when TLS is not initialized yet. */
|
when TLS is not initialized yet. */
|
||||||
#define __hurd_local_reply_port (*(__LIBC_NO_TLS() ? &__hurd_reply_port0 : &THREAD_SELF->reply_port))
|
#define __hurd_local_reply_port (*(__LIBC_NO_TLS () ? &__hurd_reply_port0 : &THREAD_SELF->reply_port))
|
||||||
|
|
||||||
#endif /* hurd/threadvar.h */
|
#endif /* hurd/threadvar.h */
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ __mach_setup_thread (task_t task, thread_t thread, void *pc,
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
tcb = _dl_allocate_tls(NULL);
|
tcb = _dl_allocate_tls (NULL);
|
||||||
if (tcb == NULL)
|
if (tcb == NULL)
|
||||||
return KERN_RESOURCE_SHORTAGE;
|
return KERN_RESOURCE_SHORTAGE;
|
||||||
|
|
||||||
|
|
@ -87,7 +87,7 @@ __mach_setup_thread (task_t task, thread_t thread, void *pc,
|
||||||
return error;
|
return error;
|
||||||
assert (tssize == MACHINE_THREAD_STATE_COUNT);
|
assert (tssize == MACHINE_THREAD_STATE_COUNT);
|
||||||
|
|
||||||
_hurd_tls_new(thread, &ts, tcb);
|
_hurd_tls_new (thread, &ts, tcb);
|
||||||
|
|
||||||
error = __thread_set_state (thread, MACHINE_THREAD_STATE_FLAVOR,
|
error = __thread_set_state (thread, MACHINE_THREAD_STATE_FLAVOR,
|
||||||
(natural_t *) &ts, tssize);
|
(natural_t *) &ts, tssize);
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ typedef struct
|
||||||
#define __LIBC_NO_TLS() \
|
#define __LIBC_NO_TLS() \
|
||||||
({ unsigned short ds, gs; \
|
({ unsigned short ds, gs; \
|
||||||
asm ("movw %%ds,%w0; movw %%gs,%w1" : "=q" (ds), "=q" (gs)); \
|
asm ("movw %%ds,%w0; movw %%gs,%w1" : "=q" (ds), "=q" (gs)); \
|
||||||
__builtin_expect(ds == gs, 0); })
|
__builtin_expect (ds == gs, 0); })
|
||||||
|
|
||||||
/* The TCB can have any size and the memory following the address the
|
/* The TCB can have any size and the memory following the address the
|
||||||
thread pointer points to is unspecified. Allocate the TCB there. */
|
thread pointer points to is unspecified. Allocate the TCB there. */
|
||||||
|
|
@ -105,7 +105,7 @@ typedef struct
|
||||||
| (((unsigned int) (tcb)) & 0xff000000) /* base 24..31 */ \
|
| (((unsigned int) (tcb)) & 0xff000000) /* base 24..31 */ \
|
||||||
}
|
}
|
||||||
|
|
||||||
# define HURD_SEL_LDT(sel) (__builtin_expect((sel) & 4, 0))
|
# define HURD_SEL_LDT(sel) (__builtin_expect ((sel) & 4, 0))
|
||||||
|
|
||||||
static inline const char * __attribute__ ((unused))
|
static inline const char * __attribute__ ((unused))
|
||||||
_hurd_tls_init (tcbhead_t *tcb)
|
_hurd_tls_init (tcbhead_t *tcb)
|
||||||
|
|
@ -163,13 +163,13 @@ _hurd_tls_init (tcbhead_t *tcb)
|
||||||
struct descriptor __desc, *___desc = &__desc; \
|
struct descriptor __desc, *___desc = &__desc; \
|
||||||
unsigned int __count = 1; \
|
unsigned int __count = 1; \
|
||||||
kern_return_t __err; \
|
kern_return_t __err; \
|
||||||
if (HURD_SEL_LDT(__sel)) \
|
if (HURD_SEL_LDT (__sel)) \
|
||||||
__err = __i386_get_ldt ((thread), __sel, 1, &___desc, &__count); \
|
__err = __i386_get_ldt ((thread), __sel, 1, &___desc, &__count); \
|
||||||
else \
|
else \
|
||||||
__err = __i386_get_gdt ((thread), __sel, &__desc); \
|
__err = __i386_get_gdt ((thread), __sel, &__desc); \
|
||||||
assert_perror (__err); \
|
assert_perror (__err); \
|
||||||
assert (__count == 1); \
|
assert (__count == 1); \
|
||||||
HURD_DESC_TLS(___desc);})
|
HURD_DESC_TLS (___desc);})
|
||||||
|
|
||||||
/* Install new dtv for current thread. */
|
/* Install new dtv for current thread. */
|
||||||
# define INSTALL_NEW_DTV(dtvp) \
|
# define INSTALL_NEW_DTV(dtvp) \
|
||||||
|
|
@ -198,7 +198,7 @@ _hurd_tls_fork (thread_t child, thread_t orig, struct i386_thread_state *state)
|
||||||
error_t err;
|
error_t err;
|
||||||
unsigned int count = 1;
|
unsigned int count = 1;
|
||||||
|
|
||||||
if (HURD_SEL_LDT(sel))
|
if (HURD_SEL_LDT (sel))
|
||||||
err = __i386_get_ldt (orig, sel, 1, &_desc, &count);
|
err = __i386_get_ldt (orig, sel, 1, &_desc, &count);
|
||||||
else
|
else
|
||||||
err = __i386_get_gdt (orig, sel, &desc);
|
err = __i386_get_gdt (orig, sel, &desc);
|
||||||
|
|
@ -207,7 +207,7 @@ _hurd_tls_fork (thread_t child, thread_t orig, struct i386_thread_state *state)
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
if (HURD_SEL_LDT(sel))
|
if (HURD_SEL_LDT (sel))
|
||||||
err = __i386_set_ldt (child, sel, &desc, 1);
|
err = __i386_set_ldt (child, sel, &desc, 1);
|
||||||
else
|
else
|
||||||
err = __i386_set_gdt (child, &sel, desc);
|
err = __i386_set_gdt (child, &sel, desc);
|
||||||
|
|
@ -231,7 +231,7 @@ _hurd_tls_new (thread_t child, struct i386_thread_state *state, tcbhead_t *tcb)
|
||||||
tcb->tcb = tcb;
|
tcb->tcb = tcb;
|
||||||
tcb->self = child;
|
tcb->self = child;
|
||||||
|
|
||||||
if (HURD_SEL_LDT(sel))
|
if (HURD_SEL_LDT (sel))
|
||||||
err = __i386_set_ldt (child, sel, &desc, 1);
|
err = __i386_set_ldt (child, sel, &desc, 1);
|
||||||
else
|
else
|
||||||
err = __i386_set_gdt (child, &sel, desc);
|
err = __i386_set_gdt (child, &sel, desc);
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ typedef struct
|
||||||
typedef __libc_lock_recursive_t __rtld_lock_recursive_t;
|
typedef __libc_lock_recursive_t __rtld_lock_recursive_t;
|
||||||
|
|
||||||
extern char __libc_lock_self0[0];
|
extern char __libc_lock_self0[0];
|
||||||
#define __libc_lock_owner_self() (__LIBC_NO_TLS() ? &__libc_lock_self0 : THREAD_SELF)
|
#define __libc_lock_owner_self() (__LIBC_NO_TLS () ? &__libc_lock_self0 : THREAD_SELF)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
typedef struct __libc_lock_opaque__ __libc_lock_t;
|
typedef struct __libc_lock_opaque__ __libc_lock_t;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue