From patchwork Fri Oct 12 01:26:37 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: 191033 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 374192C008F for ; Fri, 12 Oct 2012 12:27:14 +1100 (EST) Received: from localhost ([::1]:45186 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMU1v-0001eQ-Pq for incoming@patchwork.ozlabs.org; Thu, 11 Oct 2012 21:27:11 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50881) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMU1i-0001e8-Dd for qemu-devel@nongnu.org; Thu, 11 Oct 2012 21:26:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TMU1g-0005QQ-GM for qemu-devel@nongnu.org; Thu, 11 Oct 2012 21:26:58 -0400 Received: from cantor2.suse.de ([195.135.220.15]:52712 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMU1g-0005QD-74 for qemu-devel@nongnu.org; Thu, 11 Oct 2012 21:26:56 -0400 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 91F7CA2BD5; Fri, 12 Oct 2012 03:26:55 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Fri, 12 Oct 2012 03:26:37 +0200 Message-Id: <1350005203-15405-2-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1350005203-15405-1-git-send-email-afaerber@suse.de> References: <1350005203-15405-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: Igor Mammedov , =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PATCH qom-cpu v2 1/7] target-i386: Inline APIC cpu_env property setting 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 This prepares for changing the variable type from void*. Signed-off-by: Andreas Färber Cc: Igor Mammedov Reviewed-By: Igor Mammedov --- hw/apic_common.c | 1 - target-i386/cpu.c | 5 ++++- 2 Dateien geändert, 4 Zeilen hinzugefügt(+), 2 Zeilen entfernt(-) diff --git a/hw/apic_common.c b/hw/apic_common.c index 371f95d..a26a631 100644 --- a/hw/apic_common.c +++ b/hw/apic_common.c @@ -368,7 +368,6 @@ static const VMStateDescription vmstate_apic_common = { static Property apic_properties_common[] = { DEFINE_PROP_UINT8("id", APICCommonState, id, -1), - DEFINE_PROP_PTR("cpu_env", APICCommonState, cpu_env), DEFINE_PROP_BIT("vapic", APICCommonState, vapic_control, VAPIC_ENABLE_BIT, true), DEFINE_PROP_END_OF_LIST(), diff --git a/target-i386/cpu.c b/target-i386/cpu.c index e307b4e..0cce910 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -41,6 +41,7 @@ #ifndef CONFIG_USER_ONLY #include "hw/xen.h" #include "hw/sysbus.h" +#include "hw/apic_internal.h" #endif /* feature flags taken from "Intel Processor Identification and the CPUID @@ -1884,6 +1885,7 @@ static void x86_cpu_apic_init(X86CPU *cpu, Error **errp) #ifndef CONFIG_USER_ONLY static int apic_mapped; CPUX86State *env = &cpu->env; + APICCommonState *apic; const char *apic_type = "apic"; if (kvm_irqchip_in_kernel()) { @@ -1902,7 +1904,8 @@ static void x86_cpu_apic_init(X86CPU *cpu, Error **errp) OBJECT(env->apic_state), NULL); qdev_prop_set_uint8(env->apic_state, "id", env->cpuid_apic_id); /* TODO: convert to link<> */ - qdev_prop_set_ptr(env->apic_state, "cpu_env", env); + apic = APIC_COMMON(env->apic_state); + apic->cpu_env = env; if (qdev_init(env->apic_state)) { error_setg(errp, "APIC device '%s' could not be initialized",