]> git.proxmox.com Git - mirror_qemu.git/commitdiff
Use the framework for the VMware mouse emulation, by Herve Poussineau.
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 26 Aug 2007 17:46:38 +0000 (17:46 +0000)
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 26 Aug 2007 17:46:38 +0000 (17:46 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3150 c046a42c-6fe2-441c-8c8c-71466251a162

hw/pc.c
hw/vmmouse.c

diff --git a/hw/pc.c b/hw/pc.c
index d38018679a1b8ae30d998b239218751cc6523fb3..495f6c033384d7c00ea9fc099711d71e42eceb01 100644 (file)
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -692,6 +692,7 @@ static void pc_init1(int ram_size, int vga_ram_size, int boot_device,
         if (pci_enabled) {
             apic_init(env);
         }
+        vmport_init(env);
     }
 
     /* allocate RAM */
index c10c26e2dd6a0f441ac2196e8f65486b8ca19856..52c8e0c78d83baef1c552b52635ad16cfc9b0e54 100644 (file)
@@ -39,7 +39,6 @@
 
 #define VMMOUSE_QUEUE_SIZE     1024
 
-#define VMMOUSE_MAGIC          0x564D5868
 #define VMMOUSE_VERSION                0x3442554a
 
 #ifdef DEBUG_VMMOUSE
@@ -58,13 +57,6 @@ typedef struct _VMMouseState
     void *ps2_mouse;
 } VMMouseState;
 
-static uint32_t vmmouse_get_version(VMMouseState *s, uint32_t *magic)
-{
-    DPRINTF("vmmouse_get_version(%x)\n", *magic);
-    *magic = VMMOUSE_MAGIC;
-    return VMMOUSE_VERSION;
-}
-
 static uint32_t vmmouse_get_status(VMMouseState *s)
 {
     DPRINTF("vmmouse_get_status()\n");
@@ -201,15 +193,10 @@ static uint32_t vmmouse_ioport_read(void *opaque, uint32_t addr)
     uint16_t command;
 
     vmmouse_get_data(data);
-    if (data[0] != VMMOUSE_MAGIC)
-        goto error;
 
     command = data[2] & 0xFFFF;
 
     switch (command) {
-    case VMMOUSE_GETVERSION:
-        data[0] = vmmouse_get_version(s, &data[1]);
-        break;
     case VMMOUSE_STATUS:
         data[0] = vmmouse_get_status(s);
         break;
@@ -240,7 +227,6 @@ static uint32_t vmmouse_ioport_read(void *opaque, uint32_t addr)
         break;
     }
 
-error:
     vmmouse_set_data(data);
     return data[0];
 }
@@ -292,7 +278,9 @@ void *vmmouse_init(void *m)
     s->status = 0xffff;
     s->ps2_mouse = m;
 
-    register_ioport_read(0x5658, 1, 4, vmmouse_ioport_read, s);
+    vmport_register(VMMOUSE_STATUS, vmmouse_ioport_read, s);
+    vmport_register(VMMOUSE_COMMAND, vmmouse_ioport_read, s);
+    vmport_register(VMMOUSE_DATA, vmmouse_ioport_read, s);
     register_savevm("vmmouse", 0, 0, vmmouse_save, vmmouse_load, s);
 
     return s;