summaryrefslogtreecommitdiff
path: root/test/tls/tls-macros.h
blob: 0300dbaec200b646fc937f57adcfbe37f76f1712 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/* Macros to support TLS testing in times of missing compiler support.  */

#define COMMON_INT_DEF(x) \
  __asm__ (".tls_common " #x ",4,4")
/* XXX Until we get compiler support we don't need declarations.  */
#define COMMON_INT_DECL(x)

/* XXX This definition will probably be machine specific, too.  */
#define VAR_INT_DEF(x) \
  __asm__ (".section .tdata\n\t"						      \
       ".globl " #x "\n"						      \
       ".balign 4\n"							      \
       #x ":\t.long 0\n\t"						      \
       ".size " #x ",4\n\t"						      \
       ".previous")
/* XXX Until we get compiler support we don't need declarations.  */
#define VAR_INT_DECL(x)

#ifdef __alpha__
#include <tls-macros-alpha.h>
#endif

#ifdef __arc__
#include <tls-macros-arc.h>
#endif

#ifdef __arm__
#ifdef __thumb__
#include <tls-macros-thumb.h>
#else
#include <tls-macros-arm.h>
#endif
#endif

#ifdef __i386__
#include <tls-macros-i386.h>
#endif

#ifdef __ia64__
#include <tls-macros-ia64.h>
#endif

#ifdef __metag__
#include <tls-macros-metag.h>
#endif

#ifdef __mips__
#include <tls-macros-mips.h>
#endif

#ifdef __powerpc__
#include <tls-macros-powerpc.h>
#endif

#ifdef __sh__
#include <tls-macros-sh.h>
#endif

#ifdef __sparc__
#include <tls-macros-sparc.h>
#endif

#ifdef __x86_64__
#include <tls-macros-x86_64.h>
#endif

#ifdef __xtensa__
#include <tls-macros-xtensa.h>
#endif

#if !defined TLS_LE || !defined TLS_IE \
      || !defined TLS_LD || !defined TLS_GD
# error "No support for this architecture so far."
#endif