Received: from eggs.gnu.org ([2001:4830:134:3::10]:55092) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vp648-0007KK-A4 for qemu-devel@nongnu.org; Fri, 06 Dec 2013 19:48:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vp63z-0007qM-O6 for qemu-devel@nongnu.org; Fri, 06 Dec 2013 19:48:16 -0500 Received: from mail-la0-x22c.google.com ([2a00:1450:4010:c03::22c]:60180) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vp63z-0007oA-GO for qemu-devel@nongnu.org; Fri, 06 Dec 2013 19:48:07 -0500 Received: by mail-la0-f44.google.com with SMTP id ep20so564602lab.3 for ; Fri, 06 Dec 2013 16:48:06 -0800 (PST) From: Antony Pavlov Date: Sat, 7 Dec 2013 04:55:03 +0400 Message-Id: <1386377704-1350-2-git-send-email-antonynpavlov@gmail.com> In-Reply-To: <1386377704-1350-1-git-send-email-antonynpavlov@gmail.com> References: <1386377704-1350-1-git-send-email-antonynpavlov@gmail.com> Subject: [Qemu-devel] [RFC 1/2] ARM: cpu: add "hivecs" property (high vectors on reset) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Peter Crosthwaite , Antony Pavlov Signed-off-by: Antony Pavlov --- target-arm/cpu-qom.h | 1 + target-arm/cpu.c | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/target-arm/cpu-qom.h b/target-arm/cpu-qom.h index b55306a..116320c 100644 --- a/target-arm/cpu-qom.h +++ b/target-arm/cpu-qom.h @@ -128,6 +128,7 @@ typedef struct ARMCPU { uint32_t ccsidr[16]; uint32_t reset_cbar; uint32_t reset_auxcr; + bool reset_hivecs; } ARMCPU; #define TYPE_AARCH64_CPU "aarch64-cpu" diff --git a/target-arm/cpu.c b/target-arm/cpu.c index d40f2a7..f838499 100644 --- a/target-arm/cpu.c +++ b/target-arm/cpu.c @@ -20,6 +20,7 @@ #include "cpu.h" #include "qemu-common.h" +#include "hw/qdev-properties.h" #if !defined(CONFIG_USER_ONLY) #include "hw/loader.h" #endif @@ -119,6 +120,12 @@ static void arm_cpu_reset(CPUState *s) env->regs[15] = pc & ~1; } } + + if (cpu->reset_hivecs) { + uint32_t c1_sys = env->cp15.c1_sys; + env->cp15.c1_sys = c1_sys | (1 << 13); + } + env->vfp.xregs[ARM_VFP_FPEXC] = 0; #endif set_flush_to_zero(1, &env->vfp.standard_fp_status); @@ -854,6 +861,11 @@ typedef struct ARMCPUInfo { void (*class_init)(ObjectClass *oc, void *data); } ARMCPUInfo; +static Property arm_cpu_properties[] = { + DEFINE_PROP_BOOL("hivecs", ARMCPU, reset_hivecs, false), + DEFINE_PROP_END_OF_LIST(), +}; + static const ARMCPUInfo arm_cpus[] = { #if !defined(CONFIG_USER_ONLY) || !defined(TARGET_AARCH64) { .name = "arm926", .initfn = arm926_initfn }, @@ -902,6 +914,7 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) acc->parent_realize = dc->realize; dc->realize = arm_cpu_realizefn; + dc->props = arm_cpu_properties; acc->parent_reset = cc->reset; cc->reset = arm_cpu_reset; -- 1.8.5