summaryrefslogtreecommitdiff
path: root/drivers/vbus
diff options
context:
space:
mode:
authorIra W. Snyder <iws@ovro.caltech.edu>2009-12-08 16:12:32 -0500
committerGregory Haskins <ghaskins@novell.com>2009-12-08 16:12:32 -0500
commite1077ef3b2751766c4437e2f974e3d7372742d0d (patch)
tree7e9bbdf667fd7731a3c329ed516be5e6e87a1be2 /drivers/vbus
parentd8544b0386b7d6a1f70fe3b7a9f71dfd4e2dafc0 (diff)
ioq: clearly specify endianness
The IOQ code uses structures which are designed to be shared between disparate systems, such as 32-bit and 64-bit, as well as Linux and Windows. Since IOQ is primarily intended to be used by qemu/kvm, which support virtual guests with a different CPU architecture than the host, clearly define the endianness for the shared structures. The endianness is defined to be little-endian, to avoid byte swapping in the most common case: x86. Note that the cookie member was not changed to have a fixed endianness. This is because it is only intended for use by one side of the IOQ. Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu>
Diffstat (limited to 'drivers/vbus')
-rw-r--r--drivers/vbus/bus-proxy.c2
-rw-r--r--drivers/vbus/pci-bridge.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/vbus/bus-proxy.c b/drivers/vbus/bus-proxy.c
index a318c6754b4b..47928423a050 100644
--- a/drivers/vbus/bus-proxy.c
+++ b/drivers/vbus/bus-proxy.c
@@ -217,7 +217,7 @@ int vbus_driver_ioq_alloc(struct vbus_device_proxy *dev, const char *name,
head->magic = IOQ_RING_MAGIC;
head->ver = IOQ_RING_VER;
- head->count = count;
+ head->count = cpu_to_le32(count);
ret = dev->ops->shm(dev, name, id, prio, head, len,
&head->signal, &signal, 0);
diff --git a/drivers/vbus/pci-bridge.c b/drivers/vbus/pci-bridge.c
index 078b8f435ab9..0d513248dae6 100644
--- a/drivers/vbus/pci-bridge.c
+++ b/drivers/vbus/pci-bridge.c
@@ -579,8 +579,8 @@ eventq_init(int qlen)
BUG_ON(iter.desc->valid);
desc->cookie = (u64)(unsigned long)event;
- desc->ptr = (u64)__pa(event);
- desc->len = len; /* total length */
+ desc->ptr = cpu_to_le64(__pa(event));
+ desc->len = cpu_to_le64(len); /* total length */
desc->valid = 1;
/*
@@ -798,7 +798,7 @@ _ioq_init(size_t ringsize, struct ioq *ioq, struct ioq_ops *ops)
head->magic = IOQ_RING_MAGIC;
head->ver = IOQ_RING_VER;
- head->count = ringsize;
+ head->count = cpu_to_le32(ringsize);
_signal_init(signal, &head->signal, &eventq_signal_ops);