mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-04 10:18:31 +00:00
Introduce FreeBSD ARM64 support
It's 100% passing test fleet. Solid as a rock.
This commit is contained in:
parent
43fe5956ad
commit
83107f78ed
455 changed files with 778 additions and 551 deletions
|
@ -32,10 +32,19 @@ _futex:
|
|||
neg %eax
|
||||
1: pop %rbp
|
||||
#elif defined(__aarch64__)
|
||||
mov x8,#0x062
|
||||
svc #0
|
||||
ldr x7,=__hostos
|
||||
ldr w7,[x7]
|
||||
tst x7,1 // IsLinux()
|
||||
mov x7,98 // futex (Linux)
|
||||
mov x8,454 // _umtx_op (FreeBSD)
|
||||
csel x8,x7,x8,ne // choose syscall magnum
|
||||
mov x7,0 // clear carry (for Linux)
|
||||
adds x7,x7,0 // clear carry
|
||||
svc #0 // call kernel
|
||||
bcc 1f // jump if not carry
|
||||
neg x0,x0 // linux style errno
|
||||
#else
|
||||
#error "unsupported architecture"
|
||||
#endif /* __x86_64__ */
|
||||
ret
|
||||
1: ret
|
||||
.endfn _futex,globl,hidden
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue