[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v2 1/2] ARM: cpu: add "reset_hivecs" property (hig
From: |
Peter Crosthwaite |
Subject: |
Re: [Qemu-devel] [RFC v2 1/2] ARM: cpu: add "reset_hivecs" property (high vectors on reset) |
Date: |
Wed, 11 Dec 2013 13:00:18 +1000 |
On Wed, Dec 11, 2013 at 8:05 AM, Antony Pavlov <address@hidden> wrote:
> Signed-off-by: Antony Pavlov <address@hidden>
> ---
> target-arm/cpu-qom.h | 1 +
> target-arm/cpu.c | 24 ++++++++++++++++++++++++
> 2 files changed, 25 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 cbe108b..b60e3fc 100644
> --- a/target-arm/cpu.c
> +++ b/target-arm/cpu.c
> @@ -224,6 +224,20 @@ static void arm_cpu_initfn(Object *obj)
> }
> }
>
> +static bool reset_hivecs_get(Object *obj, Error **err)
> +{
> + ARMCPU *cpu = ARM_CPU(obj);
> +
> + return cpu->reset_hivecs;
> +}
> +
> +static void reset_hivecs_set(Object *obj, bool value, Error **err)
> +{
> + ARMCPU *cpu = ARM_CPU(obj);
> +
> + cpu->reset_hivecs = value;
> +}
> +
This is a boiler-plate setter/getter that really should be in QOM
core. We don't want to have to do this for every boolean property.
I've spun a predecessor patch to do this and cleaned this up.
Regards,
Peter
> static void arm_cpu_post_init(Object *obj)
> {
> ARMCPU *cpu = ARM_CPU(obj);
> @@ -234,6 +248,12 @@ static void arm_cpu_post_init(Object *obj)
> &err);
> assert_no_error(err);
> }
> +
> + if (!arm_feature(&cpu->env, ARM_FEATURE_M)) {
> + object_property_add_bool(obj, "reset-hivecs",
> + reset_hivecs_get, reset_hivecs_set, &err);
> + assert_no_error(err);
> + }
> }
>
> static void arm_cpu_finalizefn(Object *obj)
> @@ -295,6 +315,10 @@ static void arm_cpu_realizefn(DeviceState *dev, Error
> **errp)
> set_feature(env, ARM_FEATURE_PXN);
> }
>
> + if (cpu->reset_hivecs) {
> + cpu->reset_sctlr |= (1 << 13);
> + }
> +
> register_cp_regs_for_features(cpu);
> arm_cpu_register_gdb_regs_for_features(cpu);
>
> --
> 1.8.5
>
>