Home | History | Annotate | Download | only in issue9400
      1 // Copyright 2014 The Go Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style
      3 // license that can be found in the LICENSE file.
      4 
      5 // +build ppc64 ppc64le
      6 // +build !gccgo
      7 
      8 #include "textflag.h"
      9 
     10 TEXT RewindAndSetgid(SB),NOSPLIT|NOFRAME,$0-0
     11 	// Rewind stack pointer so anything that happens on the stack
     12 	// will clobber the test pattern created by the caller
     13 	ADD	$(1024 * 8), R1
     14 
     15 	// Ask signaller to setgid
     16 	MOVW	$1, R3
     17 	SYNC
     18 	MOVW	R3, Baton(SB)
     19 
     20 	// Wait for setgid completion
     21 loop:
     22 	SYNC
     23 	MOVW	Baton(SB), R3
     24 	CMP	R3, $0
     25 	// Hint that we're in a spin loop
     26 	OR	R1, R1, R1
     27 	BNE	loop
     28 	ISYNC
     29 
     30 	// Restore stack
     31 	SUB	$(1024 * 8), R1
     32 	RET
     33