]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Followup to r6650: tidy up sys_sigreturn/sys_rt_sigreturn on ppc32/64-linux.
authorJulian Seward <jseward@acm.org>
Mon, 19 Mar 2007 15:29:23 +0000 (15:29 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 19 Mar 2007 15:29:23 +0000 (15:29 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6652

coregrind/m_syswrap/syswrap-ppc32-aix5.c
coregrind/m_syswrap/syswrap-ppc64-aix5.c

index 04ce6bac1eae861e18ac5259f5e568b53461a656..c6336e99cd9a56a29f30e712a7b0a3960b7c6932 100644 (file)
@@ -669,9 +669,11 @@ POST(sys_thread_setstate)
 
 PRE(sys_FAKE_SIGRETURN)
 {
-   ThreadState* tst;
+   /* See comments on PRE(sys_rt_sigreturn) in syswrap-amd64-linux.c for
+      an explanation of what follows. */
    /* This handles the fake signal-return system call created by
       sigframe-ppc32-aix5.c. */
+
    PRINT("FAKE_SIGRETURN ( )");
 
    vg_assert(VG_(is_valid_tid)(tid));
@@ -682,17 +684,13 @@ PRE(sys_FAKE_SIGRETURN)
       in the process restoring the pre-signal guest state. */
    VG_(sigframe_destroy)(tid, True);
 
-   /* Now the pre-signal registers are restored.  Unfortunately the
-      syscall driver logic will want to copy back the syscall result
-      (not that there is one) into guest r3/r4.  So we'd better cook
-      up a syscall result which, when copied back, makes no change. */ 
-   tst = VG_(get_ThreadState)(tid);
-   SET_STATUS_from_SysRes( 
-      VG_(mk_SysRes_ppc32_aix5)(
-         tst->arch.vex.guest_GPR3,
-         tst->arch.vex.guest_GPR4 
-      )
-   );
+   /* Tell the driver not to update the guest state with the "result",
+      and set a bogus result to keep it happy. */
+   *flags |= SfNoWriteResult;
+   SET_STATUS_Success(0);
+
+   /* Check to see if any signals arose as a result of this. */
+   *flags |= SfPollAfter;
 }
 
 
index 7d7fa8c95b699d9a587e7223f0e6fc24ffbef110..cde065b2c898cef6283f6bffe12b2c02c71153f8 100644 (file)
@@ -579,9 +579,11 @@ POST(sys_thread_setstate)
 
 PRE(sys_FAKE_SIGRETURN)
 {
-   ThreadState* tst;
+   /* See comments on PRE(sys_rt_sigreturn) in syswrap-amd64-linux.c for
+      an explanation of what follows. */
    /* This handles the fake signal-return system call created by
       sigframe-ppc64-aix5.c. */
+
    PRINT("FAKE_SIGRETURN ( )");
 
    vg_assert(VG_(is_valid_tid)(tid));
@@ -592,18 +594,12 @@ PRE(sys_FAKE_SIGRETURN)
       in the process restoring the pre-signal guest state. */
    VG_(sigframe_destroy)(tid, True);
 
-   /* Now the pre-signal registers are restored.  Unfortunately the
-      syscall driver logic will want to copy back the syscall result
-      (not that there is one) into guest r3/r4.  So we'd better cook
-      up a syscall result which, when copied back, makes no change. */ 
-   tst = VG_(get_ThreadState)(tid);
-   SET_STATUS_from_SysRes( 
-      VG_(mk_SysRes_ppc64_aix5)(
-         tst->arch.vex.guest_GPR3,
-         tst->arch.vex.guest_GPR4 
-      )
-   );
+   /* Tell the driver not to update the guest state with the "result",
+      and set a bogus result to keep it happy. */
+   *flags |= SfNoWriteResult;
+   SET_STATUS_Success(0);
 
+   /* Check to see if any signals arose as a result of this. */
    *flags |= SfPollAfter;
 }