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 "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 // NOTE: gogo asumes load_g only clobers g (R30) and REGTMP (R23) 14 TEXT runtimesave_g(SB),NOSPLIT,$-4-0 15 MOVB runtimeiscgo(SB), R23 16 BEQ R23, nocgo 17 18 MOVW R3, R23 19 MOVW g, runtimetls_g(SB) // TLS relocation clobbers R3 20 MOVW R23, R3 21 22 nocgo: 23 RET 24 25 TEXT runtimeload_g(SB),NOSPLIT,$-4-0 26 MOVW runtimetls_g(SB), g // TLS relocation clobbers R3 27 RET 28 29 GLOBL runtimetls_g(SB), TLSBSS, $4 30