qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Re: [PATCH] Remove IO_MEM_SUBWIDTH.


From: Richard Henderson
Subject: Re: [Qemu-devel] Re: [PATCH] Remove IO_MEM_SUBWIDTH.
Date: Tue, 27 Apr 2010 11:30:53 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc12 Thunderbird/3.0.4

On 04/26/2010 02:54 PM, Artyom Tarasenko wrote:
> This patch introduces a regression. qemu crashes on lance test:

I'm not sure how to get to this, since the sparc-test images don't
include ifconfig, and I havn't been able to find a sparc install
image that works (doesn't support sparc32 or sparc64 fails to load).

That said, try this and see if it works.


r~

---
diff --git a/exec.c b/exec.c
index 14d1fd7..572d3fd 100644
--- a/exec.c
+++ b/exec.c
@@ -3286,6 +3286,8 @@ static int cpu_register_io_memory_fixed(int io_index,
                                         CPUWriteMemoryFunc * const *mem_write,
                                         void *opaque)
 {
+    int i;
+
     if (io_index <= 0) {
         io_index = get_free_io_mem_idx();
         if (io_index == -1)
@@ -3296,8 +3298,14 @@ static int cpu_register_io_memory_fixed(int io_index,
             return -1;
     }
 
-    memcpy(io_mem_read[io_index], mem_read, 3 * sizeof(CPUReadMemoryFunc*));
-    memcpy(io_mem_write[io_index], mem_write, 3 * sizeof(CPUWriteMemoryFunc*));
+    for (i = 0; i < 3; ++i) {
+        io_mem_read[io_index][i]
+            = (mem_read[i] ? mem_read[i] : unassigned_mem_read[i]);
+    }
+    for (i = 0; i < 3; ++i) {
+        io_mem_write[io_index][i]
+            = (mem_write[i] ? mem_write[i] : unassigned_mem_write[i]);
+    }
     io_mem_opaque[io_index] = opaque;
 
     return (io_index << IO_MEM_SHIFT);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]