We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get_tls(CX) MOVQ g(CX), BX; BX存器里面现在放的是当前g结构体对象的地址
#ifdef GOARCH_amd64 #define get_tls(r) MOVQ TLS, r #define g(r) 0(r)(TLS*1) #endif
0(r)(TLS1),这个表达式的执行逻辑是:(0+TLS+TLS)吗,这样取到的地址不是错的吗,请教下大佬这个问题
接着上面的问题,为啥g(BX)取到的是m0.tls[0]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
get_tls(CX)
MOVQ g(CX), BX; BX存器里面现在放的是当前g结构体对象的地址
#ifdef GOARCH_amd64
#define get_tls(r) MOVQ TLS, r
#define g(r) 0(r)(TLS*1)
#endif
0(r)(TLS1),这个表达式的执行逻辑是:(0+TLS+TLS)吗,这样取到的地址不是错的吗,请教下大佬这个问题
get_tls(BX) //获取fs段基址到BX寄存器
LEAQ runtime·g0(SB), CX //CX = g0的地址
MOVQ CX, g(BX) //把g0的地址保存在线程本地存储里面,也就是m0.tls[0]=&g0
接着上面的问题,为啥g(BX)取到的是m0.tls[0]
The text was updated successfully, but these errors were encountered: