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.
5 //go:build mips64 || mips64le
9 // Called by C code generated by cmd/cgo.
10 // func crosscall2(fn, a unsafe.Pointer, n int32, ctxt uintptr)
11 // Saves C callee-saved registers and calls cgocallback with three arguments.
12 // fn is the PC of a func(a unsafe.Pointer) function.
13 TEXT crosscall2(SB),NOSPLIT|NOFRAME,$0
15 * We still need to save all callee save register as before, and then
16 * push 3 args for fn (R4, R5, R7), skipping R6.
17 * Also note that at procedure entry in gc world, 8(R29) will be the
20 #ifndef GOMIPS64_softfloat
25 MOVV R4, (8*1)(R29) // fn unsafe.Pointer
26 MOVV R5, (8*2)(R29) // a unsafe.Pointer
27 MOVV R7, (8*3)(R29) // ctxt uintptr
39 #ifndef GOMIPS64_softfloat
49 // Initialize Go ABI environment
50 // prepare SB register = PC & 0xffffffff00000000
54 JAL runtimeĀ·load_g(SB)
56 JAL runtimeĀ·cgocallback(SB)
69 #ifndef GOMIPS64_softfloat