From patchwork Thu Oct 27 12:02:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 122122 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5A40C1007D8 for ; Thu, 27 Oct 2011 23:03:18 +1100 (EST) Received: from localhost ([::1]:55282 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJOfx-0002Y4-Fq for incoming@patchwork.ozlabs.org; Thu, 27 Oct 2011 08:03:13 -0400 Received: from eggs.gnu.org ([140.186.70.92]:38041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJOfq-0002Xt-FN for qemu-devel@nongnu.org; Thu, 27 Oct 2011 08:03:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RJOfj-0003L1-84 for qemu-devel@nongnu.org; Thu, 27 Oct 2011 08:03:06 -0400 Received: from afflict.kos.to ([92.243.29.197]:35240) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJOfj-0003KT-19 for qemu-devel@nongnu.org; Thu, 27 Oct 2011 08:02:59 -0400 Received: by afflict.kos.to (Postfix, from userid 1000) id 8331526678; Thu, 27 Oct 2011 12:02:56 +0000 (UTC) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Thu, 27 Oct 2011 15:02:56 +0300 Message-Id: <9e0e2f967b17fc88cd288963e9cb1187d4b3841b.1319716562.git.riku.voipio@linaro.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 92.243.29.197 Cc: Richard Henderson Subject: [Qemu-devel] [PATCH 10/10] ppc64-linux-user: Fix syscall return type. 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 From: Richard Henderson Use target_ulong instead of hard-coded uint32_t. Remove the disabled printf's that are redundant with -strace. Signed-off-by: Richard Henderson Signed-off-by: Riku Voipio --- linux-user/main.c | 13 +++---------- 1 files changed, 3 insertions(+), 10 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index c36a8af..d1bbc57 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -1341,7 +1341,7 @@ void cpu_loop(CPUPPCState *env) { target_siginfo_t info; int trapnr; - uint32_t ret; + target_ulong ret; for(;;) { cpu_exec_start(env); @@ -1704,27 +1704,20 @@ void cpu_loop(CPUPPCState *env) * PPC ABI uses overflow flag in cr0 to signal an error * in syscalls. */ -#if 0 - printf("syscall %d 0x%08x 0x%08x 0x%08x 0x%08x\n", env->gpr[0], - env->gpr[3], env->gpr[4], env->gpr[5], env->gpr[6]); -#endif env->crf[0] &= ~0x1; 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 == (uint32_t)(-TARGET_QEMU_ESIGRETURN)) { + if (ret == (target_ulong)(-TARGET_QEMU_ESIGRETURN)) { /* Returning from a successful sigreturn syscall. Avoid corrupting register state. */ break; } - if (ret > (uint32_t)(-515)) { + if (ret > (target_ulong)(-515)) { env->crf[0] |= 0x1; ret = -ret; } env->gpr[3] = ret; -#if 0 - printf("syscall returned 0x%08x (%d)\n", ret, ret); -#endif break; case POWERPC_EXCP_STCX: if (do_store_exclusive(env)) {