2010/4/27 Richard Henderson <r...@twiddle.net>:
> 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);
>

Looks good, thanks.

Acked-by: Artyom Tarasenko <atar4q...@gmail.com>


-- 
Regards,
Artyom Tarasenko

solaris/sparc under qemu blog: http://tyom.blogspot.com/


Reply via email to