aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/rt0_darwin_arm64.s
diff options
context:
space:
mode:
authorElias Naur <elias.naur@gmail.com>2018-06-07 12:19:42 +0200
committerKeith Randall <khr@golang.org>2018-06-12 17:05:46 +0000
commit021c39d7a3361290d9e29497cf2a4a8fd2ee7b5c (patch)
tree573c7176129e0e5a0ed8b30b867453f04de0aa4b /src/runtime/rt0_darwin_arm64.s
parentec989337c5d3203d52de1a2314813996c711fce6 (diff)
downloadgo-021c39d7a3361290d9e29497cf2a4a8fd2ee7b5c.tar.gz
go-021c39d7a3361290d9e29497cf2a4a8fd2ee7b5c.zip
runtime: use libc for signal functions on iOS
Also: - Add extra SystemStack space for darwin/arm64 just like for darwin/arm. - Removed redundant stack alignment; the arm64 hardware enforces the 16 byte alignment. - Save and restore the g registers at library initialization. - Zero g registers since libpreinit can call libc functions that in turn use asmcgocall. asmcgocall requires an initialized g. - Change asmcgocall to work even if no g is set. The change mimics amd64. Change-Id: I1b8c63b07cfec23b909c0d215b50dc229f8adbc8 Reviewed-on: https://go-review.googlesource.com/117176 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/runtime/rt0_darwin_arm64.s')
-rw-r--r--src/runtime/rt0_darwin_arm64.s37
1 files changed, 21 insertions, 16 deletions
diff --git a/src/runtime/rt0_darwin_arm64.s b/src/runtime/rt0_darwin_arm64.s
index 719944e626..d039a8e0ab 100644
--- a/src/runtime/rt0_darwin_arm64.s
+++ b/src/runtime/rt0_darwin_arm64.s
@@ -26,18 +26,21 @@ TEXT _rt0_arm64_darwin_lib(SB),NOSPLIT,$168
MOVD R25, 72(RSP)
MOVD R26, 80(RSP)
MOVD R27, 88(RSP)
- FMOVD F8, 96(RSP)
- FMOVD F9, 104(RSP)
- FMOVD F10, 112(RSP)
- FMOVD F11, 120(RSP)
- FMOVD F12, 128(RSP)
- FMOVD F13, 136(RSP)
- FMOVD F14, 144(RSP)
- FMOVD F15, 152(RSP)
+ MOVD g, 96(RSP)
+ FMOVD F8, 104(RSP)
+ FMOVD F9, 112(RSP)
+ FMOVD F10, 120(RSP)
+ FMOVD F11, 128(RSP)
+ FMOVD F12, 136(RSP)
+ FMOVD F13, 144(RSP)
+ FMOVD F14, 152(RSP)
+ FMOVD F15, 160(RSP)
MOVD R0, _rt0_arm64_darwin_lib_argc<>(SB)
MOVD R1, _rt0_arm64_darwin_lib_argv<>(SB)
+ MOVD $0, g // initialize g to nil
+
// Synchronous initialization.
MOVD $runtimeĀ·libpreinit(SB), R4
BL (R4)
@@ -58,14 +61,16 @@ TEXT _rt0_arm64_darwin_lib(SB),NOSPLIT,$168
MOVD 72(RSP), R25
MOVD 80(RSP), R26
MOVD 88(RSP), R27
- FMOVD 96(RSP), F8
- FMOVD 104(RSP), F9
- FMOVD 112(RSP), F10
- FMOVD 120(RSP), F11
- FMOVD 128(RSP), F12
- FMOVD 136(RSP), F13
- FMOVD 144(RSP), F14
- FMOVD 152(RSP), F15
+ MOVD 96(RSP), g
+ FMOVD 104(RSP), F8
+ FMOVD 112(RSP), F9
+ FMOVD 120(RSP), F10
+ FMOVD 128(RSP), F11
+ FMOVD 136(RSP), F12
+ FMOVD 144(RSP), F13
+ FMOVD 152(RSP), F14
+ FMOVD 160(RSP), F15
+
RET
TEXT _rt0_arm64_darwin_lib_go(SB),NOSPLIT,$0