summaryrefslogtreecommitdiff
path: root/libstd/syscall+linux-x64.s
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-10-03 20:31:00 -0400
committerOri Bernstein <ori@eigenstate.org>2014-10-03 20:31:00 -0400
commit976f82e68f9746bae7732eb762e9e8b68c84c805 (patch)
tree3c6592b6e2e1fdacf7fd89dcf920ec102fc2be3a /libstd/syscall+linux-x64.s
parent96c8b599027a762ccaf6bd5c7633e3ede3850153 (diff)
downloadmc-976f82e68f9746bae7732eb762e9e8b68c84c805.tar.gz
Asm files are architecture specific.
Diffstat (limited to 'libstd/syscall+linux-x64.s')
-rw-r--r--libstd/syscall+linux-x64.s39
1 files changed, 39 insertions, 0 deletions
diff --git a/libstd/syscall+linux-x64.s b/libstd/syscall+linux-x64.s
new file mode 100644
index 0000000..c810945
--- /dev/null
+++ b/libstd/syscall+linux-x64.s
@@ -0,0 +1,39 @@
+.globl std$syscall
+std$syscall:
+ pushq %rbp
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %r10
+ pushq %r8
+ pushq %r9
+ pushq %rcx
+ pushq %r11
+ /*
+ 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 80 (%rsp),%rax
+ movq 88 (%rsp),%rdi
+ movq 96 (%rsp),%rsi
+ movq 104(%rsp),%rdx
+ movq 112(%rsp),%r10
+ movq 120(%rsp),%r8
+ movq 128(%rsp),%r9
+
+ syscall
+
+ popq %r11
+ popq %rcx
+ popq %r9
+ popq %r8
+ popq %r10
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ popq %rbp
+ ret
+