mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-06 03:08:31 +00:00
Get hello.com working on metal again (#529)
* Fix deterministic startup stack setup, especially for bare metal * Implement __enable_tls() on bare metal * Get __get_tls_privileged() working on bare metal
This commit is contained in:
parent
ad775a75b8
commit
62ca1b0902
3 changed files with 14 additions and 4 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue