mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 23:08:31 +00:00
Get threads working well on MacOS Arm64
- Now using 10x better GCD semaphores - We now generate Linux-like thread ids - We now use fast system clock / sleep libraries - The APE M1 loader now generates Linux-like stacks
This commit is contained in:
parent
b5eab2b0b7
commit
bcf9af94bf
2037 changed files with 4664 additions and 4451 deletions
|
@ -63,14 +63,15 @@ privileged int sys_gettid(void) {
|
|||
}
|
||||
return tid;
|
||||
#elif defined(__aarch64__)
|
||||
register long res_x0 asm("x0");
|
||||
// this can't be used on xnu
|
||||
if (!IsLinux()) notpossible;
|
||||
register long res asm("x0");
|
||||
asm volatile("mov\tx8,%1\n\t"
|
||||
"mov\tx16,%2\n\t"
|
||||
"svc\t0"
|
||||
: "=r"(res_x0)
|
||||
: "i"(178), "i"(186)
|
||||
: "=r"(res)
|
||||
: "i"(178)
|
||||
: "x8", "memory");
|
||||
return res_x0;
|
||||
return res;
|
||||
#else
|
||||
#error "arch unsupported"
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue