mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-03 17:58:30 +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
|
@ -33,6 +33,7 @@ register long x3 asm("x3");
|
|||
register long x4 asm("x4");
|
||||
register long x5 asm("x5");
|
||||
register long sysv_ordinal asm("x8");
|
||||
register long freebsd_ordinal asm("x9");
|
||||
register long xnu_ordinal asm("x16");
|
||||
register long cosmo_tls_register asm("x28");
|
||||
|
||||
|
@ -68,7 +69,7 @@ dontinline long systemfive_cancellable(void) {
|
|||
|
||||
// invoke cancellable system call
|
||||
// this works for both linux and bsd
|
||||
asm volatile("mov\tx9,0\n\t" // clear carry flag
|
||||
asm volatile("mov\tx9,0\n\t" // clear carry flag (for linux)
|
||||
"adds\tx9,x9,0\n\t" // clear carry flag
|
||||
"svc\t0\n"
|
||||
"systemfive_cancellable_end:\n\t"
|
||||
|
@ -114,7 +115,10 @@ dontinline long systemfive_cancellable(void) {
|
|||
long systemfive(void) {
|
||||
|
||||
// handle special cases
|
||||
if (IsLinux()) {
|
||||
if (IsLinux() || IsFreebsd()) {
|
||||
if (IsFreebsd()) {
|
||||
sysv_ordinal = freebsd_ordinal;
|
||||
}
|
||||
if (sysv_ordinal == 0xfff) {
|
||||
return _sysret(-ENOSYS);
|
||||
}
|
||||
|
@ -135,9 +139,7 @@ long systemfive(void) {
|
|||
|
||||
// invoke non-blocking system call
|
||||
// this works for both linux and bsd
|
||||
asm volatile("mov\tx9,0\n\t" // clear carry flag
|
||||
"adds\tx9,x9,0\n\t" // clear carry flag
|
||||
"svc\t0\n\t"
|
||||
asm volatile("svc\t0\n\t"
|
||||
"bcs\t1f\n\t"
|
||||
"b\t2f\n1:\t"
|
||||
"neg\tx0,x0\n2:"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue