mirror of
https://github.com/chai2010/advanced-go-programming-book.git
synced 2025-05-24 04:22:22 +00:00
21 lines
373 B
ArmAsm
21 lines
373 B
ArmAsm
#include "textflag.h"
|
|
|
|
// func getg() interface{}
|
|
TEXT ·getg(SB), NOSPLIT, $32-16
|
|
// get runtime.g
|
|
MOVQ (TLS), AX
|
|
// get runtime.g type
|
|
MOVQ $type·runtime·g(SB), BX
|
|
|
|
// convert (*g) to interface{}
|
|
MOVQ AX, 8(SP)
|
|
MOVQ BX, 0(SP)
|
|
CALL ·runtime_convT2E_hack(SB)
|
|
MOVQ 16(SP), AX
|
|
MOVQ 24(SP), BX
|
|
|
|
// return interface{}
|
|
MOVQ AX, ret+0(FP)
|
|
MOVQ BX, ret+8(FP)
|
|
RET
|