public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: libc-ports@sourceware.org
Subject: [PATCH 09/10] alpha: Add tls-macros.h.
Date: Thu, 09 Feb 2012 04:35:00 -0000	[thread overview]
Message-ID: <1328761745-24481-10-git-send-email-rth@twiddle.net> (raw)
In-Reply-To: <1328761745-24481-1-git-send-email-rth@twiddle.net>

---
 ChangeLog.alpha            |    2 ++
 sysdeps/alpha/tls-macros.h |   25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)
 create mode 100644 sysdeps/alpha/tls-macros.h

diff --git a/ChangeLog.alpha b/ChangeLog.alpha
index 8ade582..804dd64 100644
--- a/ChangeLog.alpha
+++ b/ChangeLog.alpha
@@ -1,5 +1,7 @@
 2012-02-08  Richard Henderson  <rth@twiddle.net>
 
+	* sysdeps/alpha/tls-macros.h: New file.
+
 	* sysdeps/unix/sysv/linux/alpha/getitimer.S: Don't check HAVE_ELF.
 	* sysdeps/unix/sysv/linux/alpha/getrusage.S: Likewise.
 	* sysdeps/unix/sysv/linux/alpha/gettimeofday.S: Likewise.
diff --git a/sysdeps/alpha/tls-macros.h b/sysdeps/alpha/tls-macros.h
new file mode 100644
index 0000000..0385d93
--- /dev/null
+++ b/sysdeps/alpha/tls-macros.h
@@ -0,0 +1,25 @@
+/* Macros to support TLS testing in times of missing compiler support.  */
+
+extern void *__tls_get_addr (void *);
+
+# define TLS_GD(x)						\
+  ({ void *__result;						\
+     asm ("lda %0, " #x "($gp) !tlsgd" : "=r" (__result));	\
+     __tls_get_addr (__result); })
+
+# define TLS_LD(x)						\
+  ({ void *__result;						\
+     asm ("lda %0, " #x "($gp) !tlsldm" : "=r" (__result));	\
+     __result = __tls_get_addr (__result);			\
+     asm ("lda %0, " #x "(%0) !dtprel" : "+r" (__result));	\
+     __result; })
+
+# define TLS_IE(x)						\
+  ({ long ofs;							\
+     asm ("ldq %0, " #x "($gp) !gottprel" : "=r"(ofs));		\
+     __builtin_thread_pointer () + ofs; })
+
+# define TLS_LE(x)						\
+  ({ void *__result = __builtin_thread_pointer ();		\
+     asm ("lda %0, " #x "(%0) !tprel" : "+r" (__result));	\
+     __result; })
-- 
1.7.7.6

  parent reply	other threads:[~2012-02-09  4:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-09  4:29 [PATCH 00/10] Alpha compilation fixes Richard Henderson
2012-02-09  4:29 ` [PATCH 05/10] alpha: Eliminate set-but-not-used warnings with internal syscalls Richard Henderson
2012-02-09  4:29 ` [PATCH 03/10] alpha: Define TLS_DTV_UNALLOCATED Richard Henderson
2012-02-09  4:29 ` [PATCH 06/10] alpha: Convert to crt[in].S Richard Henderson
2012-02-09  4:29 ` [PATCH 02/10] alpha: Require kernel version 2.6.0 Richard Henderson
2012-02-09  4:29 ` [PATCH 04/10] alpha: Define _STAT_VER_LINUX Richard Henderson
2012-02-09 17:52   ` Richard Henderson
2012-02-13  2:43     ` Carlos O'Donell
2012-02-09  4:29 ` [PATCH 01/10] alpha: Remove HAVE_TLS_SUPPORT and HAVE___THREAD tests Richard Henderson
2012-02-09  4:35 ` [PATCH 08/10] alpha: Remove HAVE_ELF tests Richard Henderson
2012-02-09  4:35 ` Richard Henderson [this message]
2012-02-09  4:35 ` [PATCH 10/10] alpha: Add ldsodefs.h and tst-audit.h Richard Henderson
2012-02-09  4:36 ` [PATCH 07/10] alpha: Support __NR_fstatat64 Richard Henderson
2012-02-09 19:04 ` [PATCH 00/10] Alpha compilation fixes Roland McGrath

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1328761745-24481-10-git-send-email-rth@twiddle.net \
    --to=rth@twiddle.net \
    --cc=libc-ports@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).