Files
qemu-reims-vgpu/include/system/ram_addr.h
T
Peter Xu e2028f619c system: Define ram_addr_t to be always uint64_t
QEMU's 32bit host support was deprecated since 10.0 and removed in
11.0 (commit 372ec46b9f), at least system emulation part (cf634dfcd8
revived tools).  Now it's safe to move ram_addr_t completely over to
uint64_t.

It should be almost the same as uintptr_t as before for !Xen, except that
on some systems (like MacOS) uintptr_t and uint64_t can be typed slightly
differently, causing unnecessary compiler warnings when use them in a
mixture way.

Hopefully, this change also makes it clear that ram_addr_t is never used as
a host pointer in any form, but only an internal QEMU integer based address
space for allocating ramblocks.

[1] https://lore.kernel.org/r/d7b2fbf6-f9fa-4b39-8f40-95b7d5d0d8fb@oss.qualcomm.com

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Link: https://lore.kernel.org/r/20260818172012.3052821-2-peterx@redhat.com
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: "Philippe Mathieu-Daudé" <philmd@mailo.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
2026-09-18 07:36:52 -04:00

32 lines
725 B
C

/*
* Declarations of basic RAMBlock-related types and macros
*
* Copyright 2011 Red Hat, Inc. and/or its affiliates
*
* Authors:
* Avi Kivity <avi@redhat.com>
*
* This work is licensed under the terms of the GNU GPL, version 2 or
* later. See the COPYING file in the top-level directory.
*
*/
#ifndef RAM_ADDR_H
#define RAM_ADDR_H
/*
* QEMU's internal RAM address space for ramblock allocations (different
* from guest physical address).
*/
typedef uint64_t ram_addr_t;
#define RAM_ADDR_MAX UINT64_MAX
#define RAM_ADDR_FMT "%" PRIx64
#define DIRTY_MEMORY_VGA 0
#define DIRTY_MEMORY_CODE 1
#define DIRTY_MEMORY_MIGRATION 2
#define DIRTY_MEMORY_NUM 3 /* num of dirty bits */
#endif