github.com/liangmanlin/routine@v1.1.0/g/go_arm.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 "textflag.h"
     7  
     8  TEXT ·getgp(SB), NOSPLIT, $0-4
     9      MOVW    g, R8
    10      MOVW    R8, ret+0(FP)
    11      RET
    12  
    13  TEXT ·getg0(SB), NOSPLIT, $0-8
    14      NO_LOCAL_POINTERS
    15      MOVW    R8, ret_type+0(FP)
    16      MOVW    R9, ret_data+4(FP)
    17      GO_RESULTS_INITIALIZED
    18      //get runtime.g type
    19      MOVW    $type·runtime·g(SB), R8
    20      //get runtime·g0 variable
    21      MOVW    $runtime·g0(SB), R9
    22      //return interface{}
    23      MOVW    R8, ret_type+0(FP)
    24      MOVW    R9, ret_data+4(FP)
    25      RET