UWord a5, /* %r9 */
UWord a6, /* 8(%rsp) */
UWord a7, /* 16(%rsp) */
- UWord a8, /* 24(%rsp) */
UInt *flags, /* 32(%rsp) */
UWord *rv2 /* 40(%rsp) */
);
" movq %r8, %r10\n" /* a4 */
" movq %r9, %r8\n" /* a5 */
" movq 16(%rbp), %r9\n" /* a6 last register arg from stack, account for %rbp */
-" movq 32(%rbp), %r11\n" /* a8 from stack */
-" pushq %r11\n"
" movq 24(%rbp), %r11\n" /* a7 from stack */
-" pushq %r11\n"
+" pushq %r11\n"
" subq $8,%rsp\n" /* fake return addr */
" syscall\n"
" jb 1f\n"
-" movq 48(%rbp),%rsi\n" /* success */
+" movq 40(%rbp),%rsi\n" /* success */
" movq %rdx, (%rsi)\n" /* second return value */
" movq %rbp, %rsp\n"
" popq %rbp\n"
" ret\n"
"1:\n" /* error path */
-" movq 40(%rbp), %rsi\n" /* flags */
+" movq 32(%rbp), %rsi\n" /* flags */
" movl $1,(%rsi)\n"
" movq %rbp, %rsp\n"
" popq %rbp\n"
UWord val2 = 0;
UInt err = 0;
val = do_syscall_WRK(sysno, a1, a2, a3, a4, a5,
- a6, a7, a8, &err, &val2);
+ a6, a7, &err, &val2);
return VG_(mk_SysRes_amd64_freebsd)( val, val2, (err & 1) != 0 ? True : False);
# elif defined(VGP_arm64_freebsd)
movq OFFSET_amd64_R10(%r11), %r10
movq OFFSET_amd64_R8(%r11), %r8
movq OFFSET_amd64_R9(%r11), %r9
- /* 2 stack parameters plus return address (ignored by syscall) */
- /* @todo PJF there is a potential bug here
- * syscall can take up to 8 arguments
- * but when syscall0 or syscall198 is being used
- * one argument is used for the syscall0/198 id
- * and one for the actual id and in this case
- * there could be 3 stack parameters.
- * However, only mmap takes 8 arguments
- * and only on x86. It would be an unlikely combination,
- * but this might break one day. */
+ /* get RSP */
movq OFFSET_amd64_RSP(%r11), %r11 /* r11 = simulated RSP */
+ /* 2 stack parameters */
movq 16(%r11), %rax
pushq %rax
movq 8(%r11), %rax