aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_linux_arm64.s
diff options
context:
space:
mode:
authorSrdjan Petrovic <spetrovic@google.com>2015-04-17 17:27:07 -0700
committerDavid Crawshaw <crawshaw@golang.org>2015-04-22 16:28:57 +0000
commitca9128f18fe75878ba2d5e0df09ae755c085f72a (patch)
tree14dc3f65d05c3425c251282b91b1fe1be2079895 /src/runtime/sys_linux_arm64.s
parent3f91a017f8f67cb9a744cf5d0a8b5db34a95808d (diff)
downloadgo-ca9128f18fe75878ba2d5e0df09ae755c085f72a.tar.xz
runtime: merge clone0 and clone
We initially added clone0 to handle the case when G or M don't exist, but it turns out that we could have just modified clone. (It also helps that the function we're invoking in clone0 no longer needs arguments.) As a side-effect, newosproc0 is now supported on all linux archs. Change-Id: Ie603af75d8f164310fc16446052d83743961f3ca Reviewed-on: https://go-review.googlesource.com/9164 Reviewed-by: David Crawshaw <crawshaw@golang.org>
Diffstat (limited to 'src/runtime/sys_linux_arm64.s')
-rw-r--r--src/runtime/sys_linux_arm64.s21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/runtime/sys_linux_arm64.s b/src/runtime/sys_linux_arm64.s
index 52b34e8f41..ea8520c51d 100644
--- a/src/runtime/sys_linux_arm64.s
+++ b/src/runtime/sys_linux_arm64.s
@@ -333,14 +333,19 @@ child:
MOVD $0, R0
MOVD R0, (R0) // crash
- // Initialize m->procid to Linux tid
good:
+ // Initialize m->procid to Linux tid
MOVD $SYS_gettid, R8
SVC
- MOVD -24(RSP), R12
- MOVD -16(RSP), R11
- MOVD -8(RSP), R10
+ MOVD -24(RSP), R12 // fn
+ MOVD -16(RSP), R11 // g
+ MOVD -8(RSP), R10 // m
+
+ CMP $0, R10
+ BEQ nog
+ CMP $0, R11
+ BEQ nog
MOVD R0, m_procid(R10)
@@ -351,6 +356,7 @@ good:
MOVD R11, g
//CALL runtime·stackcheck(SB)
+nog:
// Call fn
MOVD R12, R0
BL (R0)
@@ -362,13 +368,6 @@ again:
SVC
B again // keep exiting
-// int32 clone0(int32 flags, void *stack, void* fn, void* fnarg);
-TEXT runtime·clone0(SB),NOSPLIT,$0
- // TODO(spetrovic): Implement this method.
- MOVW $-1, R0
- MOVW R0, ret+32(FP)
- RET
-
TEXT runtime·sigaltstack(SB),NOSPLIT,$-8
MOVD new+0(FP), R0
MOVD old+8(FP), R1