Black Lives Matter. Support the Equal Justice Initiative.

Text file src/runtime/tls_mips64x.s

Documentation: runtime

     1  // Copyright 2015 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  //go:build mips64 || mips64le
     6  // +build mips64 mips64le
     7  
     8  #include "go_asm.h"
     9  #include "go_tls.h"
    10  #include "funcdata.h"
    11  #include "textflag.h"
    12  
    13  // If !iscgo, this is a no-op.
    14  //
    15  // NOTE: mcall() assumes this clobbers only R23 (REGTMP).
    16  TEXT runtime·save_g(SB),NOSPLIT|NOFRAME,$0-0
    17  	MOVB	runtime·iscgo(SB), R23
    18  	BEQ	R23, nocgo
    19  
    20  	MOVV	R3, R23	// save R3
    21  	MOVV	g, runtime·tls_g(SB) // TLS relocation clobbers R3
    22  	MOVV	R23, R3	// restore R3
    23  
    24  nocgo:
    25  	RET
    26  
    27  TEXT runtime·load_g(SB),NOSPLIT|NOFRAME,$0-0
    28  	MOVV	runtime·tls_g(SB), g // TLS relocation clobbers R3
    29  	RET
    30  
    31  GLOBL runtime·tls_g(SB), TLSBSS, $8
    32  

View as plain text