From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43057) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WhLJx-0006uB-Uu for qemu-devel@nongnu.org; Mon, 05 May 2014 12:00:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WhLJp-0000pr-0W for qemu-devel@nongnu.org; Mon, 05 May 2014 12:00:49 -0400 Received: from mail-oa0-x22f.google.com ([2607:f8b0:4003:c02::22f]:55427) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WhLJo-0000of-EF for qemu-devel@nongnu.org; Mon, 05 May 2014 12:00:40 -0400 Received: by mail-oa0-f47.google.com with SMTP id i7so2588311oag.6 for ; Mon, 05 May 2014 09:00:39 -0700 (PDT) From: Rob Herring Date: Mon, 5 May 2014 11:00:20 -0500 Message-Id: <1399305623-22016-5-git-send-email-robherring2@gmail.com> In-Reply-To: <1399305623-22016-1-git-send-email-robherring2@gmail.com> References: <1399305623-22016-1-git-send-email-robherring2@gmail.com> Subject: [Qemu-devel] [PATCH 4/7] target-arm: support AArch64 for arm_cpu_set_pc List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Rob Herring , qemu-devel@nongnu.org, Christoffer Dall From: Rob Herring Add AArch64 support to arm_cpu_set_pc and make it available to other files. Signed-off-by: Rob Herring --- 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