From patchwork Fri Feb 3 02:59:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 139288 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4E9FBB71A9 for ; Fri, 3 Feb 2012 14:40:26 +1100 (EST) Received: from localhost ([::1]:48241 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rt9Rh-0003wn-N4 for incoming@patchwork.ozlabs.org; Thu, 02 Feb 2012 22:04:17 -0500 Received: from eggs.gnu.org ([140.186.70.92]:38868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rt9QD-0000Ib-PD for qemu-devel@nongnu.org; Thu, 02 Feb 2012 22:02:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rt9Q2-00064r-FH for qemu-devel@nongnu.org; Thu, 02 Feb 2012 22:02:42 -0500 Received: from cantor2.suse.de ([195.135.220.15]:55655 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rt9Q1-00064W-KB for qemu-devel@nongnu.org; Thu, 02 Feb 2012 22:02:33 -0500 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id BA3568FB75; Fri, 3 Feb 2012 04:02:32 +0100 (CET) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Fri, 3 Feb 2012 03:59:51 +0100 Message-Id: <1328237992-14953-21-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1328237992-14953-1-git-send-email-afaerber@suse.de> References: <1328237992-14953-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: Peter Maydell , =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PATCH RFC v3 20/21] target-arm: Prepare halted property for CPU 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 Read-only and ARM-specific for now. Signed-off-by: Andreas Färber Cc: Peter Maydell Cc: Anthony Liguori --- 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)