]> git.saurik.com Git - apple/libplatform.git/blobdiff - src/setjmp/x86_64/_sigtramp.s
libplatform-177.200.16.tar.gz
[apple/libplatform.git] / src / setjmp / x86_64 / _sigtramp.s
index a528650e326487599a59b9bb780f67b7696b5cbf..3d7a395fb4cc1c5671f88922f259b94397362433 100644 (file)
@@ -43,7 +43,8 @@
 
 /* register use:
        %rbx    uctx
-       
+       %r12    token
+
 void
 _sigtramp(
        union __sigaction_u __sigaction_u,      %rdi
@@ -51,9 +52,13 @@ _sigtramp(
        int                     sig,            %rdx
        siginfo_t               *sinfo,         %rcx
        ucontext_t              *uctx           %r8
+       uintptr_t               token           %r8
 )
 */
 
+#if RDAR_35834092
+       .private_extern __sigtramp
+#endif
        .globl __sigtramp
        .text
        .align 4,0x90
@@ -71,6 +76,8 @@ Lstart:
 #endif
        /* Save uctx in %rbx.  */
        movq    %r8, %rbx
+       /* Save token in %r12.  */
+       movq    %r9, %r12
        /* Call the signal handler.
           Some variants are not supposed to get the last two parameters,
           but the test to prevent this is more expensive than just passing
@@ -86,7 +93,9 @@ Lcall_end:
 #endif
        movq    %rbx, %rdi
        movl    $ UC_FLAVOR, %esi
+       movq    %r12, %rdx
        callq   ___sigreturn
+       ud2 /* __sigreturn returning is a fatal error */
        ret
 Lend: