From ca9128f18fe75878ba2d5e0df09ae755c085f72a Mon Sep 17 00:00:00 2001 From: Srdjan Petrovic Date: Fri, 17 Apr 2015 17:27:07 -0700 Subject: 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 --- src/runtime/sys_linux_ppc64x.s | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/runtime/sys_linux_ppc64x.s') 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 -- cgit v1.3-5-g9baa