summaryrefslogtreecommitdiff
path: root/lib/std/syscall+linux-x64.s
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std/syscall+linux-x64.s')
-rw-r--r--lib/std/syscall+linux-x64.s22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/std/syscall+linux-x64.s b/lib/std/syscall+linux-x64.s
new file mode 100644
index 0000000..f7c020d
--- /dev/null
+++ b/lib/std/syscall+linux-x64.s
@@ -0,0 +1,22 @@
+.globl sys$syscall
+sys$syscall:
+ /*
+ hack: We load 6 args regardless of
+ how many we actually have. This may
+ load junk values, but if the syscall
+ doesn't use them, it's going to be
+ harmless.
+ */
+ movq %rdi,%rax
+ /* 8(%rsp): hidden type arg */
+ movq 16(%rsp),%rdi
+ movq 24(%rsp),%rsi
+ movq 32(%rsp),%rdx
+ movq 40(%rsp),%r10
+ movq 48(%rsp),%r8
+ movq 56(%rsp),%r9
+
+ syscall
+
+ ret
+