mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-09 11:20:30 +00:00
Get __get_tls_privileged() working on bare metal
This commit is contained in:
parent
3a49dbc4f9
commit
f9a0999237
1 changed files with 1 additions and 1 deletions
|
@ -27,7 +27,7 @@ static noasan inline char *__get_tls(void) {
|
||||||
*/
|
*/
|
||||||
static noasan inline char *__get_tls_privileged(void) {
|
static noasan inline char *__get_tls_privileged(void) {
|
||||||
char *tib, *lin = (char *)0x30;
|
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");
|
asm("mov\t%%fs:(%1),%0" : "=a"(tib) : "r"(lin) : "memory");
|
||||||
} else {
|
} else {
|
||||||
asm("mov\t%%gs:(%1),%0" : "=a"(tib) : "r"(lin) : "memory");
|
asm("mov\t%%gs:(%1),%0" : "=a"(tib) : "r"(lin) : "memory");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue