From patchwork Mon May 24 15:18:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 53432 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 81446B7D27 for ; Tue, 25 May 2010 01:31:46 +1000 (EST) Received: from localhost ([127.0.0.1]:47095 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OGZcP-000465-VU for incoming@patchwork.ozlabs.org; Mon, 24 May 2010 11:31:06 -0400 Received: from [140.186.70.92] (port=41684 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OGZQO-00060d-9J for qemu-devel@nongnu.org; Mon, 24 May 2010 11:18:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OGZQL-00006M-TW for qemu-devel@nongnu.org; Mon, 24 May 2010 11:18:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22219) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OGZQJ-00005w-Ey for qemu-devel@nongnu.org; Mon, 24 May 2010 11:18:36 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o4OFIYxH017624 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 24 May 2010 11:18:34 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o4OFIMM1009416; Mon, 24 May 2010 11:18:33 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 24 May 2010 17:18:21 +0200 Message-Id: <41a1059b63841b8eaab13e543d4d6bd840752deb.1274714215.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 6/6] Create CONFIG_HPET 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 Compile hpet.o depending of CONFIG_HPET. Simplify testing for using this functions once there. Create inline stabs for the exported functions. Signed-off-by: Juan Quintela --- Makefile.target | 3 ++- config.h | 10 ++++++++++ default-configs/i386-softmmu.mak | 1 + default-configs/x86_64-softmmu.mak | 1 + hw/hpet_emul.h | 8 ++++++-- monitor.c | 4 +++- 6 files changed, 23 insertions(+), 4 deletions(-) diff --git a/Makefile.target b/Makefile.target index 3859dd5..533327e 100644 --- a/Makefile.target +++ b/Makefile.target @@ -194,7 +194,8 @@ obj-y += e1000.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 += vmmouse.o vmport.o hpet.o +obj-i386-y += vmmouse.o vmport.o +obj-i386-$(CONFIG_HPET) += hpet.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/config.h b/config.h index e20f786..7d92cfc 100644 --- a/config.h +++ b/config.h @@ -1,2 +1,12 @@ #include "config-host.h" #include "config-target.h" + +/* We want to include different config files for specific targets + And for the common library. They need a different name because + we don't want to rely in paths */ + +#if defined(NEED_CPU_H) +#include "config-devices.h" +#else +#include "config-all-devices.h" +#endif diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak index ed00471..6341ede 100644 --- a/default-configs/i386-softmmu.mak +++ b/default-configs/i386-softmmu.mak @@ -23,3 +23,4 @@ CONFIG_NE2000_ISA=y CONFIG_PIIX_PCI=y CONFIG_SOUND=y CONFIG_VIRTIO_PCI=y +CONFIG_HPET=y diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak index 5183203..e1ca587 100644 --- a/default-configs/x86_64-softmmu.mak +++ b/default-configs/x86_64-softmmu.mak @@ -23,3 +23,4 @@ CONFIG_NE2000_ISA=y CONFIG_PIIX_PCI=y CONFIG_SOUND=y CONFIG_VIRTIO_PCI=y +CONFIG_HPET=y diff --git a/hw/hpet_emul.h b/hw/hpet_emul.h index 4f90faa..898364b 100644 --- a/hw/hpet_emul.h +++ b/hw/hpet_emul.h @@ -15,13 +15,17 @@ extern int no_hpet; -#if !defined(TARGET_I386) +#if !defined(CONFIG_HPET) static inline bool hpet_in_legacy_mode(void) { return false; } +static inline void hpet_init(qemu_irq *irq) +{ +} + #else #define HPET_BASE 0xfed00000 @@ -87,6 +91,6 @@ typedef struct HPETState { extern bool hpet_in_legacy_mode(void); extern void hpet_init(qemu_irq *irq); -#endif /* TARGET_I386 */ +#endif /* CONFIG_HPET */ #endif diff --git a/monitor.c b/monitor.c index 5975f40..a81de0c 100644 --- a/monitor.c +++ b/monitor.c @@ -778,7 +778,7 @@ static void do_info_commands(Monitor *mon, QObject **ret_data) *ret_data = QOBJECT(cmd_list); } -#if defined(TARGET_I386) +#if defined(CONFIG_HPET) static void do_info_hpet_print(Monitor *mon, const QObject *data) { monitor_printf(mon, "HPET is %s by QEMU\n", @@ -2610,6 +2610,8 @@ static const mon_cmd_t info_cmds[] = { .help = "show the active virtual memory mappings", .mhandler.info = mem_info, }, +#endif +#if defined(CONFIG_HPET) { .name = "hpet", .args_type = "",