mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-08 20:28:30 +00:00
Get MbedTLS and its unit tests passing AARCH64
This commit is contained in:
parent
5e2f7f7ced
commit
4edbc98811
37 changed files with 632 additions and 725 deletions
|
@ -68,7 +68,13 @@ _start:
|
|||
lea 8(%rsp),%rsi // argv
|
||||
lea 16(%rsp,%rbx,8),%rdx // envp
|
||||
mov %rsp,__oldstack(%rip)
|
||||
and $-16,%rsp
|
||||
|
||||
// setup a stack frame
|
||||
// align stack to GetStackSize() so GetStackAddr() is fast
|
||||
.weak ape_stack_memsz
|
||||
mov $ape_stack_memsz,%r8d
|
||||
neg %r8
|
||||
and %r8,%rsp
|
||||
xor %ebp,%ebp
|
||||
// bofram 9f
|
||||
|
||||
|
@ -107,10 +113,23 @@ _start:
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
#elif defined(__aarch64__)
|
||||
|
||||
// save original stack pointer
|
||||
// this is the first argument to cosmo() below
|
||||
mov x0,sp
|
||||
|
||||
// setup stack frame
|
||||
mov x29,#0
|
||||
mov x30,#0
|
||||
mov x0,sp
|
||||
and sp,x0,#-16
|
||||
|
||||
// align stack to GetStackSize() so GetStackAddr() is fast
|
||||
mov x1,sp
|
||||
.weak ape_stack_memsz
|
||||
ldr x2,=ape_stack_memsz
|
||||
neg x2,x2
|
||||
and x1,x2,x1
|
||||
mov sp,x1
|
||||
|
||||
// switch to c start function
|
||||
b cosmo
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue