# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1169217677 0
# Node ID 1a45828882e9b49e4c5927541ea336ecd24c041b
# Parent cd532c9351fc746ac368bbd07180cfffc95ad9f0
[LIBXC] Handle trace-buffer cpumap endianness.
Original patch from Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
tools/libxc/xc_tbuf.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff -r cd532c9351fc -r 1a45828882e9 tools/libxc/xc_tbuf.c
--- a/tools/libxc/xc_tbuf.c Fri Jan 19 14:36:12 2007 +0000
+++ b/tools/libxc/xc_tbuf.c Fri Jan 19 14:41:17 2007 +0000
@@ -96,15 +96,19 @@ int xc_tbuf_set_cpu_mask(int xc_handle,
{
DECLARE_SYSCTL;
int ret = -1;
+ uint64_t mask64 = mask;
+ uint8_t bytemap[sizeof(mask64)];
sysctl.cmd = XEN_SYSCTL_tbuf_op;
sysctl.interface_version = XEN_SYSCTL_INTERFACE_VERSION;
sysctl.u.tbuf_op.cmd = XEN_SYSCTL_TBUFOP_set_cpu_mask;
- set_xen_guest_handle(sysctl.u.tbuf_op.cpu_mask.bitmap, (uint8_t *)&mask);
- sysctl.u.tbuf_op.cpu_mask.nr_cpus = sizeof(mask) * 8;
+ bitmap_64_to_byte(bytemap, &mask64, sizeof (mask64));
- if ( lock_pages(&mask, sizeof(mask)) != 0 )
+ set_xen_guest_handle(sysctl.u.tbuf_op.cpu_mask.bitmap, bytemap);
+ sysctl.u.tbuf_op.cpu_mask.nr_cpus = sizeof(bytemap) * 8;
+
+ if ( lock_pages(&bytemap, sizeof(bytemap)) != 0 )
{
PERROR("Could not lock memory for Xen hypercall");
goto out;
@@ -112,7 +116,7 @@ int xc_tbuf_set_cpu_mask(int xc_handle,
ret = do_sysctl(xc_handle, &sysctl);
- unlock_pages(&mask, sizeof(mask));
+ unlock_pages(&bytemap, sizeof(bytemap));
out:
return ret;
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|