From patchwork Tue Dec 3 21:51:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 22002 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D8B9A202DA for ; Tue, 3 Dec 2013 21:52:34 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id ld13sf32746452vcb.1 for ; Tue, 03 Dec 2013 13:52:34 -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=Lv1HJA3MhR4uyc1AymN/k3rriS5nIUBcf0Zngc7BEDw=; b=U2mRTsSWDmWBO7YGXrArdem/E57+KylM9eWlNp0LEojeWmRfygdUnXOcFP0VdEvd5p CtnqOCu8nS7R74ZkZtsSQvVardR5Gr5EFohbqcqZMc+oxyyk+syoIXz4ZQ+ILHoFL+aa gOXzJxU3uu4sBU7Vh/NCCLn/5el0PTMrVKzrih4EPO3CXQHduL8C0ygG+6zyR5Zak8hA 5kdcMwRYHYRPLNpirydXShrBLkCQw9J7l5GTOf6wPsa25LdbU4K+CJwCG9XPD5+/DKZs 6YtrZJ40eohVd1tj/d6VBJSa8lQSF37OGKZfXC8gGTDNfekpK8GhikiHQfQzP15fTgup znRw== X-Gm-Message-State: ALoCoQliD54aWedRnDcgQwrpjYmX5kcNtNsdTllgo9T9O2t62+nQNmBYyGss5C6EMeFiv0i5B05Y X-Received: by 10.236.220.39 with SMTP id n37mr33047333yhp.15.1386107554675; Tue, 03 Dec 2013 13:52:34 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.82.193 with SMTP id k1ls1300qey.89.gmail; Tue, 03 Dec 2013 13:52:34 -0800 (PST) X-Received: by 10.52.164.203 with SMTP id ys11mr520555vdb.37.1386107554541; Tue, 03 Dec 2013 13:52:34 -0800 (PST) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id tj7si13124985vdc.46.2013.12.03.13.52.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Dec 2013 13:52:34 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id ht10so10763151vcb.1 for ; Tue, 03 Dec 2013 13:52:34 -0800 (PST) X-Received: by 10.58.232.228 with SMTP id tr4mr74634vec.34.1386107554364; Tue, 03 Dec 2013 13:52:34 -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 u4csp243344vcz; Tue, 3 Dec 2013 13:52:34 -0800 (PST) X-Received: by 10.180.36.105 with SMTP id p9mr4372845wij.58.1386107553134; Tue, 03 Dec 2013 13:52:33 -0800 (PST) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id oh2si128979wic.17.2013.12.03.13.52.32 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 03 Dec 2013 13:52:32 -0800 (PST) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1VnxsD-0006IM-7Y; Tue, 03 Dec 2013 21:51:17 +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 02/12] target-arm: A64: add set_pc cpu method Date: Tue, 3 Dec 2013 21:51:07 +0000 Message-Id: <1386107477-24165-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1386107477-24165-1-git-send-email-peter.maydell@linaro.org> References: <1386107477-24165-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.220.170 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;