From patchwork Sat Sep 5 23:57:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timothy Baldwin X-Patchwork-Id: 514872 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5B9E71401DE for ; Sun, 6 Sep 2015 10:04:54 +1000 (AEST) Received: from localhost ([::1]:43589 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYNS0-0006gr-EH for incoming@patchwork.ozlabs.org; Sat, 05 Sep 2015 20:04:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYNLi-00034Y-C1 for qemu-devel@nongnu.org; Sat, 05 Sep 2015 19:58:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZYNLc-0005tG-V4 for qemu-devel@nongnu.org; Sat, 05 Sep 2015 19:58:21 -0400 Received: from avasout06.plus.net ([212.159.14.18]:39202) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYNLc-0005si-Py for qemu-devel@nongnu.org; Sat, 05 Sep 2015 19:58:16 -0400 Received: from bfg ([87.114.133.92]) by avasout06 with smtp id DbyE1r00A1zmLPr01byGe7; Sun, 06 Sep 2015 00:58:16 +0100 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=E4sw3vpl c=1 sm=1 tr=0 a=wMIFfKY+zwUDgD4aAwecrg==:117 a=wMIFfKY+zwUDgD4aAwecrg==:17 a=0Bzu9jTXAAAA:8 a=FJhpQO9QAAAA:8 a=h_6DSLV0AAAA:8 a=ff-B7xzCdYMA:10 a=WaWpzLjrs-fue4xSSHoA:9 Received: from tim by bfg with local (Exim 4.84) (envelope-from ) id 1ZYNLa-0008VA-G4; Sun, 06 Sep 2015 00:58:14 +0100 From: Timothy E Baldwin To: qemu-devel@nongnu.org Date: Sun, 6 Sep 2015 00:57:01 +0100 Message-Id: <1441497448-32489-8-git-send-email-T.E.Baldwin99@members.leeds.ac.uk> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1441497448-32489-1-git-send-email-T.E.Baldwin99@members.leeds.ac.uk> References: <1441497448-32489-1-git-send-email-T.E.Baldwin99@members.leeds.ac.uk> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 212.159.14.18 Cc: riku.voipio@iki.fi, Timothy E Baldwin Subject: [Qemu-devel] [PATCH 07/34] linux-user: Support for restarting system calls for PPC targets X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Timothy Edward Baldwin Reviewed-by: Peter Maydell --- linux-user/main.c | 4 ++++ linux-user/ppc/syscall.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/linux-user/main.c b/linux-user/main.c index 124e9cc..5e9e3a8 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -1948,6 +1948,10 @@ void cpu_loop(CPUPPCState *env) ret = do_syscall(env, env->gpr[0], env->gpr[3], env->gpr[4], env->gpr[5], env->gpr[6], env->gpr[7], env->gpr[8], 0, 0); + if (ret == (target_ulong)(-TARGET_ERESTARTSYS)) { + env->nip -= 4; + break; + } if (ret == (target_ulong)(-TARGET_QEMU_ESIGRETURN)) { /* Returning from a successful sigreturn syscall. Avoid corrupting register state. */ diff --git a/linux-user/ppc/syscall.h b/linux-user/ppc/syscall.h index 532cbbd..e75da7f 100644 --- a/linux-user/ppc/syscall.h +++ b/linux-user/ppc/syscall.h @@ -71,3 +71,5 @@ struct target_revectored_struct { #define TARGET_MINSIGSTKSZ 2048 #define TARGET_MLOCKALL_MCL_CURRENT 0x2000 #define TARGET_MLOCKALL_MCL_FUTURE 0x4000 + +#define TARGET_USE_ERESTARTSYS 1