linux syscall trashes rcx & r11

This commit is contained in:
2025-12-04 01:02:29 -06:00
parent 28d44f2bbf
commit 511bf09d65

4
lib.h
View File

@@ -13,7 +13,9 @@ static
void write(uint64_t fileno, void *buffer, size_t len) {
uint64_t a,d;
asm volatile("syscall"
:"=a"(a),"=d"(d):"a"(SYS_write),"D"(fileno),"S"(buffer),"d"(len):"memory");
:"=a"(a),"=d"(d)
:"a"(SYS_write),"D"(fileno),"S"(buffer),"d"(len)
:"cc","memory","%rcx","%r11");
}
[[noreturn]] static