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

     1  #include "textflag.h"
     2  
     3  TEXT cas<>(SB),NOSPLIT,$0
     4  	MOVW	$0xffff0fc0, PC
     5  
     6  TEXT ·RewindAndSetgid(SB),NOSPLIT,$-4-0
     7  	// Save link register
     8  	MOVW	R14, R4
     9  
    10  	// Rewind stack pointer so anything that happens on the stack
    11  	// will clobber the test pattern created by the caller
    12  	ADD	$(1024 * 8), R13
    13  
    14  	// Ask signaller to setgid
    15  	MOVW	$·Baton(SB), R2
    16  storeloop:
    17  	MOVW	0(R2), R0
    18  	MOVW	$1, R1
    19  	BL	cas<>(SB)
    20  	BCC	storeloop
    21  
    22  	// Wait for setgid completion
    23  loop:
    24  	MOVW	$0, R0
    25  	MOVW	$0, R1
    26  	BL	cas<>(SB)
    27  	BCC	loop
    28  
    29  	// Restore stack
    30  	SUB	$(1024 * 8), R13
    31  
    32  	MOVW	R4, R14
    33  	RET