Introduce FreeBSD ARM64 support

It's 100% passing test fleet. Solid as a rock.
This commit is contained in:
Justine Tunney 2023-12-29 20:11:23 -08:00
parent 43fe5956ad
commit 83107f78ed
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
455 changed files with 778 additions and 551 deletions

View file

@ -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