direct-io.hg

changeset 11394:96a4379be74a

[XEN] interfaces: Remove explicit alignment/padding from domctl/sysctl hypercalls.

Generation of 32-on-64 compat shims is being semi-automated for all
other hypercalls. It seems sensible to teat all hypercalls uniformly
and do the same for the control-stack management interfaces too.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Aug 31 19:53:27 2006 +0100 (2006-08-31)
parents fd6c2b5e041f
children 63e3321fb16a
files xen/include/public/arch-ia64.h xen/include/public/arch-powerpc.h xen/include/public/arch-x86_32.h xen/include/public/arch-x86_64.h xen/include/public/domctl.h xen/include/public/sysctl.h
line diff
     1.1 --- a/xen/include/public/arch-ia64.h	Thu Aug 31 18:54:50 2006 +0100
     1.2 +++ b/xen/include/public/arch-ia64.h	Thu Aug 31 19:53:27 2006 +0100
     1.3 @@ -18,15 +18,12 @@
     1.4  
     1.5  #define DEFINE_XEN_GUEST_HANDLE(name)   __DEFINE_XEN_GUEST_HANDLE(name, name)
     1.6  #define XEN_GUEST_HANDLE(name)          __guest_handle_ ## name
     1.7 -#define XEN_GUEST_HANDLE_64(name)       __guest_handle_ ## name
     1.8  #define set_xen_guest_handle(hnd, val)  do { (hnd).p = val; } while (0)
     1.9  #ifdef __XEN_TOOLS__
    1.10  #define get_xen_guest_handle(val, hnd)  do { val = (hnd).p; } while (0)
    1.11  #endif
    1.12  
    1.13  #ifndef __ASSEMBLY__
    1.14 -typedef uint64_t uint64_aligned_t;
    1.15 -
    1.16  /* Guest handles for primitive C types. */
    1.17  __DEFINE_XEN_GUEST_HANDLE(uchar, unsigned char);
    1.18  __DEFINE_XEN_GUEST_HANDLE(uint,  unsigned int);
     2.1 --- a/xen/include/public/arch-powerpc.h	Thu Aug 31 18:54:50 2006 +0100
     2.2 +++ b/xen/include/public/arch-powerpc.h	Thu Aug 31 19:53:27 2006 +0100
     2.3 @@ -29,7 +29,6 @@
     2.4  
     2.5  #define DEFINE_XEN_GUEST_HANDLE(name) __DEFINE_XEN_GUEST_HANDLE(name, name)
     2.6  #define XEN_GUEST_HANDLE(name)        __guest_handle_ ## name
     2.7 -#define XEN_GUEST_HANDLE_64(name)     __guest_handle_ ## name
     2.8  #define set_xen_guest_handle(hnd, val) \
     2.9      do { \
    2.10          if (sizeof ((hnd).__pad)) \
    2.11 @@ -42,8 +41,6 @@
    2.12  #endif
    2.13  
    2.14  #ifndef __ASSEMBLY__
    2.15 -typedef uint64_t uint64_aligned_t;
    2.16 -
    2.17  /* Guest handles for primitive C types. */
    2.18  __DEFINE_XEN_GUEST_HANDLE(uchar, unsigned char);
    2.19  __DEFINE_XEN_GUEST_HANDLE(uint,  unsigned int);
     3.1 --- a/xen/include/public/arch-x86_32.h	Thu Aug 31 18:54:50 2006 +0100
     3.2 +++ b/xen/include/public/arch-x86_32.h	Thu Aug 31 19:53:27 2006 +0100
     3.3 @@ -28,14 +28,7 @@
     3.4  #endif
     3.5  
     3.6  /* Structural guest handles introduced in 0x00030201. */
     3.7 -#if (defined(__XEN__) || defined(__XEN_TOOLS__)) && !defined(__ASSEMBLY__)
     3.8 -typedef uint64_t __attribute__((aligned(8))) uint64_aligned_t;
     3.9 -#define __DEFINE_XEN_GUEST_HANDLE(name, type)                   \
    3.10 -    typedef struct { type *p; }                                 \
    3.11 -        __guest_handle_ ## name;                                \
    3.12 -    typedef struct { union { type *p; uint64_aligned_t q; }; }  \
    3.13 -        __guest_handle_64_ ## name
    3.14 -#elif __XEN_INTERFACE_VERSION__ >= 0x00030201
    3.15 +#if __XEN_INTERFACE_VERSION__ >= 0x00030201
    3.16  #define __DEFINE_XEN_GUEST_HANDLE(name, type) \
    3.17      typedef struct { type *p; } __guest_handle_ ## name
    3.18  #else
    3.19 @@ -45,15 +38,9 @@ typedef uint64_t __attribute__((aligned(
    3.20  
    3.21  #define DEFINE_XEN_GUEST_HANDLE(name)   __DEFINE_XEN_GUEST_HANDLE(name, name)
    3.22  #define XEN_GUEST_HANDLE(name)          __guest_handle_ ## name
    3.23 -#define XEN_GUEST_HANDLE_64(name)       __guest_handle_64_ ## name
    3.24 +#define set_xen_guest_handle(hnd, val)  do { (hnd).p = val; } while (0)
    3.25  #ifdef __XEN_TOOLS__
    3.26  #define get_xen_guest_handle(val, hnd)  do { val = (hnd).p; } while (0)
    3.27 -#define set_xen_guest_handle(hnd, val)                      \
    3.28 -    do { if ( sizeof(hnd) == 8 ) *(uint64_t *)&(hnd) = 0;   \
    3.29 -         (hnd).p = val;                                     \
    3.30 -    } while ( 0 )
    3.31 -#else
    3.32 -#define set_xen_guest_handle(hnd, val)  do { (hnd).p = val; } while (0)
    3.33  #endif
    3.34  
    3.35  #ifndef __ASSEMBLY__
     4.1 --- a/xen/include/public/arch-x86_64.h	Thu Aug 31 18:54:50 2006 +0100
     4.2 +++ b/xen/include/public/arch-x86_64.h	Thu Aug 31 19:53:27 2006 +0100
     4.3 @@ -39,15 +39,12 @@
     4.4  
     4.5  #define DEFINE_XEN_GUEST_HANDLE(name)   __DEFINE_XEN_GUEST_HANDLE(name, name)
     4.6  #define XEN_GUEST_HANDLE(name)          __guest_handle_ ## name
     4.7 -#define XEN_GUEST_HANDLE_64(name)       __guest_handle_ ## name
     4.8  #define set_xen_guest_handle(hnd, val)  do { (hnd).p = val; } while (0)
     4.9  #ifdef __XEN_TOOLS__
    4.10  #define get_xen_guest_handle(val, hnd)  do { val = (hnd).p; } while (0)
    4.11  #endif
    4.12  
    4.13  #ifndef __ASSEMBLY__
    4.14 -typedef uint64_t uint64_aligned_t;
    4.15 -
    4.16  /* Guest handles for primitive C types. */
    4.17  __DEFINE_XEN_GUEST_HANDLE(uchar, unsigned char);
    4.18  __DEFINE_XEN_GUEST_HANDLE(uint,  unsigned int);
     5.1 --- a/xen/include/public/domctl.h	Thu Aug 31 18:54:50 2006 +0100
     5.2 +++ b/xen/include/public/domctl.h	Thu Aug 31 19:53:27 2006 +0100
     5.3 @@ -16,12 +16,10 @@
     5.4  
     5.5  #include "xen.h"
     5.6  
     5.7 -#define XEN_DOMCTL_INTERFACE_VERSION 0x00000002
     5.8 -
     5.9 -#define uint64_t uint64_aligned_t
    5.10 +#define XEN_DOMCTL_INTERFACE_VERSION 0x00000003
    5.11  
    5.12  struct xenctl_cpumap {
    5.13 -    XEN_GUEST_HANDLE_64(uint8_t) bitmap;
    5.14 +    XEN_GUEST_HANDLE(uint8_t) bitmap;
    5.15      uint32_t nr_cpus;
    5.16  };
    5.17  
    5.18 @@ -76,7 +74,7 @@ struct xen_domctl_getmemlist {
    5.19      uint64_t max_pfns;
    5.20      /* Start index in guest's page list. */
    5.21      uint64_t start_pfn;
    5.22 -    XEN_GUEST_HANDLE_64(xen_pfn_t) buffer;
    5.23 +    XEN_GUEST_HANDLE(xen_pfn_t) buffer;
    5.24      /* OUT variables. */
    5.25      uint64_t num_pfns;
    5.26  };
    5.27 @@ -113,7 +111,7 @@ struct xen_domctl_getpageframeinfo2 {
    5.28      /* IN variables. */
    5.29      uint64_t num;
    5.30      /* IN/OUT variables. */
    5.31 -    XEN_GUEST_HANDLE_64(ulong) array;
    5.32 +    XEN_GUEST_HANDLE(ulong) array;
    5.33  };
    5.34  typedef struct xen_domctl_getpageframeinfo2 xen_domctl_getpageframeinfo2_t;
    5.35  DEFINE_XEN_GUEST_HANDLE(xen_domctl_getpageframeinfo2_t);
    5.36 @@ -187,7 +185,7 @@ struct xen_domctl_shadow_op {
    5.37      uint32_t       mb;       /* Shadow memory allocation in MB */
    5.38  
    5.39      /* OP_PEEK / OP_CLEAN */
    5.40 -    XEN_GUEST_HANDLE_64(ulong) dirty_bitmap;
    5.41 +    XEN_GUEST_HANDLE(ulong) dirty_bitmap;
    5.42      uint64_t       pages;    /* Size of buffer. Updated with actual size. */
    5.43      struct xen_domctl_shadow_op_stats stats;
    5.44  };
    5.45 @@ -207,8 +205,8 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_max_m
    5.46  #define XEN_DOMCTL_setvcpucontext    12
    5.47  #define XEN_DOMCTL_getvcpucontext    13
    5.48  struct xen_domctl_vcpucontext {
    5.49 -    uint32_t              vcpu;                     /* IN */
    5.50 -    XEN_GUEST_HANDLE_64(vcpu_guest_context_t) ctxt; /* IN/OUT */
    5.51 +    uint32_t              vcpu;                  /* IN */
    5.52 +    XEN_GUEST_HANDLE(vcpu_guest_context_t) ctxt; /* IN/OUT */
    5.53  };
    5.54  typedef struct xen_domctl_vcpucontext xen_domctl_vcpucontext_t;
    5.55  DEFINE_XEN_GUEST_HANDLE(xen_domctl_vcpucontext_t);
    5.56 @@ -381,8 +379,6 @@ struct xen_domctl {
    5.57  typedef struct xen_domctl xen_domctl_t;
    5.58  DEFINE_XEN_GUEST_HANDLE(xen_domctl_t);
    5.59  
    5.60 -#undef uint64_t
    5.61 -
    5.62  #endif /* __XEN_PUBLIC_DOMCTL_H__ */
    5.63  
    5.64  /*
     6.1 --- a/xen/include/public/sysctl.h	Thu Aug 31 18:54:50 2006 +0100
     6.2 +++ b/xen/include/public/sysctl.h	Thu Aug 31 19:53:27 2006 +0100
     6.3 @@ -16,9 +16,7 @@
     6.4  #include "xen.h"
     6.5  #include "domctl.h"
     6.6  
     6.7 -#define XEN_SYSCTL_INTERFACE_VERSION 0x00000001
     6.8 -
     6.9 -#define uint64_t uint64_aligned_t
    6.10 +#define XEN_SYSCTL_INTERFACE_VERSION 0x00000002
    6.11  
    6.12  /*
    6.13   * Read console content from Xen buffer ring.
    6.14 @@ -26,8 +24,8 @@
    6.15  #define XEN_SYSCTL_readconsole       1
    6.16  struct xen_sysctl_readconsole {
    6.17      /* IN variables. */
    6.18 -    uint32_t clear;                   /* Non-zero -> clear after reading. */
    6.19 -    XEN_GUEST_HANDLE_64(char) buffer; /* Buffer start */
    6.20 +    uint32_t clear;                /* Non-zero -> clear after reading. */
    6.21 +    XEN_GUEST_HANDLE(char) buffer; /* Buffer start */
    6.22      /* IN/OUT variables. */
    6.23      uint32_t count;            /* In: Buffer size;  Out: Used buffer size  */
    6.24  };
    6.25 @@ -105,9 +103,9 @@ struct xen_sysctl_perfc_op {
    6.26      uint32_t       nr_counters;       /*  number of counters description  */
    6.27      uint32_t       nr_vals;			  /*  number of values  */
    6.28      /* counter information (or NULL) */
    6.29 -    XEN_GUEST_HANDLE_64(xen_sysctl_perfc_desc_t) desc;
    6.30 +    XEN_GUEST_HANDLE(xen_sysctl_perfc_desc_t) desc;
    6.31      /* counter values (or NULL) */
    6.32 -    XEN_GUEST_HANDLE_64(xen_sysctl_perfc_val_t) val;
    6.33 +    XEN_GUEST_HANDLE(xen_sysctl_perfc_val_t) val;
    6.34  };
    6.35  typedef struct xen_sysctl_perfc_op xen_sysctl_perfc_op_t;
    6.36  DEFINE_XEN_GUEST_HANDLE(xen_sysctl_perfc_op_t);
    6.37 @@ -117,7 +115,7 @@ struct xen_sysctl_getdomaininfolist {
    6.38      /* IN variables. */
    6.39      domid_t               first_domain;
    6.40      uint32_t              max_domains;
    6.41 -    XEN_GUEST_HANDLE_64(xen_domctl_getdomaininfo_t) buffer;
    6.42 +    XEN_GUEST_HANDLE(xen_domctl_getdomaininfo_t) buffer;
    6.43      /* OUT variables. */
    6.44      uint32_t              num_domains;
    6.45  };
    6.46 @@ -140,8 +138,6 @@ struct xen_sysctl {
    6.47  typedef struct xen_sysctl xen_sysctl_t;
    6.48  DEFINE_XEN_GUEST_HANDLE(xen_sysctl_t);
    6.49  
    6.50 -#undef uint64_t
    6.51 -
    6.52  #endif /* __XEN_PUBLIC_SYSCTL_H__ */
    6.53  
    6.54  /*