Text file src/runtime/cgo/trampoline_test_386.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  
     9  // Called on g0 by cgoCallTrampoline with the PC buffer at 4(SP), its length
    10  // at 8(SP), and runtime.Callers at 12(SP). Call Callers(0, buf) using the
    11  // 386 stack ABI while preserving C callee-saved registers.
    12  TEXT ·trampolineCallers(SB),NOSPLIT|NOFRAME,$0-0
    13  	PUSHL	BP
    14  	MOVL	SP, BP
    15  	ADJSP	$32
    16  	MOVL	BX, 20(SP)
    17  	MOVL	SI, 24(SP)
    18  	MOVL	DI, 28(SP)
    19  	MOVL	$0, 0(SP)
    20  	MOVL	8(BP), AX
    21  	MOVL	AX, 4(SP)
    22  	MOVL	12(BP), AX
    23  	MOVL	AX, 8(SP)
    24  	MOVL	AX, 12(SP)
    25  	MOVL	16(BP), AX
    26  	CALL	AX
    27  	MOVL	16(SP), AX
    28  	MOVL	20(SP), BX
    29  	MOVL	24(SP), SI
    30  	MOVL	28(SP), DI
    31  	ADJSP	$-32
    32  	POPL	BP
    33  	RET
    34  

View as plain text