qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [4165] Fix vmmouse with -smp
Date: Mon, 07 Apr 2008 19:47:26 +0000	[thread overview]
Message-ID: <E1JixJO-0004nv-EE@cvs.savannah.gnu.org> (raw)

Revision: 4165
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4165
Author:   aurel32
Date:     2008-04-07 19:47:25 +0000 (Mon, 07 Apr 2008)

Log Message:
-----------
Fix vmmouse with -smp

Modified Paths:
--------------
    trunk/hw/pc.c
    trunk/hw/pc.h
    trunk/hw/vmport.c

Modified: trunk/hw/pc.c
===================================================================
--- trunk/hw/pc.c	2008-04-07 19:47:14 UTC (rev 4164)
+++ trunk/hw/pc.c	2008-04-07 19:47:25 UTC (rev 4165)
@@ -748,9 +748,10 @@
         if (pci_enabled) {
             apic_init(env);
         }
-        vmport_init(env);
     }
 
+    vmport_init();
+
     /* allocate RAM */
     ram_addr = qemu_ram_alloc(ram_size);
     cpu_register_physical_memory(0, ram_size, ram_addr);

Modified: trunk/hw/pc.h
===================================================================
--- trunk/hw/pc.h	2008-04-07 19:47:14 UTC (rev 4164)
+++ trunk/hw/pc.h	2008-04-07 19:47:25 UTC (rev 4165)
@@ -59,7 +59,7 @@
 int pit_get_out(PITState *pit, int channel, int64_t current_time);
 
 /* vmport.c */
-void vmport_init(CPUState *env);
+void vmport_init(void);
 void vmport_register(unsigned char command, IOPortReadFunc *func, void *opaque);
 
 /* vmmouse.c */

Modified: trunk/hw/vmport.c
===================================================================
--- trunk/hw/vmport.c	2008-04-07 19:47:14 UTC (rev 4164)
+++ trunk/hw/vmport.c	2008-04-07 19:47:25 UTC (rev 4165)
@@ -34,7 +34,6 @@
 
 typedef struct _VMPortState
 {
-    CPUState *env;
     IOPortReadFunc *func[VMPORT_ENTRIES];
     void *opaque[VMPORT_ENTRIES];
 } VMPortState;
@@ -53,14 +52,15 @@
 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_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);
 }

                 reply	other threads:[~2008-04-07 19:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1JixJO-0004nv-EE@cvs.savannah.gnu.org \
    --to=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).