mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
Make more code aarch64 friendly
This commit is contained in:
parent
ca2860947f
commit
2b73e72d59
568 changed files with 2197 additions and 1061 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue