1 // Copyright 2015 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4 
5 #ifdef GOOS_android
6 #define TLS_linux
7 #define TLSG_IS_VARIABLE
8 #endif
9 #ifdef GOOS_linux
10 #define TLS_linux
11 #endif
12 #ifdef TLS_linux
13 #define TPIDR TPIDR_EL0
14 #define MRS_TPIDR_R0 WORD $0xd53bd040 // MRS TPIDR_EL0, R0
15 #endif
16 
17 #ifdef GOOS_darwin
18 #define TPIDR TPIDRRO_EL0
19 #define TLSG_IS_VARIABLE
20 #define MRS_TPIDR_R0 WORD $0xd53bd060 // MRS TPIDRRO_EL0, R0
21 #endif
22 
23 #ifdef GOOS_freebsd
24 #define TPIDR TPIDR_EL0
25 #define MRS_TPIDR_R0 WORD $0xd53bd040 // MRS TPIDR_EL0, R0
26 #endif
27 
28 #ifdef GOOS_netbsd
29 #define TPIDR TPIDRRO_EL0
30 #define MRS_TPIDR_R0 WORD $0xd53bd040 // MRS TPIDRRO_EL0, R0
31 #endif
32 
33 #ifdef GOOS_openbsd
34 #define TPIDR TPIDR_EL0
35 #define MRS_TPIDR_R0 WORD $0xd53bd040 // MRS TPIDR_EL0, R0
36 #endif
37 
38 // Define something that will break the build if
39 // the GOOS is unknown.
40 #ifndef TPIDR
41 #define MRS_TPIDR_R0 TPIDR_UNKNOWN
42 #endif
43