From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOMQi-0001GF-1J for qemu-devel@nongnu.org; Mon, 01 Sep 2014 03:53:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOMQc-0006n8-0E for qemu-devel@nongnu.org; Mon, 01 Sep 2014 03:53:35 -0400 Received: from mail-wg0-f41.google.com ([74.125.82.41]:38415) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOMQb-0006n0-Qf for qemu-devel@nongnu.org; Mon, 01 Sep 2014 03:53:29 -0400 Received: by mail-wg0-f41.google.com with SMTP id l18so4961673wgh.12 for ; Mon, 01 Sep 2014 00:53:29 -0700 (PDT) From: Ard Biesheuvel Date: Mon, 1 Sep 2014 09:53:18 +0200 Message-Id: <1409558001-12148-3-git-send-email-ard.biesheuvel@linaro.org> In-Reply-To: <1409558001-12148-1-git-send-email-ard.biesheuvel@linaro.org> References: <1409558001-12148-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [Qemu-devel] [PATCH 2/5] target-arm: support AArch64 for arm_cpu_set_pc List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, peter.maydell@linaro.org, rob.herring@linaro.org Cc: Ard Biesheuvel From: Rob Herring Add AArch64 support to arm_cpu_set_pc and make it available to other files. Signed-off-by: Rob Herring Signed-off-by: Ard Biesheuvel --- 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 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 -- 1.8.3.2