From patchwork Mon Jun 23 13:26:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 32347 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8645620540 for ; Mon, 23 Jun 2014 13:27:50 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id a41sf25900295yho.9 for ; Mon, 23 Jun 2014 06:27:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=SYHh4+rKvtWk6ijwMytt+d20/84TIFMPWyG56d2N+MM=; b=LjFAX+Ys2bKV3D41nS4SinR+MmC6mMNYCY5C1zLK3FKg4pj2wl2WvnJ+bF+2mvRYLI Dc1afOpsiQ7EXDUidgQ08XPUSHC1QgVQb9YD2tsDpnxzXT5qBVV6iZVkDrh51d8vxKWO titCyPAZrCVA0cUMBK9CPa7h7FcsTay8aDjlhvfM3uPJS4SLImiPKFgOnB7QATiXCItA kyHfjxT/BJgvtGfqKU0UjlDtgEDQ2hD69LBjoysu2V7/W/3QiIw7QHssDE/GTc042dKE tMvqGWbOAPIhm31Qh6x2d5W80tBT+BbAzXkD6ZwuDyyvQSzd4B8HahdLSsYF9eQ+Qdnn 7eLg== X-Gm-Message-State: ALoCoQmCKcbwMOMHJEbzxp6BBNAJPBsupv7x25WDzbuQSy2eVndPE2yhNtDgwtLOB/HvdctkSsi0 X-Received: by 10.58.65.38 with SMTP id u6mr9642000ves.16.1403530070361; Mon, 23 Jun 2014 06:27:50 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.32.203 with SMTP id h69ls1988934qgh.56.gmail; Mon, 23 Jun 2014 06:27:50 -0700 (PDT) X-Received: by 10.58.186.207 with SMTP id fm15mr19558569vec.4.1403530070221; Mon, 23 Jun 2014 06:27:50 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id 6si8980704vct.68.2014.06.23.06.27.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Jun 2014 06:27:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.177 as permitted sender) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id ij19so5844437vcb.22 for ; Mon, 23 Jun 2014 06:27:50 -0700 (PDT) X-Received: by 10.220.44.141 with SMTP id a13mr436849vcf.71.1403530070149; Mon, 23 Jun 2014 06:27:50 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp130617vcb; Mon, 23 Jun 2014 06:27:49 -0700 (PDT) X-Received: by 10.224.13.4 with SMTP id z4mr31940609qaz.51.1403530069689; Mon, 23 Jun 2014 06:27:49 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 16si9030744qgs.13.2014.06.23.06.27.49 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 23 Jun 2014 06:27:49 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:53491 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wz4Hl-0004g0-7B for patch@linaro.org; Mon, 23 Jun 2014 09:27:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55565) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wz4Gi-0003iD-7U for qemu-devel@nongnu.org; Mon, 23 Jun 2014 09:26:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wz4Gd-0001Ao-5i for qemu-devel@nongnu.org; Mon, 23 Jun 2014 09:26:44 -0400 Received: from afflict.kos.to ([92.243.29.197]:50446) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wz4Gc-00019Y-Ng for qemu-devel@nongnu.org; Mon, 23 Jun 2014 09:26:38 -0400 Received: from afflict.kos.to (afflict [92.243.29.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by afflict.kos.to (Postfix) with ESMTPSA id E79F526546; Mon, 23 Jun 2014 15:26:35 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Mon, 23 Jun 2014 16:26:17 +0300 Message-Id: <28e0ce6638fbd4082752886cf5de105b17bddd40.1403529800.git.riku.voipio@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 92.243.29.197 Cc: Hunter Laux Subject: [Qemu-devel] [PULL 02/19] Add support for the arm breakpoint syscall 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: riku.voipio@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Hunter Laux OABI arm used a software interrupt(0xef9f0001) for breakpoints. Since 2005 gdb has used the break instruction(0xe7f001f0) for EABI. Apparently Steel Bank Common Lisp still uses the swi instruction. This is the kernel implementation: http://lxr.free-electrons.com/source/arch/arm/kernel/traps.c#L598 Signed-off-by: Hunter Laux Reviewed-by: Peter Maydell Signed-off-by: Riku Voipio --- linux-user/arm/syscall.h | 1 + linux-user/main.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/linux-user/arm/syscall.h b/linux-user/arm/syscall.h index ce2c2a8..e0d2cc3 100644 --- a/linux-user/arm/syscall.h +++ b/linux-user/arm/syscall.h @@ -29,6 +29,7 @@ struct target_pt_regs { #define ARM_THUMB_SYSCALL 0 #define ARM_NR_BASE 0xf0000 +#define ARM_NR_breakpoint (ARM_NR_BASE + 1) #define ARM_NR_cacheflush (ARM_NR_BASE + 2) #define ARM_NR_set_tls (ARM_NR_BASE + 5) diff --git a/linux-user/main.c b/linux-user/main.c index a87c6f7..9c3eddc 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -807,6 +807,9 @@ void cpu_loop(CPUARMState *env) cpu_set_tls(env, env->regs[0]); env->regs[0] = 0; break; + case ARM_NR_breakpoint: + env->regs[15] -= env->thumb ? 2 : 4; + goto excp_debug; default: gemu_log("qemu: Unsupported ARM syscall: 0x%x\n", n); @@ -850,6 +853,7 @@ void cpu_loop(CPUARMState *env) } break; case EXCP_DEBUG: + excp_debug: { int sig;