mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-26 14:28:30 +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
|
@ -20,6 +20,7 @@
|
|||
#include "libc/intrin/asmflag.h"
|
||||
#include "libc/nt/thread.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/runtime/syslib.internal.h"
|
||||
#include "libc/sysv/consts/nr.h"
|
||||
#include "libc/thread/tls.h"
|
||||
|
||||
|
@ -74,13 +75,16 @@ privileged wontreturn void _Exit1(int rc) {
|
|||
}
|
||||
notpossible;
|
||||
#elif defined(__aarch64__)
|
||||
register long r0 asm("x0") = rc;
|
||||
asm volatile("mov\tx8,%0\n\t"
|
||||
"mov\tx16,%1\n\t"
|
||||
"svc\t0"
|
||||
: /* no outputs */
|
||||
: "i"(93), "i"(0x169), "r"(r0)
|
||||
: "x8", "memory");
|
||||
if (IsLinux()) {
|
||||
register long r0 asm("x0") = rc;
|
||||
asm volatile("mov\tx8,%0\n\t"
|
||||
"svc\t0"
|
||||
: /* no outputs */
|
||||
: "i"(93), "r"(r0)
|
||||
: "x8", "memory");
|
||||
} else if (IsXnu()) {
|
||||
__syslib->pthread_exit(0);
|
||||
}
|
||||
notpossible;
|
||||
#else
|
||||
#error "arch unsupported"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue