]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Darwin syscall: fix signal masks
authorPaul Floyd <pjfloyd@wanadoo.fr>
Mon, 10 Nov 2025 21:15:51 +0000 (22:15 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Mon, 10 Nov 2025 21:15:51 +0000 (22:15 +0100)
Merged From Louis Brunner's git repo. Fixes a few more regtest
failures with OSX 10.13 amd64.

coregrind/m_syswrap/syscall-amd64-darwin.S

index 456b4c84ceffd083ddb3cdbccb9683c9208a8515..fbc81ff5df1c8eb971d4c80891bdc0164c78c87b 100644 (file)
@@ -99,18 +99,13 @@ L_$0_1:     /* Even though we can't take a signal until the sigprocmask completes,
           If rip is in the range [1,2), the syscall hasn't been started yet */
 
        /* Set the signal mask which should be current during the syscall. */
-       /* GrP fixme signals
-           DDD: JRS fixme: use __NR___pthread_sigmask, not __NR_rt_sigprocmask
-       movq    $__NR_rt_sigprocmask, %rax      // syscall #
-       movq    $VKI_SIG_SETMASK, %rdi          // how
+       movq    $$__NR___pthread_sigmask, %rax  // syscall #
+       movq    $$VKI_SIG_SETMASK, %rdi         // how
        movq    -24(%rbp), %rsi                 // sysmask
        movq    -32(%rbp), %rdx                 // postmask
-       movq    -40(%rbp), %r10                 // sigsetSzB in r10 not rcx
-       DDD: fixme return address
        syscall
 
-       jnc     7f      // sigprocmask failed
-       */
+       jc      L_$0_7  // sigprocmask failed
        
        /* OK, that worked.  Now do the syscall proper. */
 
@@ -156,35 +151,26 @@ L_$0_3:   /* In the range [3, 4), the syscall result is in %rax,
 
 L_$0_4:        /* Re-block signals.  If eip is in [4,5), then the syscall 
           is complete and we needn't worry about it. */
-       /* GrP fixme signals
-           DDD: JRS fixme: use __NR___pthread_sigmask, not __NR_rt_sigprocmask
-       PUSH_di_si_dx_cx_8
-
-       movq    $__NR_rt_sigprocmask, %rax      // syscall #
-       movq    $VKI_SIG_SETMASK, %rdi          // how
-       movq    %rcx, %rsi                      // postmask
+       movq    $$__NR___pthread_sigmask, %rax  // syscall #
+       movq    $$VKI_SIG_SETMASK, %rdi         // how
+       movq    -32(%rbp), %rsi                 // postmask
        xorq    %rdx, %rdx                      // NULL
-       movq    %r8, %r10                       // sigsetSzB
-       DDD: fixme return address
        syscall
 
-       POP_di_si_dx_cx_8
+       jc      L_$0_7  // sigprocmask failed
 
-       jnc     7f      // sigprocmask failed
-       */
 L_$0_5:        /* now safe from signals */
        movq    $$0, %rax       /* SUCCESS */
        movq    %rbp, %rsp
        popq    %rbp
        ret
 
-/* GrP fixme signals
 L_$0_7:        // failure:      return 0x8000 | error code
-       DDD: fixme return value
+       andq    $$0x7FFF, %rax
+       orq     $$0x8000, %rax
        movq    %rbp, %rsp
        popq    %rbp
        ret
-*/
 
 .endmacro