From patchwork Wed Dec 11 11:59:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miroslav Rezanina X-Patchwork-Id: 300020 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2EEEB2C00A5 for ; Wed, 11 Dec 2013 23:00:14 +1100 (EST) Received: from localhost ([::1]:55960 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqiSZ-0005QF-6i for incoming@patchwork.ozlabs.org; Wed, 11 Dec 2013 07:00:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59441) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqiSD-0005P5-F5 for qemu-devel@nongnu.org; Wed, 11 Dec 2013 06:59:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VqiS7-0008Km-0l for qemu-devel@nongnu.org; Wed, 11 Dec 2013 06:59:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:14500) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqiS6-0008KW-P7 for qemu-devel@nongnu.org; Wed, 11 Dec 2013 06:59:42 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rBBBxeoe002842 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 11 Dec 2013 06:59:41 -0500 Received: from lws-ntb.brq.redhat.com (dhcp-27-185.brq.redhat.com [10.34.27.185]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rBBBxdnf002122 for ; Wed, 11 Dec 2013 06:59:40 -0500 From: mrezanin@redhat.com To: qemu-devel@nongnu.org Date: Wed, 11 Dec 2013 12:59:37 +0100 Message-Id: <1386763177-23036-1-git-send-email-mrezanin@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] Move hpet_find function from hpet.c to pc.c 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 From: Miroslav Rezanina Function hpet_find could not be used for checking hpet availability becouse it was not build when hpet was disabled. To allow proper use of this function, moving it from hw/timer/hpet.c to hw/i386/pc.c. Signed-off-by: Miroslav Rezanina --- hw/i386/pc.c | 5 +++++ hw/timer/hpet.c | 5 ----- include/hw/i386/pc.h | 2 ++ include/hw/timer/hpet.h | 1 - 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 12c436e..7fd08dd 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1403,3 +1403,8 @@ void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name) gsi_state->ioapic_irq[i] = qdev_get_gpio_in(dev, i); } } + +bool hpet_find(void) +{ + return object_resolve_path_type("", "hpet", NULL); +} diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c index 2eb75ea..fcd22ae 100644 --- a/hw/timer/hpet.c +++ b/hw/timer/hpet.c @@ -757,11 +757,6 @@ static void hpet_device_class_init(ObjectClass *klass, void *data) dc->props = hpet_device_properties; } -bool hpet_find(void) -{ - return object_resolve_path_type("", TYPE_HPET, NULL); -} - static const TypeInfo hpet_device_info = { .name = TYPE_HPET, .parent = TYPE_SYS_BUS_DEVICE, diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 09652fb..f81b615 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -178,6 +178,8 @@ void piix4_smbus_register_device(SMBusDevice *dev, uint8_t addr); /* hpet.c */ extern int no_hpet; +bool hpet_find(void); + /* piix_pci.c */ struct PCII440FXState; typedef struct PCII440FXState PCII440FXState; diff --git a/include/hw/timer/hpet.h b/include/hw/timer/hpet.h index ab44bd3..3fae8ad 100644 --- a/include/hw/timer/hpet.h +++ b/include/hw/timer/hpet.h @@ -72,5 +72,4 @@ struct hpet_fw_config extern struct hpet_fw_config hpet_cfg; -bool hpet_find(void); #endif