summaryrefslogtreecommitdiff
path: root/lib/std/syscall+freebsd-x64.s
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std/syscall+freebsd-x64.s')
-rw-r--r--lib/std/syscall+freebsd-x64.s21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/std/syscall+freebsd-x64.s b/lib/std/syscall+freebsd-x64.s
new file mode 100644
index 0000000..8002099
--- /dev/null
+++ b/lib/std/syscall+freebsd-x64.s
@@ -0,0 +1,21 @@
+.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
+ movq %rsi,%rdi
+ movq %rdx,%rsi
+ movq %rcx,%rdx
+ movq %r8,%r10
+ movq %r9,%r8
+ movq 8(%rsp),%r9
+
+ syscall
+
+ ret
+