Get threads working on all platforms

We now have a high-quality clone() implementation for creating
lightweight threads on Linux/Windows/FreeBSD/NetBSD/OpenBSD.
This commit is contained in:
Justine Tunney 2022-05-12 17:52:13 -07:00
parent 4e62cefa6e
commit fec396037a
43 changed files with 850 additions and 532 deletions

View file

@ -119,7 +119,7 @@ static privileged dontinline int arch_prctl_xnu(int code, int64_t addr) {
case ARCH_SET_GS:
asm volatile(CFLAG_ASM("syscall")
: CFLAG_CONSTRAINT(failed), "=a"(ax)
: "1"(0x3000003), "D"(addr - 0x8a0 /* wat */)
: "1"(0x3000003), "D"(addr - 0x30)
: "rcx", "r11", "memory", "cc");
if (failed) errno = ax, ax = -1;
return ax;