Clean up the clone() code a bit

This commit is contained in:
Justine Tunney 2022-05-17 07:40:00 -07:00
parent ce71677156
commit 2743f3d012
20 changed files with 252 additions and 150 deletions

View file

@ -25,12 +25,12 @@ int cthread_memory_wait32(uint32_t* addr, uint32_t val,
if (__NR_futex != 0xfff) {
int flags = FUTEX_WAIT;
int rc;
register struct timespec* timeout_ asm("r10") = timeout;
asm volatile("syscall"
asm volatile("mov\t%5,%%r10\n\t" // timeout
"syscall"
: "=a"(rc)
: "0"(__NR_futex), "D"(addr), "S"(flags), "d"(val),
"r"(timeout_)
: "rcx", "r11", "cc", "memory");
"g"(timeout)
: "rcx", "r10", "r11", "cc", "memory");
return rc;
}
return -1;