Read-only and ARM-specific for now. Signed-off-by: Andreas Färber <afaer...@suse.de> Cc: Peter Maydell <peter.mayd...@linaro.org> Cc: Anthony Liguori <anth...@codemonkey.ws> --- target-arm/cpu.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/target-arm/cpu.c b/target-arm/cpu.c index 74f4e9b..4dfec15 100644 --- a/target-arm/cpu.c +++ b/target-arm/cpu.c @@ -20,6 +20,7 @@ #include "cpu-core.h" #include "qemu-common.h" +#include "qapi/qapi-visit-core.h" #if !defined(CONFIG_USER_ONLY) #include "hw/loader.h" #endif @@ -538,6 +539,14 @@ static const ARMCPUInfo arm_cpus[] = { }, }; +static void arm_cpu_get_halted(Object *obj, Visitor *v, void *opaque, + const char *name, Error **errp) +{ + ARMCPU *cpu = ARM_CPU(obj); + bool halted = cpu->env.halted != 0; + visit_type_bool(v, &halted, name, errp); +} + static void arm_cpu_initfn(Object *obj) { ARMCPU *cpu = ARM_CPU(obj); @@ -552,6 +561,9 @@ static void arm_cpu_initfn(Object *obj) cpu->env.cp15.c0_cpuid = cpu_class->cp15.c0_cpuid; cpu_do_reset(CPU(cpu)); + + object_property_add(obj, "halted", "boolean", + arm_cpu_get_halted, NULL, NULL, NULL, NULL); } static void arm_cpu_class_init(ObjectClass *klass, void *data) -- 1.7.7