diff mbox series

[v3,13/16] linux-user, ppc: fix clock_nanosleep() for linux-user-ppc

Message ID 20200724064509.331-14-alex.bennee@linaro.org
State Superseded
Headers show
Series candidate fixes for 5.1-rc1 (testing, semihosting, OOM tcg, x86 fpu) | expand

Commit Message

Alex Bennée July 24, 2020, 6:45 a.m. UTC
From: Laurent Vivier <laurent@vivier.eu>


Our safe_clock_nanosleep() returns -1 and updates errno.

We don't need to update the CRF bit in syscall.c because it will
be updated in ppc/cpu_loop.c as the return value is negative.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

Message-Id: <20200722174612.2917566-3-laurent@vivier.eu>
---
 linux-user/syscall.c | 7 -------
 1 file changed, 7 deletions(-)

-- 
2.20.1

Comments

Richard Henderson July 24, 2020, 6:24 p.m. UTC | #1
On 7/23/20 11:45 PM, Alex Bennée wrote:
> From: Laurent Vivier <laurent@vivier.eu>

> 

> Our safe_clock_nanosleep() returns -1 and updates errno.

> 

> We don't need to update the CRF bit in syscall.c because it will

> be updated in ppc/cpu_loop.c as the return value is negative.

> 

> Signed-off-by: Laurent Vivier <laurent@vivier.eu>

> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

> Message-Id: <20200722174612.2917566-3-laurent@vivier.eu>

> ---

>  linux-user/syscall.c | 7 -------

>  1 file changed, 7 deletions(-)


Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~
diff mbox series

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 43a6e283961..f5c4f6b95db 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -11840,13 +11840,6 @@  static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             host_to_target_timespec(arg4, &ts);
         }
 
-#if defined(TARGET_PPC)
-        /* clock_nanosleep is odd in that it returns positive errno values.
-         * On PPC, CR0 bit 3 should be set in such a situation. */
-        if (ret && ret != -TARGET_ERESTARTSYS) {
-            ((CPUPPCState *)cpu_env)->crf[0] |= 1;
-        }
-#endif
         return ret;
     }
 #endif