From patchwork Thu Feb 3 21:02:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 81730 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 46A16B7088 for ; Fri, 4 Feb 2011 09:30:18 +1100 (EST) Received: from localhost ([127.0.0.1]:58306 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pl6TN-0004bP-3C for incoming@patchwork.ozlabs.org; Thu, 03 Feb 2011 16:12:13 -0500 Received: from [140.186.70.92] (port=43829 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pl6KL-0000zm-Fj for qemu-devel@nongnu.org; Thu, 03 Feb 2011 16:02:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pl6KJ-0005FF-I3 for qemu-devel@nongnu.org; Thu, 03 Feb 2011 16:02:52 -0500 Received: from mail-pz0-f45.google.com ([209.85.210.45]:62476) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pl6KJ-0005Ew-Ap for qemu-devel@nongnu.org; Thu, 03 Feb 2011 16:02:51 -0500 Received: by pzk2 with SMTP id 2so357464pzk.4 for ; Thu, 03 Feb 2011 13:02:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to :content-type; bh=80vICE+fMck2ZywmttbtB1IZjlndiOEjuicVNS2evuU=; b=pXJq2IO8K3KzQ9IICr6iUCEVULBIAWMlFfyTZb3a0o37QFczErogVfKnKWmT2Gufa4 Faa1zeombRhJDh1kdiE6B27dm2Yr9DUY/Hl0cheBh7HWmJCVMa6ZhIfRyn2pkAvO+jWg PU2cQ+YPyxF0r3N0FlGWurQ/bGedC+De3i9vc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=HCb+IUZ2pYhO5hA9KZC72Ga2JckljCOnCRqgxIB7OZkoox+l43ZVgPxTBg9bKhT+ck 9yo3IrSXdjFf2QF/zu3I2vllRBtGAkGe99MlbBcqhz0w/jA74zmp1KyY/CufKnvh/zWT 4wC+eb7mbGijEvJQH4XSoQAI0/QovYi9ZYUS4= Received: by 10.142.142.13 with SMTP id p13mr10726157wfd.118.1296766970456; Thu, 03 Feb 2011 13:02:50 -0800 (PST) MIME-Version: 1.0 Received: by 10.142.52.1 with HTTP; Thu, 3 Feb 2011 13:02:30 -0800 (PST) From: Blue Swirl Date: Thu, 3 Feb 2011 21:02:30 +0000 Message-ID: To: qemu-devel X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.45 Subject: [Qemu-devel] [PATCH 10/10] hpet: make optional X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Ignore failure with hpet device creation. Signed-off-by: Blue Swirl --- Makefile.objs | 1 + Makefile.target | 2 +- default-configs/i386-softmmu.mak | 1 + default-configs/x86_64-softmmu.mak | 1 + hw/hpet.c | 2 -- hw/pc.c | 11 +++++++---- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Makefile.objs b/Makefile.objs index 1853f9a..1b3881c 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -195,6 +195,7 @@ hw-obj-$(CONFIG_FDC) += fdc.o hw-obj-$(CONFIG_ACPI) += acpi.o acpi_piix4.o hw-obj-$(CONFIG_APM) += pm_smbus.o apm.o hw-obj-$(CONFIG_DMA) += dma.o +hw-obj-$(CONFIG_HPET) += hpet.o # PPC devices hw-obj-$(CONFIG_OPENPIC) += openpic.o diff --git a/Makefile.target b/Makefile.target index ab2df93..6bf4732 100644 --- a/Makefile.target +++ b/Makefile.target @@ -215,7 +215,7 @@ obj-$(CONFIG_KVM) += ivshmem.o obj-i386-y += vga.o obj-i386-y += mc146818rtc.o i8259.o pc.o obj-i386-y += cirrus_vga.o apic.o ioapic.o piix_pci.o -obj-i386-y += vmport.o hpet.o applesmc.o +obj-i386-y += vmport.o applesmc.o obj-i386-y += device-hotplug.o pci-hotplug.o smbios.o wdt_ib700.o obj-i386-y += debugcon.o multiboot.o obj-i386-y += pc_piix.o diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak index 9246293..3e0eddf 100644 --- a/default-configs/i386-softmmu.mak +++ b/default-configs/i386-softmmu.mak @@ -19,3 +19,4 @@ CONFIG_IDE_PIIX=y CONFIG_NE2000_ISA=y CONFIG_PIIX_PCI=y CONFIG_SOUND=y +CONFIG_HPET=y diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak index daf8c48..1cc1b61 100644 --- a/default-configs/x86_64-softmmu.mak +++ b/default-configs/x86_64-softmmu.mak @@ -19,3 +19,4 @@ CONFIG_IDE_PIIX=y CONFIG_NE2000_ISA=y CONFIG_PIIX_PCI=y CONFIG_SOUND=y +CONFIG_HPET=y diff --git a/hw/hpet.c b/hw/hpet.c index 8fb6811..82a9a21 100644 --- a/hw/hpet.c +++ b/hw/hpet.c @@ -74,8 +74,6 @@ typedef struct HPETState { uint8_t hpet_id; /* instance id */ } HPETState; -struct hpet_fw_config hpet_cfg = {.count = UINT8_MAX}; - static uint32_t hpet_in_legacy_mode(HPETState *s) { return s->config & HPET_CFG_LEGACY; diff --git a/hw/pc.c b/hw/pc.c index 9f5fc17..fe0afb9 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -84,6 +84,7 @@ struct e820_table { } __attribute((__packed__, __aligned__(4))); static struct e820_table e820_table; +struct hpet_fw_config hpet_cfg = {.count = UINT8_MAX}; void isa_irq_handler(void *opaque, int n, int level) { @@ -1104,12 +1105,14 @@ void pc_basic_device_init(qemu_irq *isa_irq, register_ioport_write(0xf0, 1, 1, ioportF0_write, NULL); if (!no_hpet) { - DeviceState *hpet = sysbus_create_simple("hpet", HPET_BASE, NULL); + DeviceState *hpet = sysbus_try_create_simple("hpet", HPET_BASE, NULL); - for (i = 0; i < 24; i++) { - sysbus_connect_irq(sysbus_from_qdev(hpet), i, isa_irq[i]); + if (hpet) { + for (i = 0; i < 24; i++) { + sysbus_connect_irq(sysbus_from_qdev(hpet), i, isa_irq[i]); + } + rtc_irq = qdev_get_gpio_in(hpet, 0); } - rtc_irq = qdev_get_gpio_in(hpet, 0); } *rtc_state = rtc_init(2000, rtc_irq);