]> Git Repo - qemu.git/blobdiff - hw/vmport.c
linux-user: mremap(): handle MREMAP_FIXED and MREMAP_MAYMOVE correctly
[qemu.git] / hw / vmport.c
index 3655ad12d7941ca906e063de5e6499e40cf97ffb..884af3fd9191978e3eac91d28d4624e31a29176d 100644 (file)
@@ -26,6 +26,8 @@
 #include "pc.h"
 #include "sysemu.h"
 
+//#define VMPORT_DEBUG
+
 #define VMPORT_CMD_GETVERSION 0x0a
 #define VMPORT_CMD_GETRAMSIZE 0x14
 
@@ -65,13 +67,22 @@ static uint32_t vmport_ioport_read(void *opaque, uint32_t addr)
         return eax;
     if (!s->func[command])
     {
-        printf("vmport: unknown command %x\n", command);
+#ifdef VMPORT_DEBUG
+        fprintf(stderr, "vmport: unknown command %x\n", command);
+#endif
         return eax;
     }
 
     return s->func[command](s->opaque[command], addr);
 }
 
+static void vmport_ioport_write(void *opaque, uint32_t addr, uint32_t val)
+{
+    CPUState *env = cpu_single_env;
+
+    env->regs[R_EAX] = vmport_ioport_read(opaque, addr);
+}
+
 static uint32_t vmport_cmd_get_version(void *opaque, uint32_t addr)
 {
     CPUState *env = cpu_single_env;
@@ -89,6 +100,7 @@ static uint32_t vmport_cmd_ram_size(void *opaque, uint32_t addr)
 void vmport_init(void)
 {
     register_ioport_read(0x5658, 1, 4, vmport_ioport_read, &port_state);
+    register_ioport_write(0x5658, 1, 4, vmport_ioport_write, &port_state);
 
     /* Register some generic port commands */
     vmport_register(VMPORT_CMD_GETVERSION, vmport_cmd_get_version, NULL);
This page took 0.025837 seconds and 4 git commands to generate.