summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEC2 Default User <ec2-user@ip-172-31-17-35.ec2.internal>2017-05-16 01:35:31 +0000
committerEC2 Default User <ec2-user@ip-172-31-17-35.ec2.internal>2017-05-16 01:35:31 +0000
commitc67d39e69ed554efcd252af61179afa7a192ea1a (patch)
tree6621316fdc6b22297860c9d1d1129e9bf823cc83
parent4792730ddf78a778496334c97709c1e0da06a61d (diff)
downloadmc-c67d39e69ed554efcd252af61179afa7a192ea1a.tar.gz
Allow for a 7th syscall argument for mmap.
....but there aren't any 9th ones, right?
-rw-r--r--lib/sys/syscall+openbsd-x64.s10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/sys/syscall+openbsd-x64.s b/lib/sys/syscall+openbsd-x64.s
index ea4a9b7..d716798 100644
--- a/lib/sys/syscall+openbsd-x64.s
+++ b/lib/sys/syscall+openbsd-x64.s
@@ -15,12 +15,22 @@ sys$syscall:
movq 40(%rsp),%r10
movq 48(%rsp),%r8
movq 56(%rsp),%r9
+ /*
+ if there syscalls are more than 6
+ args (eg, mmap), the remaining args
+ are on the stack, with 8 dummy bytes
+ for a return address.
+ */
+ movq 64(%rsp),%rbx
+ pushq %rbx
+ pushq %rbx
syscall
jae .success
negq %rax
.success:
+ addq $16,%rsp
ret
/* __tfork_thread(tfp : tforkparams#, sz : size, fn : void#, arg : void#-> tid) */