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:
tkchia 2022-08-14 07:14:02 +08:00 committed by GitHub
parent ad775a75b8
commit 62ca1b0902
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 4 deletions

View file

@ -99,6 +99,8 @@ cosmo: push %rbp
.init.start 304,_init_stack
testb IsWindows()
jnz 9f
testb IsMetal()
jnz 9f
push %rdi
push %rsi
// allocate stack
@ -120,8 +122,9 @@ cosmo: push %rbp
leave
pop %rcx
lea (%rax,%r8),%rsp
sub $ape_stack_align,%rsp # openbsd:stackbound
mov %rbp,(%rsp)
mov $ape_stack_align,%eax # openbsd:stackbound
neg %rax
and %rax,%rsp
push %rcx
push %rbp
mov %rsp,%rbp