diff options
author | Shenghou Ma <minux@golang.org> | 2015-04-03 04:37:22 -0400 |
---|---|---|
committer | Minux Ma <minux@golang.org> | 2015-04-08 09:08:27 +0000 |
commit | d0b62d8bfaa449f68a60be3d9b7bf472f02a9204 (patch) | |
tree | c89464b2ce6888eae03b4a0d2e68f522cbdc54ab /src/runtime/tls_arm64.s | |
parent | 0accc80fbbf483a8d120079bc4bc91cade8b87f2 (diff) | |
download | go-d0b62d8bfaa449f68a60be3d9b7bf472f02a9204.tar.gz go-d0b62d8bfaa449f68a60be3d9b7bf472f02a9204.zip |
runtime: linux/arm64 cgo support
Change-Id: I309e3df7608b9eef9339196fdc50dedf5f9439f3
Reviewed-on: https://go-review.googlesource.com/8450
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
Diffstat (limited to 'src/runtime/tls_arm64.s')
-rw-r--r-- | src/runtime/tls_arm64.s | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/runtime/tls_arm64.s b/src/runtime/tls_arm64.s new file mode 100644 index 0000000000..3ab087ada1 --- /dev/null +++ b/src/runtime/tls_arm64.s @@ -0,0 +1,31 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include "go_asm.h" +#include "go_tls.h" +#include "funcdata.h" +#include "textflag.h" +#include "tls_arm64.h" + +TEXT runtime·load_g(SB),NOSPLIT,$0 + MOVB runtime·iscgo(SB), R0 + CMP $0, R0 + BEQ nocgo + + MRS_TPIDR_R0 + MOVD 0x10(R0), g + +nocgo: + RET + +TEXT runtime·save_g(SB),NOSPLIT,$0 + MOVB runtime·iscgo(SB), R0 + CMP $0, R0 + BEQ nocgo + + MRS_TPIDR_R0 + MOVD g, 0x10(R0) + +nocgo: + RET |