From: Julian Seward Date: Mon, 19 Mar 2007 15:29:23 +0000 (+0000) Subject: Followup to r6650: tidy up sys_sigreturn/sys_rt_sigreturn on ppc32/64-linux. X-Git-Tag: svn/VALGRIND_3_3_0~314 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a64b0bfb0cb465e409aec7d5ae0ebe2306fc2081;p=thirdparty%2Fvalgrind.git Followup to r6650: tidy up sys_sigreturn/sys_rt_sigreturn on ppc32/64-linux. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6652 --- diff --git a/coregrind/m_syswrap/syswrap-ppc32-aix5.c b/coregrind/m_syswrap/syswrap-ppc32-aix5.c index 04ce6bac1e..c6336e99cd 100644 --- a/coregrind/m_syswrap/syswrap-ppc32-aix5.c +++ b/coregrind/m_syswrap/syswrap-ppc32-aix5.c @@ -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; } diff --git a/coregrind/m_syswrap/syswrap-ppc64-aix5.c b/coregrind/m_syswrap/syswrap-ppc64-aix5.c index 7d7fa8c95b..cde065b2c8 100644 --- a/coregrind/m_syswrap/syswrap-ppc64-aix5.c +++ b/coregrind/m_syswrap/syswrap-ppc64-aix5.c @@ -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; }