summaryrefslogtreecommitdiff
path: root/libstd/syscall+linux-x64.s
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-08-21 18:54:53 -0700
committerOri Bernstein <ori@eigenstate.org>2015-08-21 19:08:40 -0700
commit14aeadb41737f1765b6f3489f3b8da330aeccf39 (patch)
tree58eeceec013d79b26e024f47a065896e5a44a21d /libstd/syscall+linux-x64.s
parent0bd2678722f5f70a063190d54d12e62420f02b05 (diff)
downloadmc-14aeadb41737f1765b6f3489f3b8da330aeccf39.tar.gz
Get closer to the C ABI
Diffstat (limited to 'libstd/syscall+linux-x64.s')
-rw-r--r--libstd/syscall+linux-x64.s35
1 files changed, 8 insertions, 27 deletions
diff --git a/libstd/syscall+linux-x64.s b/libstd/syscall+linux-x64.s
index 0393497..f7c020d 100644
--- a/libstd/syscall+linux-x64.s
+++ b/libstd/syscall+linux-x64.s
@@ -1,15 +1,5 @@
.globl sys$syscall
sys$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
@@ -17,25 +7,16 @@ sys$syscall:
doesn't use them, it's going to be
harmless.
*/
- movq 80 (%rsp),%rax
- /* 88: hidden type arg */
- movq 96 (%rsp),%rdi
- movq 104(%rsp),%rsi
- movq 112(%rsp),%rdx
- movq 120(%rsp),%r10
- movq 128(%rsp),%r8
- movq 136(%rsp),%r9
+ 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
- popq %r11
- popq %rcx
- popq %r9
- popq %r8
- popq %r10
- popq %rdx
- popq %rsi
- popq %rdi
- popq %rbp
ret