From patchwork Wed Jun 20 12:26:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 166090 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 61AFBB6FA4 for ; Thu, 21 Jun 2012 00:15:42 +1000 (EST) Received: from localhost ([::1]:59052 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ShKTf-0006cf-Lf for incoming@patchwork.ozlabs.org; Wed, 20 Jun 2012 08:57:43 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ShKT6-00055G-2W for qemu-devel@nongnu.org; Wed, 20 Jun 2012 08:57:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ShKSz-0002BG-Of for qemu-devel@nongnu.org; Wed, 20 Jun 2012 08:57:07 -0400 Received: from mnementh.archaic.org.uk ([81.2.115.146]:59525) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ShKSz-00025V-HP for qemu-devel@nongnu.org; Wed, 20 Jun 2012 08:57:01 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1ShK0H-0004Kj-Vj; Wed, 20 Jun 2012 13:27:21 +0100 From: Peter Maydell To: Blue Swirl Date: Wed, 20 Jun 2012 13:26:55 +0100 Message-Id: <1340195241-16620-8-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1340195241-16620-1-git-send-email-peter.maydell@linaro.org> References: <1340195241-16620-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 81.2.115.146 Cc: qemu-devel@nongnu.org, Anthony Liguori , Paul Brook Subject: [Qemu-devel] [PATCH 07/33] target-arm: Add register_cp_regs_for_features() 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Add new function register_cp_regs_for_features() as a place to register coprocessor registers dependent on feature flags. Signed-off-by: Peter Maydell --- target-arm/cpu-qom.h | 1 + target-arm/cpu.c | 2 ++ target-arm/helper.c | 11 +++++++++++ 3 files changed, 14 insertions(+), 0 deletions(-) diff --git a/target-arm/cpu-qom.h b/target-arm/cpu-qom.h index 848ac2f..4ccfc89 100644 --- a/target-arm/cpu-qom.h +++ b/target-arm/cpu-qom.h @@ -107,5 +107,6 @@ static inline ARMCPU *arm_env_get_cpu(CPUARMState *env) #define ENV_GET_CPU(e) CPU(arm_env_get_cpu(e)) void arm_cpu_realize(ARMCPU *cpu); +void register_cp_regs_for_features(ARMCPU *cpu); #endif diff --git a/target-arm/cpu.c b/target-arm/cpu.c index 6456a3d..1aff266 100644 --- a/target-arm/cpu.c +++ b/target-arm/cpu.c @@ -216,6 +216,8 @@ void arm_cpu_realize(ARMCPU *cpu) if (arm_feature(env, ARM_FEATURE_VFP3)) { set_feature(env, ARM_FEATURE_VFP); } + + register_cp_regs_for_features(cpu); } /* CPU models */ diff --git a/target-arm/helper.c b/target-arm/helper.c index 57bb78b..f7c9a3a 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -56,6 +56,17 @@ static int vfp_gdb_set_reg(CPUARMState *env, uint8_t *buf, int reg) return 0; } +void register_cp_regs_for_features(ARMCPU *cpu) +{ + /* Register all the coprocessor registers based on feature bits */ + CPUARMState *env = &cpu->env; + if (arm_feature(env, ARM_FEATURE_M)) { + /* M profile has no coprocessor registers */ + return; + } + +} + ARMCPU *cpu_arm_init(const char *cpu_model) { ARMCPU *cpu;