~ubuntu-branches/ubuntu/trusty/eglibc/trusty

« back to all changes in this revision

Viewing changes to sysdeps/sparc/sparc32/tls-macros.h

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2013-01-10 18:39:35 UTC
  • mfrom: (1.5.2) (4.4.24 experimental)
  • Revision ID: package-import@ubuntu.com-20130110183935-afsgfxkmg7wk5eaj
Tags: 2.17-0ubuntu1
* Merge with Debian, bringing in a new upstream and many small fixes:
  - patches/any/cvs-malloc-deadlock.diff: Dropped, merged upstream.
  - patches/ubuntu/lddebug-scopes.diff: Rebase for upstream changes.
  - patches/ubuntu/local-CVE-2012-3406.diff: Rebased against upstream.
  - patches/ubuntu/no-asm-mtune-i686.diff: Fixed in recent binutils.
* This upstream merge fixes a nasty hang in pulseaudio (LP: #1085342)
* Bump MIN_KERNEL_SUPPORTED to 2.6.32 on ARM, now that we no longer
  have to support shonky 2.6.31 kernels on imx51 babbage builders.
* Drop patches/ubuntu/local-disable-nscd-host-caching.diff, as these
  issues were apparently resolved upstream a while ago (LP: #613662)
* Fix the compiled-in bug URL to point to launchpad.net, not Debian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#define TLS_LE(x) \
 
2
  ({ int *__l;                                                                \
 
3
     asm ("sethi %%tle_hix22(" #x "), %0" : "=r" (__l));                      \
 
4
     asm ("xor %1, %%tle_lox10(" #x "), %0" : "=r" (__l) : "r" (__l));        \
 
5
     asm ("add %%g7, %1, %0" : "=r" (__l) : "r" (__l));                       \
 
6
     __l; })
 
7
 
 
8
#ifdef __PIC__
 
9
# define TLS_LOAD_PIC \
 
10
  ({ register long pc __asm__ ("%o7");                                        \
 
11
     long got;                                                                \
 
12
     asm ("sethi %%hi(_GLOBAL_OFFSET_TABLE_-4), %1\n\t"                       \
 
13
          "call .+8\n\t"                                                      \
 
14
          "add %1, %%lo(_GLOBAL_OFFSET_TABLE_+4), %1\n\t"                     \
 
15
          "add %1, %0, %1\n\t"                                                \
 
16
          : "=r" (pc), "=r" (got));                                           \
 
17
     got; })
 
18
#else
 
19
# define TLS_LOAD_PIC \
 
20
   ({ long got;                                                               \
 
21
      asm (".hidden _GLOBAL_OFFSET_TABLE_\n\t"                                \
 
22
           "sethi %%hi(_GLOBAL_OFFSET_TABLE_), %0\n\t"                        \
 
23
           "or %0, %%lo(_GLOBAL_OFFSET_TABLE_), %0"                           \
 
24
           : "=r" (got));                                                     \
 
25
      got; })
 
26
#endif
 
27
 
 
28
#define TLS_IE(x) \
 
29
  ({ int *__l;                                                                \
 
30
     asm ("sethi %%tie_hi22(" #x "), %0" : "=r" (__l));                       \
 
31
     asm ("add %1, %%tie_lo10(" #x "), %0" : "=r" (__l) : "r" (__l));         \
 
32
     asm ("ld [%1 + %2], %0, %%tie_ld(" #x ")"                                \
 
33
          : "=r" (__l) : "r" (TLS_LOAD_PIC), "r" (__l));                      \
 
34
     asm ("add %%g7, %1, %0, %%tie_add(" #x ")" : "=r" (__l) : "r" (__l));    \
 
35
     __l; })
 
36
 
 
37
#define TLS_LD(x) \
 
38
  ({ int *__l; register void *__o0 asm ("%o0");                               \
 
39
     long __o;                                                                \
 
40
     asm ("sethi %%tldm_hi22(" #x "), %0" : "=r" (__l));                      \
 
41
     asm ("add %1, %%tldm_lo10(" #x "), %0" : "=r" (__l) : "r" (__l));        \
 
42
     asm ("add %1, %2, %0, %%tldm_add(" #x ")"                                \
 
43
          : "=r" (__o0) : "r" (TLS_LOAD_PIC), "r" (__l));                     \
 
44
     asm ("call __tls_get_addr, %%tgd_call(" #x ")\n\t"                       \
 
45
          " nop"                                                              \
 
46
          : "=r" (__o0) : "0" (__o0)                                          \
 
47
          : "g1", "g2", "g3", "g4", "g5", "g6", "o1", "o2", "o3", "o4",       \
 
48
            "o5", "o7", "cc");                                                \
 
49
     asm ("sethi %%tldo_hix22(" #x "), %0" : "=r" (__o));                     \
 
50
     asm ("xor %1, %%tldo_lox10(" #x "), %0" : "=r" (__o) : "r" (__o));       \
 
51
     asm ("add %1, %2, %0, %%tldo_add(" #x ")" : "=r" (__l)                   \
 
52
          : "r" (__o0), "r" (__o));                                           \
 
53
     __l; })
 
54
 
 
55
#define TLS_GD(x) \
 
56
  ({ int *__l; register void *__o0 asm ("%o0");                               \
 
57
     asm ("sethi %%tgd_hi22(" #x "), %0" : "=r" (__l));                       \
 
58
     asm ("add %1, %%tgd_lo10(" #x "), %0" : "=r" (__l) : "r" (__l));         \
 
59
     asm ("add %1, %2, %0, %%tgd_add(" #x ")"                                 \
 
60
          : "=r" (__o0) : "r" (TLS_LOAD_PIC), "r" (__l));                     \
 
61
     asm ("call __tls_get_addr, %%tgd_call(" #x ")\n\t"                       \
 
62
          " nop"                                                              \
 
63
          : "=r" (__o0) : "0" (__o0)                                          \
 
64
          : "g1", "g2", "g3", "g4", "g5", "g6", "o1", "o2", "o3", "o4",       \
 
65
            "o5", "o7", "cc");                                                \
 
66
     __o0; })