From patchwork Wed Dec 4 19:33:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 22029 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f70.google.com (mail-oa0-f70.google.com [209.85.219.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 66F2023FCE for ; Wed, 4 Dec 2013 19:33:36 +0000 (UTC) Received: by mail-oa0-f70.google.com with SMTP id m1sf54431815oag.1 for ; Wed, 04 Dec 2013 11:33:35 -0800 (PST) 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:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=YlB1vyEGK6Afu9xE91MF2kmddn4W+Ehlz1xwGdMKXL4=; b=hTAD/Zzq9Dc562lwVLdrKjEhFvbLc8FioeQpybpwgQVuwxKGTqZKdCCYWil9fd2/JM lbjuEWpiz+zo08W+qK4dZsM2a1YQ/C/a6YA9lruyAuczOasUcIkrsKigZUzUyS09xqup 4qfrxw4mfgVi4/a6OfFTSjhAxl5FWBcllDvXKdDKboF30+qMMIXxYUH5dStVKz8qBR3X 5P/DKhKHqLYiMfduKTKokU9rTENoBB1qFoNK2d0FtUR9nEM3nq/65CCIsdNSm0d3NbZF wiqVsrcIIazmsho/H3TMUDQvJXkLr78t3pd5CdLY6TxOIepCFYUIDM48DfYvRVumTWGN cKLg== X-Gm-Message-State: ALoCoQne69xEWmOLrt0JpfFzQ7ZlN/o+lBmQp9l9khqgpZUIGWD9QfO6ri+/9D5kKiNLWgukXKWR X-Received: by 10.182.22.73 with SMTP id b9mr25419310obf.17.1386185615620; Wed, 04 Dec 2013 11:33:35 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.81.229 with SMTP id d5ls460980qey.64.gmail; Wed, 04 Dec 2013 11:33:35 -0800 (PST) X-Received: by 10.52.233.2 with SMTP id ts2mr1293223vdc.44.1386185615481; Wed, 04 Dec 2013 11:33:35 -0800 (PST) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id o7si33260334vcl.60.2013.12.04.11.33.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Dec 2013 11:33:35 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.181; Received: by mail-ve0-f181.google.com with SMTP id oy12so12784628veb.12 for ; Wed, 04 Dec 2013 11:33:35 -0800 (PST) X-Received: by 10.58.180.227 with SMTP id dr3mr1640637vec.36.1386185615349; Wed, 04 Dec 2013 11:33:35 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp318428vcz; Wed, 4 Dec 2013 11:33:35 -0800 (PST) X-Received: by 10.15.108.73 with SMTP id cc49mr9053752eeb.93.1386185613714; Wed, 04 Dec 2013 11:33:33 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id e2si24920833eeg.219.2013.12.04.11.33.32 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 04 Dec 2013 11:33:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1VoICP-0006dy-7J; Wed, 04 Dec 2013 19:33:29 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Alexander Graf , C Fontana , Dirk Mueller , Michael Matz , Laurent Desnogues , Richard Henderson , kvmarm@lists.cs.columbia.edu Subject: [PATCH v2 02/12] target-arm: A64: add set_pc cpu method Date: Wed, 4 Dec 2013 19:33:19 +0000 Message-Id: <1386185609-25505-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1386185609-25505-1-git-send-email-peter.maydell@linaro.org> References: <1386185609-25505-1-git-send-email-peter.maydell@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Alexander Graf When executing translation blocks we need to be able to recover our program counter. Add a method to set it for AArch64 CPUs. This covers user-mode, but for system mode emulation we will need to check if the CPU is in an AArch32 execution state. Signed-off-by: Alexander Graf Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target-arm/cpu64.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/target-arm/cpu64.c b/target-arm/cpu64.c index 3e99c21..04ce879 100644 --- a/target-arm/cpu64.c +++ b/target-arm/cpu64.c @@ -68,11 +68,22 @@ static void aarch64_cpu_finalizefn(Object *obj) { } +static void aarch64_cpu_set_pc(CPUState *cs, vaddr value) +{ + ARMCPU *cpu = ARM_CPU(cs); + /* + * TODO: this will need updating for system emulation, + * when the core may be in AArch32 mode. + */ + cpu->env.pc = value; +} + static void aarch64_cpu_class_init(ObjectClass *oc, void *data) { CPUClass *cc = CPU_CLASS(oc); cc->dump_state = aarch64_cpu_dump_state; + cc->set_pc = aarch64_cpu_set_pc; cc->gdb_read_register = aarch64_cpu_gdb_read_register; cc->gdb_write_register = aarch64_cpu_gdb_write_register; cc->gdb_num_core_regs = 34;