diff options
| author | Igor Pashev <pashev.igor@gmail.com> | 2013-05-26 16:30:04 +0400 |
|---|---|---|
| committer | Igor Pashev <pashev.igor@gmail.com> | 2013-05-26 16:30:04 +0400 |
| commit | 9e7de43842f8020845fc09bfd279c6f6b130dab1 (patch) | |
| tree | bc9c71c38d78ed61fc725802d4562a019bb2ea1b /nptl/sysdeps/unix/sysv/solaris2 | |
| parent | 191b3c0874c83e1bd99e229537da208b0cbd5096 (diff) | |
| download | glibc-9e7de43842f8020845fc09bfd279c6f6b130dab1.tar.gz | |
New file .../.../kopensolaris-gnu/x86_64/tls.h
Copied from kopensolaris-gnu/i386 with removing INIT_SYSINFO
Diffstat (limited to 'nptl/sysdeps/unix/sysv/solaris2')
| -rw-r--r-- | nptl/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/x86_64/tls.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/nptl/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/x86_64/tls.h b/nptl/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/x86_64/tls.h new file mode 100644 index 0000000000..83c032bb3c --- /dev/null +++ b/nptl/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/x86_64/tls.h @@ -0,0 +1,59 @@ +/* Definition for thread-local data handling. OpenSolaris/i386 version. + Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. + This file is part of the GNU C Library. + OpenSolaris bits contributed by David Bartley + <dtbartle@csclub.uwaterloo.ca>, 2008. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#ifndef _OPENSOLARIS_TLS_H +#define _OPENSOLARIS_TLS_H 1 + +/* __thread doesn't work for statically-linked executables. */ +#if !defined (SHARED) +# undef HAVE___THREAD +#endif + +/* We can use most of the code from the nptl tls.h. */ +#include_next <tls.h> + +#ifndef __ASSEMBLER__ + +/* OpenSolaris has lwp_private in order to set the thread data. */ +# include <sys/lwp.h> +# include <sys/syscall.h> + +# undef TLS_INIT_TP +# define TLS_INIT_TP(thrdescr, secondcall) \ + ({ void *_thrdescr = (thrdescr); \ + tcbhead_t *_head = _thrdescr; \ + sysret_t ret; \ + \ + _head->tcb = _thrdescr; \ + /* For now the thread descriptor is at the same address. */ \ + _head->self = _thrdescr; \ + \ + (__systemcall (&ret, SYS_lwp_private, _LWP_SETPRIVATE, _LWP_GSBASE, \ + (uintptr_t)_thrdescr) != 0) \ + ? "lwp_private failed when setting up thread-local storage\n" : NULL; \ + }) + +/* TODO: Figure out what to define this as. */ +# undef DB_THREAD_SELF + +# endif /* __ASSEMBLER__ */ + +#endif /* _OPENSOLARIS_TLS_H */ |
