Make more code aarch64 friendly

This commit is contained in:
Justine Tunney 2023-05-02 13:38:16 -07:00
parent ca2860947f
commit 2b73e72d59
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
568 changed files with 2197 additions and 1061 deletions

View file

@ -48,7 +48,19 @@ int getpid(void) {
} else if (!__vforked) {
rc = __pid;
} else {
#ifdef __x86_64__
rc = sys_getpid().ax;
#elif defined(__aarch64__)
register long res_x0 asm("x0");
asm volatile("mov\tx8,%1\n"
"svc\t0"
: "=r"(res_x0)
: "i"(172)
: "x8", "memory");
rc = res_x0;
#else
#error "arch unsupported"
#endif
}
return rc;
}