[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Re: [PATCH] Remove IO_MEM_SUBWIDTH.
From: |
Artyom Tarasenko |
Subject: |
Re: [Qemu-devel] Re: [PATCH] Remove IO_MEM_SUBWIDTH. |
Date: |
Wed, 28 Apr 2010 21:29:07 +0200 |
2010/4/27 Richard Henderson <address@hidden>:
> 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 <address@hidden>
--
Regards,
Artyom Tarasenko
solaris/sparc under qemu blog: http://tyom.blogspot.com/
- [Qemu-devel] [PATCH 1/2] io: Add CPUIOMemoryOps and use it., (continued)
- [Qemu-devel] [PATCH 1/2] io: Add CPUIOMemoryOps and use it., Richard Henderson, 2010/04/20
- Re: [Qemu-devel] [PATCH 0/2] [RFC] 64-bit io paths, Blue Swirl, 2010/04/22
- [Qemu-devel] [PATCH] Remove IO_MEM_SUBWIDTH., Richard Henderson, 2010/04/22
- [Qemu-devel] Re: [PATCH] Remove IO_MEM_SUBWIDTH., Blue Swirl, 2010/04/25
- Re: [Qemu-devel] Re: [PATCH] Remove IO_MEM_SUBWIDTH., Artyom Tarasenko, 2010/04/26
- Re: [Qemu-devel] Re: [PATCH] Remove IO_MEM_SUBWIDTH., Richard Henderson, 2010/04/27
- Re: [Qemu-devel] Re: [PATCH] Remove IO_MEM_SUBWIDTH.,
Artyom Tarasenko <=