From patchwork Mon May 5 16:00:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 29658 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f197.google.com (mail-pd0-f197.google.com [209.85.192.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 53D4B2055D for ; Mon, 5 May 2014 16:07:00 +0000 (UTC) Received: by mail-pd0-f197.google.com with SMTP id g10sf24907152pdj.0 for ; Mon, 05 May 2014 09:06:59 -0700 (PDT) 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:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=EIMdnKxbJ2OIHS/1ZLpZ69g/PTdoiuwGAYuS+3b8bjI=; b=UuU+AsZkYwCd2n4TbSUgf+doOU9/672CAg8to7PV7VSt6s+8dBIN36FdsgSkqMx/Yj 7ArIiJlHioAAgRV81eC3yyjEKD0TTBAnf9cq2J7j8sm9pzK3RQPawOoqZ6finW/JYMmT 9e/qziakN8Tqvc0i18+CYV5uWrexDQ4CX1D5PLVbQfSWStG1FNbJfRQoG+H6hkunlCRj NXec8Hl7GLXYsE+8LZ+ou+Rp9cxhfu57uQ9jXnb75OClr6csr4Sl4cZFBjgBA0TpJmbD P+CsjtGTq4PXYgZDnLRqhBboX7incydIIvXyoiSGQZMXktSh2jrCTp/jhg6ADaI83lzk Rc1g== X-Gm-Message-State: ALoCoQkcKnxNuDtHjgvNQSr+DWRSJfikvCWB3wSfcQSQ3evrHKzA+dKgPyDHuB9MaAdBTLT52VMT X-Received: by 10.67.4.202 with SMTP id cg10mr16886539pad.42.1399306018872; Mon, 05 May 2014 09:06:58 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.35.210 with SMTP id n76ls2563306qgn.15.gmail; Mon, 05 May 2014 09:06:58 -0700 (PDT) X-Received: by 10.58.150.68 with SMTP id ug4mr865050veb.50.1399306018720; Mon, 05 May 2014 09:06:58 -0700 (PDT) Received: from mail-ve0-x233.google.com (mail-ve0-x233.google.com [2607:f8b0:400c:c01::233]) by mx.google.com with ESMTPS id vg8si1696634veb.93.2014.05.05.09.06.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 May 2014 09:06:58 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=2607:f8b0:400c:c01::233; Received: by mail-ve0-f179.google.com with SMTP id oy12so5896417veb.24 for ; Mon, 05 May 2014 09:06:58 -0700 (PDT) X-Received: by 10.58.38.40 with SMTP id d8mr856348vek.61.1399306018632; Mon, 05 May 2014 09:06:58 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp152191vcb; Mon, 5 May 2014 09:06:58 -0700 (PDT) X-Received: by 10.220.2.142 with SMTP id 14mr861823vcj.48.1399306018066; Mon, 05 May 2014 09:06:58 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id e4si530922qcc.65.2014.05.05.09.06.57 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 05 May 2014 09:06:58 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:58318 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WhLPt-0006U8-I8 for patch@linaro.org; Mon, 05 May 2014 12:06:57 -0400 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) X-Received: by 10.182.214.41 with SMTP id nx9mr33116425obc.15.1399305639859; Mon, 05 May 2014 09:00:39 -0700 (PDT) Received: from localhost.localdomain (72-48-77-163.dyn.grandenetworks.net. [72.48.77.163]) by mx.google.com with ESMTPSA id dw5sm20133189obb.0.2014.05.05.09.00.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 May 2014 09:00:38 -0700 (PDT) From: Rob Herring To: Peter Maydell Date: Mon, 5 May 2014 11:00:20 -0500 Message-Id: <1399305623-22016-5-git-send-email-robherring2@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1399305623-22016-1-git-send-email-robherring2@gmail.com> References: <1399305623-22016-1-git-send-email-robherring2@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c02::22f Cc: Rob Herring , qemu-devel@nongnu.org, Christoffer Dall Subject: [Qemu-devel] [PATCH 4/7] target-arm: support AArch64 for arm_cpu_set_pc X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Original-Sender: robherring2@gmail.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=fail header.i=@gmail.com; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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)