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

     1  // +build amd64 amd64p32
     2  
     3  #include "textflag.h"
     4  
     5  TEXT ·RewindAndSetgid(SB),NOSPLIT,$0-0
     6  	// Rewind stack pointer so anything that happens on the stack
     7  	// will clobber the test pattern created by the caller
     8  	ADDQ	$(1024 * 8), SP
     9  
    10  	// Ask signaller to setgid
    11  	MOVL	$1, ·Baton(SB)
    12  
    13  	// Wait for setgid completion
    14  loop:
    15  	PAUSE
    16  	MOVL	·Baton(SB), AX
    17  	CMPL	AX, $0
    18  	JNE	loop
    19  
    20  	// Restore stack
    21  	SUBQ	$(1024 * 8), SP
    22  	RET