The ABI document is correct w.r.t. _syscall5().

diff --git a/include/arch/x86_64/klibc/archsys.h b/include/arch/x86_64/klibc/archsys.h
index 0602532..e52a19a 100644
--- a/include/arch/x86_64/klibc/archsys.h
+++ b/include/arch/x86_64/klibc/archsys.h
@@ -17,8 +17,8 @@
 { \
 long __res; \
 register long __r10 asm("%r10") = (long)arg4;
-register long __r9  asm("%r9")  = (long)arg5; /* Should be %r8 per the docs*/
-register long __r8  asm("%r8")  = (long)arg6; /* Should be %r9 per the docs */
+register long __r8  asm("%r8")  = (long)arg5;
+register long __r9  asm("%r9")  = (long)arg6;
 __asm__ volatile (__syscall \
         : "=a" (__res) \
         : "0" (__NR_##name),"D" ((long)(arg1)),"S" ((long)(arg2)), \
diff --git a/klibc/arch/x86_64/include/klibc/archsys.h b/klibc/arch/x86_64/include/klibc/archsys.h
index 0602532..e52a19a 100644
--- a/klibc/arch/x86_64/include/klibc/archsys.h
+++ b/klibc/arch/x86_64/include/klibc/archsys.h
@@ -17,8 +17,8 @@
 { \
 long __res; \
 register long __r10 asm("%r10") = (long)arg4;
-register long __r9  asm("%r9")  = (long)arg5; /* Should be %r8 per the docs*/
-register long __r8  asm("%r8")  = (long)arg6; /* Should be %r9 per the docs */
+register long __r8  asm("%r8")  = (long)arg5;
+register long __r9  asm("%r9")  = (long)arg6;
 __asm__ volatile (__syscall \
         : "=a" (__res) \
         : "0" (__NR_##name),"D" ((long)(arg1)),"S" ((long)(arg2)), \