spice/0002-server-red_memslots-use-QXLPHYSICAL-for-addresses.patch
2012-04-24 17:22:10 +03:00

48 lines
1.6 KiB
Diff

From 9ee43c37ce8dc028695d81728ac6da88bb79b653 Mon Sep 17 00:00:00 2001
From: Alon Levy <alevy@redhat.com>
Date: Wed, 21 Mar 2012 17:57:32 +0200
Subject: [PATCH 2/4] server/red_memslots: use QXLPHYSICAL for addresses
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.10