diff options
author | Srdjan Petrovic <spetrovic@google.com> | 2015-04-17 17:27:07 -0700 |
---|---|---|
committer | David Crawshaw <crawshaw@golang.org> | 2015-04-22 16:28:57 +0000 |
commit | ca9128f18fe75878ba2d5e0df09ae755c085f72a (patch) | |
tree | 14dc3f65d05c3425c251282b91b1fe1be2079895 /src/runtime/sys_linux_ppc64x.s | |
parent | 3f91a017f8f67cb9a744cf5d0a8b5db34a95808d (diff) | |
download | go-ca9128f18fe75878ba2d5e0df09ae755c085f72a.tar.gz go-ca9128f18fe75878ba2d5e0df09ae755c085f72a.zip |
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_ppc64x.s')
-rw-r--r-- | src/runtime/sys_linux_ppc64x.s | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/runtime/sys_linux_ppc64x.s b/src/runtime/sys_linux_ppc64x.s index fd7ce4fa48..ff397f003b 100644 --- a/src/runtime/sys_linux_ppc64x.s +++ b/src/runtime/sys_linux_ppc64x.s @@ -323,9 +323,14 @@ TEXT runtime·clone(SB),NOSPLIT,$-8 // Initialize m->procid to Linux tid SYSCALL $SYS_gettid - MOVD -24(R1), R12 - MOVD -16(R1), R8 - MOVD -8(R1), R7 + MOVD -24(R1), R12 // fn + MOVD -16(R1), R8 // g + MOVD -8(R1), R7 // m + + CMP R7, $0 + BEQ nog + CMP R8, $0 + BEQ nog MOVD R3, m_procid(R7) @@ -336,6 +341,7 @@ TEXT runtime·clone(SB),NOSPLIT,$-8 MOVD R8, g //CALL runtime·stackcheck(SB) +nog: // Call fn MOVD R12, CTR BL (CTR) @@ -345,13 +351,6 @@ TEXT runtime·clone(SB),NOSPLIT,$-8 SYSCALL $SYS_exit_group BR -2(PC) // 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, R3 - MOVW R3, ret+32(FP) - RETURN - TEXT runtime·sigaltstack(SB),NOSPLIT,$-8 MOVD new+0(FP), R3 MOVD old+8(FP), R4 |