From 7988979a722b4cdf287b2093956a76a3f19b9897 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Mon, 24 Oct 2016 20:22:12 +0200 Subject: add uClibc-ng test directory --- test/tls/tls-macros-alpha.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/tls/tls-macros-alpha.h (limited to 'test/tls/tls-macros-alpha.h') diff --git a/test/tls/tls-macros-alpha.h b/test/tls/tls-macros-alpha.h new file mode 100644 index 0000000..78820ec --- /dev/null +++ b/test/tls/tls-macros-alpha.h @@ -0,0 +1,25 @@ +register void *__gp __asm__("$29"); + +# define TLS_LE(x) \ + ({ int *__l; \ + __asm__ ("call_pal 158\n\tlda $0," #x "($0)\t\t!tprel" : "=v"(__l)); \ + __l; }) + +# define TLS_IE(x) \ + ({ char *__tp; unsigned long __o; \ + __asm__ ("call_pal 158\n\tldq %1," #x "($gp)\t\t!gottprel" \ + : "=v"(__tp), "=r"(__o) : "r"(__gp)); \ + (int *)(__tp + __o); }) + +# define TLS_LD(x) \ + ({ extern void *__tls_get_addr(void *); int *__l; void *__i; \ + __asm__ ("lda %0," #x "($gp)\t\t!tlsldm" : "=r" (__i) : "r"(__gp)); \ + __i = __tls_get_addr(__i); \ + __asm__ ("lda %0, " #x "(%1)\t\t!dtprel" : "=r"(__l) : "r"(__i)); \ + __l; }) + +# define TLS_GD(x) \ + ({ extern void *__tls_get_addr(void *); void *__i; \ + __asm__ ("lda %0," #x "($gp)\t\t!tlsgd" : "=r" (__i) : "r"(__gp)); \ + (int *) __tls_get_addr(__i); }) + -- cgit v1.2.3