github.com/liangmanlin/routine@v1.1.0/g/go_amd64.s (about)

     1  // Copyright 2022 TimAndy. All rights reserved.
     2  // Licensed under the Apache-2.0 license that can be found in the LICENSE file.
     3  
     4  #include "funcdata.h"
     5  #include "go_asm.h"
     6  #include "go_tls.h"
     7  #include "textflag.h"
     8  
     9  TEXT ·getgp(SB), NOSPLIT, $0-8
    10      get_tls(CX)
    11      MOVQ    g(CX), AX
    12      MOVQ    AX, ret+0(FP)
    13      RET
    14  
    15  TEXT ·getg0(SB), NOSPLIT, $0-16
    16      NO_LOCAL_POINTERS
    17      MOVQ    $0, ret_type+0(FP)
    18      MOVQ    $0, ret_data+8(FP)
    19      GO_RESULTS_INITIALIZED
    20      //get runtime.g type
    21      MOVQ    $type·runtime·g(SB), AX
    22      //get runtime·g0 variable
    23      MOVQ    $runtime·g0(SB), BX
    24      //return interface{}
    25      MOVQ    AX, ret_type+0(FP)
    26      MOVQ    BX, ret_data+8(FP)
    27      RET