qemu-devel
[Top][All Lists]
Advanced

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

Re: [RFC] q800: fix I/O memory map


From: Laurent Vivier
Subject: Re: [RFC] q800: fix I/O memory map
Date: Sat, 2 Nov 2019 19:10:27 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1

Paolo,

the RFC was mainly for you:

Is this the good way to replicate 256 times a memory chunk containing a
bunch of different MMIO spaces?

...
> +    /*
> +     * Memory from VIA_BASE to VIA_BASE + 0x40000 is repeated
> +     * from VIA_BASE + 0x40000 to VIA_BASE + 0x4000000
> +     */
> +    for (i = 1; i < 256; i++) {
> +        MemoryRegion *io = g_malloc(sizeof(*io));
> +        char *name = g_strdup_printf("mac_m68k.io[%d]", i);
> +
> +        memory_region_init_alias(io, NULL, name, get_system_memory(),
> +                                 VIA_BASE, 0x40000);
> +        memory_region_add_subregion(get_system_memory(),
> +                                    VIA_BASE + i * 0x40000, io);
> +        g_free(name);
> +    }
> +
...
Thanks,
Laurent



reply via email to

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