5 .macro set_tls_none
, tp
, tmp1
, tmp2
8 .macro set_tls_v6k
, tp
, tmp1
, tmp2
9 mcr p15
, 0, \tp
, c13
, c0
, 3 @ set TLS
register
12 .macro set_tls_v6
, tp
, tmp1
, tmp2
14 ldr
\tmp
1, [\tmp
1, #0]
15 mov
\tmp
2, #0xffff0fff
16 tst
\tmp
1, #HWCAP_TLS @ hardware TLS available?
17 mcrne p15
, 0, \tp
, c13
, c0
, 3 @ yes
, set TLS
register
18 streq
\tp
, [\tmp
2, #-15] @ set TLS value at 0xffff0ff0
21 .macro set_tls_software
, tp
, tmp1
, tmp2
22 mov
\tmp
1, #0xffff0fff
23 str
\tp
, [\tmp
1, #-15] @ set TLS value at 0xffff0ff0
27 #ifdef CONFIG_TLS_REG_EMUL
30 #define set_tls set_tls_none
31 #elif defined(CONFIG_CPU_V6)
33 #define has_tls_reg (elf_hwcap & HWCAP_TLS)
34 #define set_tls set_tls_v6
35 #elif defined(CONFIG_CPU_32v6K)
38 #define set_tls set_tls_v6k
42 #define set_tls set_tls_software
45 #endif /* __ASMARM_TLS_H */