Text file src/runtime/cgo/trampoline_test_riscv64.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_riscv64.h"
     9  
    10  // Called on g0 by cgoCallTrampoline with a PC buffer in X10, its size
    11  // in X11, and runtime.Callers in X12. Set up the ABIInternal arguments
    12  // for Callers(0, buf) and preserve the host's callee-saved registers.
    13  TEXT ·trampolineCallers(SB),NOSPLIT,$232-0
    14  	SAVE_GPR(5*8)
    15  	SAVE_FPR(17*8)
    16  	MOV	X12, X6
    17  	MOV	X11, X13
    18  	MOV	X11, X12
    19  	MOV	X10, X11
    20  	MOV	ZERO, X10
    21  	JALR	RA, X6
    22  	RESTORE_FPR(17*8)
    23  	RESTORE_GPR(5*8)
    24  	RET
    25  

View as plain text