xen/15230-hvm-usb-windows-crash.patch

56 lines
1.7 KiB
Diff

# HG changeset patch
# User kfraser@localhost.localdomain
# Date 1181210543 -3600
# Node ID b090c290d9f8fc579be32ddd68f2bcd96e05aa03
# Parent 6d45351273da0b49ed328ef8077446c4ceedf3ff
tools: Fix some type issues GCC 4.1.0 warnings.
FC5's gcc 4.1.0 can't make some files in tools/ due to its stronger
type checking.
From: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
Index: xen-3.1-testing/tools/ioemu/target-i386-dm/exec-dm.c
===================================================================
--- xen-3.1-testing.orig/tools/ioemu/target-i386-dm/exec-dm.c
+++ xen-3.1-testing/tools/ioemu/target-i386-dm/exec-dm.c
@@ -445,18 +445,29 @@ extern unsigned long logdirty_bitmap_siz
void memcpy_words(void *dst, void *src, size_t n)
{
while (n >= sizeof(long)) {
- *((long *)dst)++ = *((long *)src)++;
+ *((long *)dst) = *((long *)src);
+ dst = ((long *)dst) + 1;
+ src = ((long *)src) + 1;
n -= sizeof(long);
}
- if (n & 4)
- *((uint32_t *)dst)++ = *((uint32_t *)src)++;
-
- if (n & 2)
- *((uint16_t *)dst)++ = *((uint16_t *)src)++;
+ if (n & 4) {
+ *((uint32_t *)dst) = *((uint32_t *)src);
+ dst = ((uint32_t *)dst) + 1;
+ src = ((uint32_t *)src) + 1;
+ }
+
+ if (n & 2) {
+ *((uint16_t *)dst) = *((uint16_t *)src);
+ dst = ((uint16_t *)dst) + 1;
+ src = ((uint16_t *)src) + 1;
+ }
- if (n & 1)
- *((uint8_t *)dst)++ = *((uint8_t *)src)++;
+ if (n & 1) {
+ *((uint8_t *)dst) = *((uint8_t *)src);
+ dst = ((uint8_t *)dst) + 1;
+ src = ((uint8_t *)src) + 1;
+ }
}
void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf,