qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH qom-cpu v4 17/18] memory_mapping: Use hwaddr typ


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH qom-cpu v4 17/18] memory_mapping: Use hwaddr type for MemoryMapping virt_addr field
Date: Sun, 9 Jun 2013 18:17:26 +0100

On 9 June 2013 17:10, Andreas Färber <address@hidden> wrote:
> The memory mapping API uses hwaddr, so use it in the struct, too.
> This avoids a header dependency on target_ulong type.

> --- a/include/sysemu/memory_mapping.h
> +++ b/include/sysemu/memory_mapping.h
> @@ -20,7 +20,7 @@
>  /* The physical and virtual address in the memory mapping are contiguous. */
>  typedef struct MemoryMapping {
>      hwaddr phys_addr;
> -    target_ulong virt_addr;
> +    hwaddr virt_addr;
>      ram_addr_t length;

This seems kind of odd given that HACKING specifically
says that target_ulong is for virtual addresses and hwaddr
for physical addresses. And in fact all the places that call
memory_mapping_list_add_merge_sorted() actually pass a
target_ulong as the virt_addr parameter, so maybe what we
should be fixing is the function prototype?

Incidentally that use of ram_addr_t for length looks
kind of suspicious to me; it should probably be a hwaddr.

thanks
-- PMM



reply via email to

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