| 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 MRS_TPIDR_R0 WORD $0xd53bd040 // MRS TPIDR_EL0, R0 |
| 14 |
#endif |
| 15 |
|
| 16 |
#ifdef GOOS_darwin |
| 17 |
#define TLS_darwin |
| 18 |
#endif |
| 19 |
#ifdef GOOS_ios |
| 20 |
#define TLS_darwin |
| 21 |
#endif |
| 22 |
#ifdef TLS_darwin |
| 23 |
#define TLSG_IS_VARIABLE |
| 24 |
#define MRS_TPIDR_R0 WORD $0xd53bd060 // MRS TPIDRRO_EL0, R0 |
| 25 |
#endif |
| 26 |
|
| 27 |
#ifdef GOOS_freebsd |
| 28 |
#define MRS_TPIDR_R0 WORD $0xd53bd040 // MRS TPIDR_EL0, R0 |
| 29 |
#endif |
| 30 |
|
| 31 |
#ifdef GOOS_netbsd |
| 32 |
#define MRS_TPIDR_R0 WORD $0xd53bd040 // MRS TPIDRRO_EL0, R0 |
| 33 |
#endif |
| 34 |
|
| 35 |
#ifdef GOOS_openbsd |
| 36 |
#define MRS_TPIDR_R0 WORD $0xd53bd040 // MRS TPIDR_EL0, R0 |
| 37 |
#endif |
| 38 |
|
| 39 |
#ifdef GOOS_windows |
| 40 |
#define TLS_windows |
| 41 |
#endif |
| 42 |
#ifdef TLS_windows |
| 43 |
#define TLSG_IS_VARIABLE |
| 44 |
#define MRS_TPIDR_R0 MOVD R18_PLATFORM, R0 |
| 45 |
#endif |
| 46 |
|
| 47 |
// Define something that will break the build if |
| 48 |
// the GOOS is unknown. |
| 49 |
#ifndef MRS_TPIDR_R0 |
| 50 |
#define MRS_TPIDR_R0 unknown_TLS_implementation_in_tls_arm64_h |
| 51 |
#endif |