diff options
author | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-04-07 19:47:25 +0000 |
---|---|---|
committer | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-04-07 19:47:25 +0000 |
commit | 26fb5e48d9b4ab676b7b78e0f38e8e4ed126f047 (patch) | |
tree | 8a26110a839b6ff752a92ee2c8f0cb1005579161 /hw/vmport.c | |
parent | 4ce7ff6e68e9a13ff7da67d00cfc19e64e7aaef0 (diff) |
Fix vmmouse with -smp
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4165 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/vmport.c')
-rw-r--r-- | hw/vmport.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/hw/vmport.c b/hw/vmport.c index 8044c9fe6b..3655ad12d7 100644 --- a/hw/vmport.c +++ b/hw/vmport.c @@ -34,7 +34,6 @@ typedef struct _VMPortState { - CPUState *env; IOPortReadFunc *func[VMPORT_ENTRIES]; void *opaque[VMPORT_ENTRIES]; } VMPortState; @@ -53,14 +52,15 @@ void vmport_register(unsigned char command, IOPortReadFunc *func, void *opaque) static uint32_t vmport_ioport_read(void *opaque, uint32_t addr) { VMPortState *s = opaque; + CPUState *env = cpu_single_env; unsigned char command; uint32_t eax; - eax = s->env->regs[R_EAX]; + eax = env->regs[R_EAX]; if (eax != VMPORT_MAGIC) return eax; - command = s->env->regs[R_ECX]; + command = env->regs[R_ECX]; if (command >= VMPORT_ENTRIES) return eax; if (!s->func[command]) @@ -74,25 +74,23 @@ static uint32_t vmport_ioport_read(void *opaque, uint32_t addr) static uint32_t vmport_cmd_get_version(void *opaque, uint32_t addr) { - CPUState *env = opaque; + CPUState *env = cpu_single_env; env->regs[R_EBX] = VMPORT_MAGIC; return 6; } static uint32_t vmport_cmd_ram_size(void *opaque, uint32_t addr) { - CPUState *env = opaque; + CPUState *env = cpu_single_env; env->regs[R_EBX] = 0x1177; return ram_size; } -void vmport_init(CPUState *env) +void vmport_init(void) { - port_state.env = env; - register_ioport_read(0x5658, 1, 4, vmport_ioport_read, &port_state); /* Register some generic port commands */ - vmport_register(VMPORT_CMD_GETVERSION, vmport_cmd_get_version, env); - vmport_register(VMPORT_CMD_GETRAMSIZE, vmport_cmd_ram_size, env); + vmport_register(VMPORT_CMD_GETVERSION, vmport_cmd_get_version, NULL); + vmport_register(VMPORT_CMD_GETRAMSIZE, vmport_cmd_ram_size, NULL); } |