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

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright 2023 The Prime Citizens
     3  
     4  //go:build pcz && amd64
     5  
     6  #include "textflag.h"
     7  
     8  TEXT ·GetTLSBaseAddress<ABIInternal>(SB),NOSPLIT,$0
     9  	MOVQ TLS, AX
    10  
    11  #ifdef GOOS_darwin
    12  	// Darwin sometimes returns unaligned pointers
    13  	ANDQ $0xfffffffffffffff8, AX
    14  #endif
    15  
    16  	RET
    17  
    18  // func SetG(*stdgo.GHead)
    19  TEXT ·SetG<ABIInternal>(SB),NOSPLIT,$0
    20  	MOVQ AX, R14
    21  	// Initialize TLS entry.
    22  	// See cmd/link/internal/ld/sym.go:computeTLSOffset.
    23  	MOVQ AX, 0x30(GS)
    24  	RET
    25  
    26  TEXT ·Topframe<ABIInternal>(SB),NOSPLIT|NOFRAME|TOPFRAME,$0
    27  	JMP (CX)
    28  	RET