diff options
Diffstat (limited to 'test/tls')
-rw-r--r-- | test/tls/Makefile.in | 4 | ||||
-rw-r--r-- | test/tls/tls-macros.h | 37 |
2 files changed, 41 insertions, 0 deletions
diff --git a/test/tls/Makefile.in b/test/tls/Makefile.in index 7ab4e2ad3..0a9833757 100644 --- a/test/tls/Makefile.in +++ b/test/tls/Makefile.in @@ -12,6 +12,10 @@ ifeq ($(HAVE_SHARED),) TESTS_DISABLED := $(TESTS) endif +ifeq ($(TARGET_ARCH),arc) +TESTS_DISABLED += tst-tls12 tst-tls-at-ctor +endif + # All these tests need tls.h, which is not installed with glibc GLIBC_TESTS_DISABLED := $(addsuffix _glibc,$(filter-out $(TESTS_DISABLED),$(TESTS))) diff --git a/test/tls/tls-macros.h b/test/tls/tls-macros.h index 2787809f5..a41aef688 100644 --- a/test/tls/tls-macros.h +++ b/test/tls/tls-macros.h @@ -885,6 +885,43 @@ register void *__gp __asm__("$29"); : "=&r" (__result) : "r" (tp)); \ __result; }) +#elif defined __xtensa__ + +#define TLS_GD(x) \ + ({ int *__l; \ + __asm__ ("movi a8, " #x "@TLSFUNC\n\t" \ + "movi a10, " #x "@TLSARG\n\t" \ + "callx8.tls a8, " #x "@TLSCALL\n\t" \ + "mov %0, a10\n\t" \ + : "=r" (__l) \ + : \ + : "a8", "a9", "a10", "a11", "a12", "a13", "a14", "a15"); \ + __l; }) + +#define TLS_LD(x) \ + ({ int *__l; \ + __asm__ ("movi a8, " #x "@TLSFUNC\n\t" \ + "movi a10, " #x "@TLSARG\n\t" \ + "callx8.tls a8, " #x "@TLSCALL\n\t" \ + "movi %0, " #x "@TPOFF\n\t" \ + "add %0, %0, a10\n\t" \ + : "=r" (__l) \ + : \ + : "a8", "a9", "a10", "a11", "a12", "a13", "a14", "a15"); \ + __l; }) + +#define TLS_IE(x) TLS_LE(x) + +#define TLS_LE(x) \ + ({ int *__l; \ + int __t; \ + __asm__ ("rur %0, threadptr\n\t" \ + "movi %1, " #x "@TPOFF\n\t" \ + "add %0, %0, %1\n\t" \ + : "=r" (__l), "=r" (__t) ); \ + __l; }); \ + + #elif !defined TLS_LE || !defined TLS_IE \ || !defined TLS_LD || !defined TLS_GD # error "No support for this architecture so far." |