github.com/primecitizens/pcz/std@v0.2.1/core/stack/asm_amd64.s (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright 2023 The Prime Citizens
     3  //
     4  // Copyright 2009 The Go Authors. All rights reserved.
     5  // Use of this source code is governed by a BSD-style
     6  // license that can be found in the LICENSE file.
     7  
     8  //go:build pcz && amd64
     9  
    10  #include "textflag.h"
    11  
    12  TEXT ·GetSP<ABIInternal>(SB),NOSPLIT|NOFRAME,$0
    13  	MOVQ SP, AX
    14  	RET
    15  
    16  TEXT ·SetSP<ABIInternal>(SB),NOSPLIT|NOFRAME,$0
    17  	NOP SP // tell vet SP changed - stop checking offsets
    18  	MOVQ SP, AX
    19  	RET
    20  
    21  TEXT ·GetFP<ABIInternal>(SB),NOSPLIT|NOFRAME,$0
    22  	MOVQ BP, AX
    23  	RET
    24  
    25  // Called during function prolog when more stack is needed.
    26  //
    27  // The traceback routines see morestack on a g0 as being
    28  // the top of a stack (for example, morestack calling newstack
    29  // calling the scheduler calling newm calling gc), so we must
    30  // record an argument size. For that purpose, it has no arguments.
    31  TEXT runtime·morestack(SB),NOSPLIT|NOFRAME,$0-0
    32  	// TODO: implement
    33  	INT $3 // crash
    34  loop:
    35  	JMP loop
    36  
    37  // morestack but not preserving ctxt.
    38  TEXT runtime·morestack_noctxt(SB),NOSPLIT|NOFRAME,$0-0
    39  	MOVL $0, DX
    40  	JMP runtime·morestack(SB)