void* guest_state, // rsi
const vki_sigset_t *sysmask, // rdx
const vki_sigset_t *postmask, // rcx
- Int sigsetSzB) // r8
+ Int sigsetSzB, // r8
+ UChar *cflag) // r9
Note that sigsetSzB is totally ignored (and irrelevant).
*/
pushq %rdx // -24(%rbp) sysmask
pushq %rcx // -32(%rbp) postmask
pushq %r8 // -40(%rbp) sigsetSzB
+ pushq %r9 // -48(%rbp) cflag
// stack is now aligned
L_$0_1: /* Even though we can't take a signal until the sigprocmask completes,
but hasn't been committed to RAX. */
/* stack contents: 3 words for syscall above, plus our prologue */
- setc 0(%rsp) /* stash returned carry flag */
movq -16(%rbp), %r11 /* r11 = VexGuestAMD64State * */
movq %rax, OFFSET_amd64_RAX(%r11) /* save back to RAX */
movq %rdx, OFFSET_amd64_RDX(%r11) /* save back to RDX */
.if $0 == UNIX
- /* save carry flag to VEX */
- xor %rax, %rax
- movb 0(%rsp), %al
- movq %rax, %rdi /* arg1 = new flag */
- movq %r11, %rsi /* arg2 = vex state */
- addq $$24, %rsp /* remove syscall parameters */
- movl $$1, OFFSET_amd64_SETC(%r11)
- call _LibVEX_GuestAMD64_put_rflag_c
- movq -16(%rbp), %r11
- movl $$0, OFFSET_amd64_SETC(%r11)
+ movq -48(%rbp), %rcx
+ setc 0(%rcx) /* save returned carry flag */
.else
- addq $$24, %rsp /* remove syscall parameters*/
+ addq $$24, %rsp /* remove syscall parameters*/
.endif
L_$0_4: /* Re-block signals. If eip is in [4,5), then the syscall
void* guest_state, // ebp+12
const vki_sigset_t *sysmask, // ebp+16
const vki_sigset_t *postmask, // ebp+20
- Int sigsetSzB) // ebp+24
+ Int sigsetSzB, // ebp+24
+ UChar *cflag) // ebp+28
Note that sigsetSzB is totally ignored (and irrelevant).
*/
L_$0_3: /* In the range [3, 4), the syscall result is in %eax and %edx and C,
but hasn't been committed to the thread state. */
- setc 0(%esp) /* stash returned carry flag */
movl 12(%ebp), %ecx
movl %eax, OFFSET_x86_EAX(%ecx) /* save EAX to vex */
movl %edx, OFFSET_x86_EDX(%ecx) /* save EDX to vex */
.if $0 == UNIX
- /* UNIX: save carry flag to vex */
- subl $$12, %esp
- movl %ecx, 4(%esp)
- movl $$0, 0(%esp)
- movb 12(%esp), %al
- movb %al, 0(%esp)
- movl $$1, OFFSET_x86_SETC(%ecx)
- call _LibVEX_GuestX86_put_eflag_c
- movl 12(%ebp), %ecx
- movl $$0, OFFSET_x86_SETC(%ecx)
- addl $$12, %esp
+ movl 28(%ebp), %ecx
+ setc 0(%ecx) /* save returned carry flag */
.endif
L_$0_4: /* Re-block signals. If eip is in [4,5), then the syscall is
void* guest_state,
const vki_sigset_t *syscall_mask,
const vki_sigset_t *restore_mask,
- Word sigsetSzB ); /* unused */
+ Word sigsetSzB, /* unused */
+ UChar* cflag );
extern
UWord ML_(do_syscall_for_client_mach_WRK)( Word syscallno,
void* guest_state,
/* Save the carry flag. */
# if defined(VGP_amd64_freebsd)
LibVEX_GuestAMD64_put_rflag_c(cflag, &tst->arch.vex);
-
# elif defined(VGP_arm64_freebsd)
LibVEX_GuestARM64_put_nzcv_c(cflag, &tst->arch.vex);
# elif defined(VGP_x86_freebsd)
# error "Unknown platform"
# endif
# elif defined(VGO_darwin)
+ UChar cflag;
switch (VG_DARWIN_SYSNO_CLASS(syscallno)) {
case VG_DARWIN_SYSCALL_CLASS_UNIX:
err = ML_(do_syscall_for_client_unix_WRK)(
VG_DARWIN_SYSNO_FOR_KERNEL(syscallno), &tst->arch.vex,
- syscall_mask, &saved, 0/*unused:sigsetSzB*/
+ syscall_mask, &saved, 0/*unused:sigsetSzB*/, &cflag
);
+ /* Save the carry flag. */
+# if defined(VGP_amd64_darwin)
+ LibVEX_GuestAMD64_put_rflag_c(cflag, &tst->arch.vex);
+# elif defined(VGP_arm64_darwin)
+ LibVEX_GuestARM64_put_nzcv_c(cflag, &tst->arch.vex);
+# elif defined(VGP_x86_darwin)
+ LibVEX_GuestX86_put_eflag_c(cflag, &tst->arch.vex);
+# else
+# error "Unknown platform"
+# endif
break;
case VG_DARWIN_SYSCALL_CLASS_MACH:
err = ML_(do_syscall_for_client_mach_WRK)(