qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robherring2@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Rob Herring <rob.herring@linaro.org>,
	qemu-devel@nongnu.org,
	Christoffer Dall <christoffer.dall@linaro.org>
Subject: [Qemu-devel] [PATCH 4/7] target-arm: support AArch64 for arm_cpu_set_pc
Date: Mon,  5 May 2014 11:00:20 -0500	[thread overview]
Message-ID: <1399305623-22016-5-git-send-email-robherring2@gmail.com> (raw)
In-Reply-To: <1399305623-22016-1-git-send-email-robherring2@gmail.com>

From: Rob Herring <rob.herring@linaro.org>

Add AArch64 support to arm_cpu_set_pc and make it available to other files.

Signed-off-by: Rob Herring <rob.herring@linaro.org>
---
 target-arm/cpu.c |  7 -------
 target-arm/cpu.h | 12 ++++++++++++
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/target-arm/cpu.c b/target-arm/cpu.c
index 03c025b..2d18a20 100644
--- a/target-arm/cpu.c
+++ b/target-arm/cpu.c
@@ -30,13 +30,6 @@
 #include "sysemu/sysemu.h"
 #include "sysemu/kvm.h"
 
-static void arm_cpu_set_pc(CPUState *cs, vaddr value)
-{
-    ARMCPU *cpu = ARM_CPU(cs);
-
-    cpu->env.regs[15] = value;
-}
-
 static bool arm_cpu_has_work(CPUState *cs)
 {
     ARMCPU *cpu = ARM_CPU(cs);
diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index 905ba02..efe3cd2 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -1197,6 +1197,18 @@ static inline void cpu_pc_from_tb(CPUARMState *env, TranslationBlock *tb)
     }
 }
 
+static inline void arm_cpu_set_pc(CPUState *cs, vaddr value)
+{
+    ARMCPU *cpu = ARM_CPU(cs);
+
+    if (is_a64(&cpu->env)) {
+        cpu->env.pc = value;
+    } else {
+        cpu->env.regs[15] = value;
+    }
+
+}
+
 /* Load an instruction and return it in the standard little-endian order */
 static inline uint32_t arm_ldl_code(CPUARMState *env, target_ulong addr,
                                     bool do_swap)
-- 
1.9.1

  parent reply	other threads:[~2014-05-05 16:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-05 16:00 [Qemu-devel] [PATCH 0/7] ARM: add PSCI enulation support Rob Herring
2014-05-05 16:00 ` [Qemu-devel] [PATCH 1/7] target-arm: use correct do_interrupt handler for AArch64 user mode Rob Herring
2014-05-05 16:15   ` Peter Maydell
2014-05-05 16:00 ` [Qemu-devel] [PATCH 2/7] target-arm: add powered off cpu state Rob Herring
2014-05-05 16:27   ` Peter Maydell
2014-05-15 13:12   ` Peter Crosthwaite
2014-05-05 16:00 ` [Qemu-devel] [PATCH 3/7] target-arm: add hvc and smc exception emulation handling infrastructure Rob Herring
2014-05-14 17:44   ` Peter Maydell
2014-05-14 20:55     ` Rob Herring
2014-05-15 13:06       ` Peter Maydell
2014-05-05 16:00 ` Rob Herring [this message]
2014-05-05 16:22   ` [Qemu-devel] [PATCH 4/7] target-arm: support AArch64 for arm_cpu_set_pc Peter Maydell
2014-05-05 16:00 ` [Qemu-devel] [PATCH 5/7] target-arm: add emulation of PSCI calls for system emulation Rob Herring
2014-05-14 18:12   ` Peter Maydell
2014-05-15  0:08     ` Rob Herring
2014-05-05 16:00 ` [Qemu-devel] [PATCH 6/7] arm/virt: enable PSCI emulation support " Rob Herring
2014-05-14 17:51   ` Peter Maydell
2014-05-14 19:15     ` Rob Herring
2014-05-14 21:25       ` Peter Maydell
2014-05-14 22:58         ` Rob Herring
2014-05-15  8:18           ` Peter Maydell
2014-05-05 16:00 ` [Qemu-devel] [PATCH 7/7] arm/highbank: enable PSCI emulation support Rob Herring
2014-05-15 13:07   ` Peter Crosthwaite

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1399305623-22016-5-git-send-email-robherring2@gmail.com \
    --to=robherring2@gmail.com \
    --cc=christoffer.dall@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rob.herring@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).