github.com/mattn/go@v0.0.0-20171011075504-07f7db3ea99f/src/runtime/internal/atomic/atomic_mipsx.s (about)

     1  // Copyright 2016 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 mips mipsle
     6  
     7  #include "textflag.h"
     8  
     9  TEXT ·spinLock(SB),NOSPLIT,$0-4
    10  	MOVW	state+0(FP), R1
    11  	MOVW	$1, R2
    12  	SYNC
    13  try_lock:
    14  	MOVW	R2, R3
    15  check_again:
    16  	LL	(R1), R4
    17  	BNE	R4, check_again
    18  	SC	R3, (R1)
    19  	BEQ	R3, try_lock
    20  	SYNC
    21  	RET
    22  
    23  TEXT ·spinUnlock(SB),NOSPLIT,$0-4
    24  	MOVW	state+0(FP), R1
    25  	SYNC
    26  	MOVW	R0, (R1)
    27  	SYNC
    28  	RET