From patchwork Tue May 29 15:30:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 161760 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D5799B6FBB for ; Wed, 30 May 2012 01:30:58 +1000 (EST) Received: from localhost ([::1]:34651 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SZONs-0006Py-OA for incoming@patchwork.ozlabs.org; Tue, 29 May 2012 11:30:56 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SZONh-0006Ow-55 for qemu-devel@nongnu.org; Tue, 29 May 2012 11:30:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SZONY-0006fw-77 for qemu-devel@nongnu.org; Tue, 29 May 2012 11:30:44 -0400 Received: from cantor2.suse.de ([195.135.220.15]:53928 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SZONY-0006f1-1G for qemu-devel@nongnu.org; Tue, 29 May 2012 11:30:36 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 0ADBB96874; Tue, 29 May 2012 17:30:33 +0200 (CEST) From: Alexander Graf To: qemu-devel Developers Date: Tue, 29 May 2012 17:30:26 +0200 Message-Id: <1338305426-19653-1-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.6.0.2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: peter.maydell@linaro.org, riku.voipio@iki.fi Subject: [Qemu-devel] [PATCH] linux-user: ARM: Ignore immediate value for svc in thumb mode 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 When running in thumb mode, Linux doesn't evaluate the immediate value of the svc instruction, but instead just always assumes the syscall number to be in r7. This fixes executing go_bootstrap while building go for me. Signed-off-by: Alexander Graf Reviewed-by: Peter Maydell --- linux-user/main.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 191b750..a7fefe7 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -822,8 +822,7 @@ void cpu_loop(CPUARMState *env) } else if (n == ARM_NR_semihosting || n == ARM_NR_thumb_semihosting) { env->regs[0] = do_arm_semihosting (env); - } else if (n == 0 || n >= ARM_SYSCALL_BASE - || (env->thumb && n == ARM_THUMB_SYSCALL)) { + } else if (n == 0 || n >= ARM_SYSCALL_BASE || env->thumb) { /* linux syscall */ if (env->thumb || n == 0) { n = env->regs[7];