Text file
src/runtime/cgo/trampoline_test_loong64.s
1 // Copyright 2026 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 goexperiment.runtimecgopurego && !msan && !tsan && unix
6
7 #include "textflag.h"
8 #include "abi_loong64.h"
9
10 // Called on g0 by cgoCallTrampoline with a PC buffer in R4, its size
11 // in R5, and runtime.Callers in R6. Set up the ABIInternal arguments
12 // for Callers(0, buf) and preserve the host's callee-saved registers.
13 TEXT ·trampolineCallers(SB),NOSPLIT,$184-0
14 SAVE_R22_TO_R31(5*8)
15 SAVE_F24_TO_F31(15*8)
16 MOVV R6, R12
17 MOVV R5, R7
18 MOVV R5, R6
19 MOVV R4, R5
20 MOVV R0, R4
21 JAL (R12)
22 RESTORE_F24_TO_F31(15*8)
23 RESTORE_R22_TO_R31(5*8)
24 RET
25
View as plain text