aboutsummaryrefslogtreecommitdiff
path: root/bswap.h
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2011-01-10 13:43:48 +0200
committerMichael S. Tsirkin <mst@redhat.com>2011-01-10 13:43:48 +0200
commit6107ff12922e5508a44b376b40a3041810cb00d2 (patch)
tree56098d53043a8fcdd01dbf0dca565ceab09f95b3 /bswap.h
parentbe92bbf73dfd7d8a4786dc5f6c71590f4fbc5a32 (diff)
parent8aaf42ed0f203da63860b0a3ab3ff2bdfe9b4cb0 (diff)
Merge remote branch 'origin/master' into pci
Diffstat (limited to 'bswap.h')
-rw-r--r--bswap.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/bswap.h b/bswap.h
index 20caae63ea..82a79517db 100644
--- a/bswap.h
+++ b/bswap.h
@@ -144,6 +144,7 @@ CPU_CONVERT(le, 64, uint64_t)
#define cpu_to_be16wu(p, v) cpu_to_be16w(p, v)
#define cpu_to_be32wu(p, v) cpu_to_be32w(p, v)
+#define cpu_to_be64wu(p, v) cpu_to_be64w(p, v)
#else
@@ -201,6 +202,20 @@ static inline void cpu_to_be32wu(uint32_t *p, uint32_t v)
p1[3] = v & 0xff;
}
+static inline void cpu_to_be64wu(uint64_t *p, uint64_t v)
+{
+ uint8_t *p1 = (uint8_t *)p;
+
+ p1[0] = v >> 56;
+ p1[1] = v >> 48;
+ p1[2] = v >> 40;
+ p1[3] = v >> 32;
+ p1[4] = v >> 24;
+ p1[5] = v >> 16;
+ p1[6] = v >> 8;
+ p1[7] = v & 0xff;
+}
+
#endif
#ifdef HOST_WORDS_BIGENDIAN