From patchwork Mon Sep 1 07:53:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 36333 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f70.google.com (mail-oa0-f70.google.com [209.85.219.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DDE8020792 for ; Mon, 1 Sep 2014 07:54:38 +0000 (UTC) Received: by mail-oa0-f70.google.com with SMTP id eb12sf30970724oac.5 for ; Mon, 01 Sep 2014 00:54:38 -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=azxF4bxJmMVECZvu1jJM/M9nSNZ3UKjhIyVGvb2i/gg=; b=ImmFmc+dNAGb1wK9RmWGf7DdGzXyIDjGXk0ZCF0AlimJHVbSey6QkZiAYWDuUkSoYG Ot5PZJftT+TyJ6hc2jDRGcgyodR5+GvShzX7KrY26E5su2NbRahYHJx8Xy5lmfOLyhXX iJNd9sKpiGAFoVqhFLMhAqatl3y83wAUTJ/gdLHs16gteaOksKfLY73fHYcG/yRHR0xP GnejHXvayChpXhf6ojVDTrkuFSCwciXI+hry0IoDEo+qXBCwj5cN8p9h2wLrAzN+Tyh0 niE+r560Fyg9Fb+1696ou9nTf+Vkdv387ZRxqBDawfu8iV9Evw7AWnsEBqgFsGerxNhJ cvlg== X-Gm-Message-State: ALoCoQlK2k6QZWF3JblRi2L85qBgDVArdVxA5ECZ3cbb3XtMDF95LFbwm+kQnKrSvoLg8QxSr7+4 X-Received: by 10.42.209.12 with SMTP id ge12mr15910863icb.11.1409558078477; Mon, 01 Sep 2014 00:54:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.36.168 with SMTP id p37ls1837330qgp.12.gmail; Mon, 01 Sep 2014 00:54:38 -0700 (PDT) X-Received: by 10.53.12.225 with SMTP id et1mr19930333vdd.5.1409558078382; Mon, 01 Sep 2014 00:54:38 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id op4si18043vcb.43.2014.09.01.00.54.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Sep 2014 00:54:38 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.169 as permitted sender) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id hq11so5223703vcb.28 for ; Mon, 01 Sep 2014 00:54:38 -0700 (PDT) X-Received: by 10.52.102.204 with SMTP id fq12mr14020591vdb.26.1409558078267; Mon, 01 Sep 2014 00:54:38 -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.221.45.67 with SMTP id uj3csp350176vcb; Mon, 1 Sep 2014 00:54:37 -0700 (PDT) X-Received: by 10.229.219.138 with SMTP id hu10mr42226550qcb.5.1409558077812; Mon, 01 Sep 2014 00:54:37 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [208.118.235.17]) by mx.google.com with ESMTPS id z8si9652829qaz.106.2014.09.01.00.54.37 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 01 Sep 2014 00:54:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Received: from localhost ([::1]:52600 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOMRh-0002BZ-Ht for patch@linaro.org; Mon, 01 Sep 2014 03:54:37 -0400 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) X-Received: by 10.180.100.202 with SMTP id fa10mr13992913wib.32.1409558009145; Mon, 01 Sep 2014 00:53:29 -0700 (PDT) Received: from ards-macbook-pro.local (cag06-7-83-153-85-71.fbx.proxad.net. [83.153.85.71]) by mx.google.com with ESMTPSA id gh1sm23183323wib.18.2014.09.01.00.53.28 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Sep 2014 00:53:28 -0700 (PDT) From: Ard Biesheuvel To: qemu-devel@nongnu.org, peter.maydell@linaro.org, rob.herring@linaro.org Date: Mon, 1 Sep 2014 09:53:18 +0200 Message-Id: <1409558001-12148-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1409558001-12148-1-git-send-email-ard.biesheuvel@linaro.org> References: <1409558001-12148-1-git-send-email-ard.biesheuvel@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 74.125.82.41 Cc: Ard Biesheuvel Subject: [Qemu-devel] [PATCH 2/5] 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.169 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org 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 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