ia64/xen-unstable

changeset 13518:1a45828882e9

[LIBXC] Handle trace-buffer cpumap endianness.
Original patch from Jimi Xenidis <jimix@watson.ibm.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Fri Jan 19 14:41:17 2007 +0000 (2007-01-19)
parents cd532c9351fc
children 1e5ad8ccb286
files tools/libxc/xc_tbuf.c
line diff
     1.1 --- a/tools/libxc/xc_tbuf.c	Fri Jan 19 14:36:12 2007 +0000
     1.2 +++ b/tools/libxc/xc_tbuf.c	Fri Jan 19 14:41:17 2007 +0000
     1.3 @@ -96,15 +96,19 @@ int xc_tbuf_set_cpu_mask(int xc_handle, 
     1.4  {
     1.5      DECLARE_SYSCTL;
     1.6      int ret = -1;
     1.7 +    uint64_t mask64 = mask;
     1.8 +    uint8_t bytemap[sizeof(mask64)];
     1.9  
    1.10      sysctl.cmd = XEN_SYSCTL_tbuf_op;
    1.11      sysctl.interface_version = XEN_SYSCTL_INTERFACE_VERSION;
    1.12      sysctl.u.tbuf_op.cmd  = XEN_SYSCTL_TBUFOP_set_cpu_mask;
    1.13  
    1.14 -    set_xen_guest_handle(sysctl.u.tbuf_op.cpu_mask.bitmap, (uint8_t *)&mask);
    1.15 -    sysctl.u.tbuf_op.cpu_mask.nr_cpus = sizeof(mask) * 8;
    1.16 +    bitmap_64_to_byte(bytemap, &mask64, sizeof (mask64));
    1.17  
    1.18 -    if ( lock_pages(&mask, sizeof(mask)) != 0 )
    1.19 +    set_xen_guest_handle(sysctl.u.tbuf_op.cpu_mask.bitmap, bytemap);
    1.20 +    sysctl.u.tbuf_op.cpu_mask.nr_cpus = sizeof(bytemap) * 8;
    1.21 +
    1.22 +    if ( lock_pages(&bytemap, sizeof(bytemap)) != 0 )
    1.23      {
    1.24          PERROR("Could not lock memory for Xen hypercall");
    1.25          goto out;
    1.26 @@ -112,7 +116,7 @@ int xc_tbuf_set_cpu_mask(int xc_handle, 
    1.27  
    1.28      ret = do_sysctl(xc_handle, &sysctl);
    1.29  
    1.30 -    unlock_pages(&mask, sizeof(mask));
    1.31 +    unlock_pages(&bytemap, sizeof(bytemap));
    1.32  
    1.33   out:
    1.34      return ret;