Patchwork [4/5] x86: use device info for hpet

login
register
mail settings
Submitter Blue Swirl
Date Sept. 9, 2009, 6:06 p.m.
Message ID <f43fc5580909091106n13b7c283t6876e3ad46b4d2d6@mail.gmail.com>
Download mbox | patch
Permalink /patch/33220/
State Superseded
Headers show

Comments

Blue Swirl - Sept. 9, 2009, 6:06 p.m.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 hw/pc.c         |   12 ++++++++++++
 monitor.c       |   10 ----------
 qemu-monitor.hx |    2 --
 3 files changed, 12 insertions(+), 12 deletions(-)

Patch

diff --git a/hw/pc.c b/hw/pc.c
index 6292001..39a0970 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -1108,6 +1108,17 @@  static CPUState *pc_new_cpu(const char *cpu_model)
     return env;
 }

+static void info_hpet(Monitor *mon, void *opaque)
+{
+    monitor_printf(mon, "HPET is %s by QEMU\n",
+                   (no_hpet) ? "disabled" : "enabled");
+}
+
+static const struct MonDevInfo hpet_info = {
+    .dev_name = "hpet",
+    .dev_info_cb = info_hpet,
+};
+
 /* PC hardware initialisation */
 static void pc_init1(ram_addr_t ram_size,
                      const char *boot_device,
@@ -1327,6 +1338,7 @@  static void pc_init1(ram_addr_t ram_size,
     if (!no_hpet) {
         hpet_init(isa_irq);
     }
+    monitor_register_device_info(&hpet_info, NULL);

     for(i = 0; i < MAX_SERIAL_PORTS; i++) {
         if (serial_hds[i]) {
diff --git a/monitor.c b/monitor.c
index 3d18885..202c457 100644
--- a/monitor.c
+++ b/monitor.c
@@ -315,14 +315,6 @@  static void do_info_name(Monitor *mon)
         monitor_printf(mon, "%s\n", qemu_name);
 }

-#if defined(TARGET_I386)
-static void do_info_hpet(Monitor *mon)
-{
-    monitor_printf(mon, "HPET is %s by QEMU\n",
-                   (no_hpet) ? "disabled" : "enabled");
-}
-#endif
-
 static void do_info_uuid(Monitor *mon)
 {
     monitor_printf(mon, UUID_FMT "\n", qemu_uuid[0], qemu_uuid[1],
@@ -1851,8 +1843,6 @@  static const mon_cmd_t info_cmds[] = {
 #if defined(TARGET_I386)
     { "mem", "", mem_info,
       "", "show the active virtual memory mappings", },
-    { "hpet", "", do_info_hpet,
-      "", "show state of HPET", },
 #endif
     { "jit", "", do_info_jit,
       "", "show dynamic compiler info", },
diff --git a/qemu-monitor.hx b/qemu-monitor.hx
index 54078e2..26f9cf7 100644
--- a/qemu-monitor.hx
+++ b/qemu-monitor.hx
@@ -49,8 +49,6 @@  show the command line history
 show virtual to physical memory mappings (i386 only)
 @item info mem
 show the active virtual memory mappings (i386 only)
-@item info hpet
-show state of HPET (i386 only)
 @item info kvm
 show KVM information
 @item info usb