diff mbox

[2/5] target-arm: support AArch64 for arm_cpu_set_pc

Message ID 1409558001-12148-3-git-send-email-ard.biesheuvel@linaro.org
State New
Headers show

Commit Message

Ard Biesheuvel Sept. 1, 2014, 7:53 a.m. UTC
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>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 target-arm/cpu.c |  7 -------
 target-arm/cpu.h | 12 ++++++++++++
 2 files changed, 12 insertions(+), 7 deletions(-)

Comments

Peter Maydell Sept. 1, 2014, 9:09 a.m. UTC | #1
On 1 September 2014 08:53, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> From: Rob Herring <rob.herring@linaro.org>
>
> Add AArch64 support to arm_cpu_set_pc and make it available to other files.

This is still the wrong way to do this. See review on
previous version of this patchset:
http://lists.gnu.org/archive/html/qemu-devel/2014-05/msg00558.html

thanks
-- PMM
Ard Biesheuvel Sept. 1, 2014, 9:12 a.m. UTC | #2
On 1 September 2014 11:09, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 1 September 2014 08:53, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>> From: Rob Herring <rob.herring@linaro.org>
>>
>> Add AArch64 support to arm_cpu_set_pc and make it available to other files.
>
> This is still the wrong way to do this. See review on
> previous version of this patchset:
> http://lists.gnu.org/archive/html/qemu-devel/2014-05/msg00558.html
>

I wasn't aware that these patches had been sent out for review
already, sorry about that.
I will go through the archive, so no need to duplicate any more feedback here.
diff mbox

Patch

diff --git a/target-arm/cpu.c b/target-arm/cpu.c
index b4c06c17cf87..633a533af716 100644
--- a/target-arm/cpu.c
+++ b/target-arm/cpu.c
@@ -31,13 +31,6 @@ 
 #include "sysemu/kvm.h"
 #include "kvm_arm.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 51bedc826299..5fa91b4f1d6c 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -1348,4 +1348,16 @@  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;
+    }
+
+}
+
 #endif