linux-user, ppc: fix clock_nanosleep() for linux-user-ppc
authorLaurent Vivier <laurent@vivier.eu>
Fri, 24 Jul 2020 06:45:06 +0000 (07:45 +0100)
committerAlex Bennée <alex.bennee@linaro.org>
Mon, 27 Jul 2020 08:41:47 +0000 (09:41 +0100)
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>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20200722174612.2917566-3-laurent@vivier.eu>
Message-Id: <20200724064509.331-14-alex.bennee@linaro.org>

linux-user/syscall.c

index 43a6e283961b782f88f3fe9e237537cdbadd9c19..f5c4f6b95db4510f12c725bf4acf4dd06d917347 100644 (file)
@@ -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