Get __get_tls_privileged() working on bare metal

This commit is contained in:
tkchia 2022-08-10 18:53:18 +00:00
parent 3a49dbc4f9
commit f9a0999237

View file

@ -27,7 +27,7 @@ static noasan inline char *__get_tls(void) {
*/
static noasan inline char *__get_tls_privileged(void) {
char *tib, *lin = (char *)0x30;
if (IsLinux() || IsFreebsd() || IsNetbsd() || IsOpenbsd()) {
if (IsLinux() || IsFreebsd() || IsNetbsd() || IsOpenbsd() || IsMetal()) {
asm("mov\t%%fs:(%1),%0" : "=a"(tib) : "r"(lin) : "memory");
} else {
asm("mov\t%%gs:(%1),%0" : "=a"(tib) : "r"(lin) : "memory");