qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH qom-cpu v2 01/42] cpu: Introduce vaddr type


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH qom-cpu v2 01/42] cpu: Introduce vaddr type
Date: Mon, 15 Jul 2013 15:46:41 +0100

On 7 July 2013 19:25, Andreas Färber <address@hidden> wrote:
> vaddr is to target_ulong what uintmax_t is to unsigned int.
>
> Its purpose is to allow turning per-target functions with target_ulong
> arguments into CPUClass hooks.
>
> Suggested-by: Peter Maydell <address@hidden>
> Signed-off-by: Andreas Färber <address@hidden>
> ---
>  include/qom/cpu.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/include/qom/cpu.h b/include/qom/cpu.h
> index 147c256..4fd12a0 100644
> --- a/include/qom/cpu.h
> +++ b/include/qom/cpu.h
> @@ -29,6 +29,14 @@
>
>  typedef int (*WriteCoreDumpFunction)(void *buf, size_t size, void *opaque);
>
> +typedef uint64_t vaddr;
> +#define VADDR_PRId PRId64
> +#define VADDR_PRIu PRIu64
> +#define VADDR_PRIo PRIo64
> +#define VADDR_PRIx PRIx64
> +#define VADDR_PRIX PRIX64
> +#define VADDR_MAX UINT64_MAX
> +

This looks OK, but I think it could use a brief comment above
the typedef explaining its purpose, and an update to HACKING
to say when to use vaddr and when target_ulong.

thanks
-- PMM



reply via email to

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