mirror of
git://sourceware.org/git/glibc.git
synced 2025-01-30 12:31:53 +08:00
2004-09-02 Roland McGrath <roland@redhat.com>
* sysdeps/mach/hurd/i386/tls.h (TLS_INIT_TP_EXPENSIVE): New macro. (INSTALL_NEW_DTV, THREAD_DTV): Rewritten to fetch the right word. (THREAD_SELF): New macro.
This commit is contained in:
parent
f76c849910
commit
0544677016
@ -1,5 +1,5 @@
|
|||||||
/* Definitions for thread-local data handling. Hurd/i386 version.
|
/* Definitions for thread-local data handling. Hurd/i386 version.
|
||||||
Copyright (C) 2003 Free Software Foundation, Inc.
|
Copyright (C) 2003, 2004 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -113,14 +113,25 @@ _hurd_tls_init (tcbhead_t *tcb, int secondcall)
|
|||||||
operation can cause a failure 'errno' must not be touched. */
|
operation can cause a failure 'errno' must not be touched. */
|
||||||
# define TLS_INIT_TP(descr, secondcall) \
|
# define TLS_INIT_TP(descr, secondcall) \
|
||||||
_hurd_tls_init ((tcbhead_t *) (descr), (secondcall))
|
_hurd_tls_init ((tcbhead_t *) (descr), (secondcall))
|
||||||
|
# define TLS_INIT_TP_EXPENSIVE 1
|
||||||
|
|
||||||
|
/* Return the TCB address of the current thread. */
|
||||||
|
# define THREAD_SELF \
|
||||||
|
({ tcbhead_t *__tcb;
|
||||||
|
__asm__ ("movl %%gs:%c1,%0" : "=r" (__tcb) \
|
||||||
|
: "i" (offsetof (tcbhead_t, tcb))); \
|
||||||
|
__tcb;})
|
||||||
|
|
||||||
/* Install new dtv for current thread. */
|
/* Install new dtv for current thread. */
|
||||||
# define INSTALL_NEW_DTV(dtv) \
|
# define INSTALL_NEW_DTV(dtvp) \
|
||||||
({ __asm__ ("movl %0, %%gs:0" : : "r" (dtv)); })
|
({ asm volatile ("movl %0,%%gs:%P1"
|
||||||
|
: : "ir" (dtvp), "i" (offsetof (tcbhead_t, dtv))); })
|
||||||
|
|
||||||
/* Return the address of the dtv for the current thread. */
|
/* Return the address of the dtv for the current thread. */
|
||||||
# define THREAD_DTV() \
|
# define THREAD_DTV() \
|
||||||
({ void *_dtv; __asm__ ("movl %%gs:0, %0" : "=r" (_dtv)); _dtv; })
|
({ void *_dtv;
|
||||||
|
asm ("movl %%gs:%P1,%0" : "=q" (_dtv) : "i" (offsetof (tcbhead_t, dtv)));
|
||||||
|
_dtv; })
|
||||||
|
|
||||||
# endif /* !ASSEMBLER */
|
# endif /* !ASSEMBLER */
|
||||||
#endif /* HAVE_TLS_SUPPORT */
|
#endif /* HAVE_TLS_SUPPORT */
|
||||||
|
Loading…
Reference in New Issue
Block a user