[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/3] system/physmem: Assign global system I/O Memory to machi
From: |
Peter Maydell |
Subject: |
Re: [PATCH 3/3] system/physmem: Assign global system I/O Memory to machine |
Date: |
Fri, 9 Feb 2024 16:06:00 +0000 |
On Fri, 9 Feb 2024 at 15:01, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> So far there is only one system I/O and one system
> memory per machine.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> system/physmem.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/system/physmem.c b/system/physmem.c
> index 5e66d9ae36..50947a374e 100644
> --- a/system/physmem.c
> +++ b/system/physmem.c
> @@ -2554,12 +2554,13 @@ static void memory_map_init(void)
> {
> system_memory = g_malloc(sizeof(*system_memory));
>
> - memory_region_init(system_memory, NULL, "system", UINT64_MAX);
> + memory_region_init(system_memory, OBJECT(current_machine),
> + "system", UINT64_MAX);
> address_space_init(&address_space_memory, system_memory, "memory");
>
> system_io = g_malloc(sizeof(*system_io));
> - memory_region_init_io(system_io, NULL, &unassigned_io_ops, NULL, "io",
> - 65536);
> + memory_region_init_io(system_io, OBJECT(current_machine),
> + &unassigned_io_ops, NULL, "io", 65535);
> address_space_init(&address_space_io, system_io, "I/O");
> }
What's the intention in doing this? What does it change?
It seems to be OK to pass a non-Device owner in for
memory_region_init() (whereas it is *not* OK to do that
for memory_region_init_ram()), but this seems to be
getting a bit tricky.
thanks
-- PMM