qemu-devel@nongnu.org
[Top] [All Lists]

[Qemu-devel] [PATCH 1/5] Add OUT support to vmport.

Subject: [Qemu-devel] [PATCH 1/5] Add OUT support to vmport.
From: Gleb Natapov
Date: Thu, 05 Jun 2008 11:35:36 +0300
VMWare backdoor interface should work with IN/OUT port ops, but
currently only IN is supported. BACHS bios uses OUT to query UUID.
The patch adds OUT support.

Signed-off-by: Gleb Natapov <gleb@xxxxxxxxxxxx>
Reviewed-by: Anthony Liguori <aliguori@xxxxxxxxxx>
---

 hw/vmport.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/hw/vmport.c b/hw/vmport.c
index 3655ad1..ebfa921 100644
--- a/hw/vmport.c
+++ b/hw/vmport.c
@@ -72,6 +72,13 @@ static uint32_t vmport_ioport_read(void *opaque, uint32_t 
addr)
     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 +96,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);



<Prev in Thread] Current Thread [Next in Thread>