[Spice-devel] [PATCH 2/5] server/red_memslots: use QXLPHYSICAL for addresses

Alon Levy alevy at redhat.com
Wed Mar 21 09:00:55 PDT 2012


Cannot assume unsigned long == QXLPHYSICAL, not true for 32 bit
architectures.
---
 server/red_memslots.c |    2 +-
 server/red_memslots.h |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/server/red_memslots.c b/server/red_memslots.c
index 5057218..8c8f3cc 100644
--- a/server/red_memslots.c
+++ b/server/red_memslots.c
@@ -91,7 +91,7 @@ void validate_virt(RedMemSlotInfo *info, unsigned long virt, int slot_id,
     }
 }
 
-unsigned long get_virt(RedMemSlotInfo *info, unsigned long addr, uint32_t add_size,
+unsigned long get_virt(RedMemSlotInfo *info, QXLPHYSICAL addr, uint32_t add_size,
                        int group_id)
 {
     int slot_id;
diff --git a/server/red_memslots.h b/server/red_memslots.h
index 7aea0a3..75754d0 100644
--- a/server/red_memslots.h
+++ b/server/red_memslots.h
@@ -43,12 +43,12 @@ typedef struct RedMemSlotInfo {
     unsigned long memslot_clean_virt_mask;
 } RedMemSlotInfo;
 
-static inline int get_memslot_id(RedMemSlotInfo *info, unsigned long addr)
+static inline int get_memslot_id(RedMemSlotInfo *info, uint64_t addr)
 {
     return addr >> info->memslot_id_shift;
 }
 
-static inline int get_generation(RedMemSlotInfo *info, unsigned long addr)
+static inline int get_generation(RedMemSlotInfo *info, uint64_t addr)
 {
     return (addr >> info->memslot_gen_shift) & info->memslot_gen_mask;
 }
-- 
1.7.9.3



More information about the Spice-devel mailing list