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