github.com/zach-klippenstein/go@v0.0.0-20150108044943-fcfbeb3adf58/misc/cgo/test/issue9400/asm_ppc64x.s (about)

     1  // +build ppc64 ppc64le
     2  
     3  #include "textflag.h"
     4  
     5  TEXT ·RewindAndSetgid(SB),NOSPLIT,$-8-0
     6  	// Rewind stack pointer so anything that happens on the stack
     7  	// will clobber the test pattern created by the caller
     8  	ADD	$(1024 * 8), R1
     9  
    10  	// Ask signaller to setgid
    11  	MOVW	$1, R3
    12  	SYNC
    13  	MOVW	R3, ·Baton(SB)
    14  
    15  	// Wait for setgid completion
    16  loop:
    17  	SYNC
    18  	MOVW	·Baton(SB), R3
    19  	CMP	R3, $0
    20  	// Hint that we're in a spin loop
    21  	OR	R1, R1, R1
    22  	BNE	loop
    23  	ISYNC
    24  
    25  	// Restore stack
    26  	SUB	$(1024 * 8), R1
    27  	RET