ia64/xen-unstable

changeset 9136:2307bf2a4bfc

Rename guest_handle() macro to GUEST_HANDLE() and define_guest_handle()
to DEFINE_GUEST_HANDLE(). All caps for datatype declarations and
definitions got the popular vote. :-)

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Mar 03 19:21:48 2006 +0100 (2006-03-03)
parents aefc75f5db5e
children eb24eb6bc341
files xen/arch/ia64/xen/dom0_ops.c xen/arch/x86/dom0_ops.c xen/arch/x86/mm.c xen/arch/x86/x86_32/mm.c xen/arch/x86/x86_64/mm.c xen/common/dom0_ops.c xen/common/memory.c xen/common/perfc.c xen/drivers/char/console.c xen/include/asm-x86/mm.h xen/include/public/arch-ia64.h xen/include/public/arch-x86_32.h xen/include/public/arch-x86_64.h xen/include/public/dom0_ops.h xen/include/public/memory.h xen/include/public/xen.h xen/include/xen/console.h xen/include/xen/guest_access.h xen/include/xen/sched.h
line diff
     1.1 --- a/xen/arch/ia64/xen/dom0_ops.c	Fri Mar 03 19:07:55 2006 +0100
     1.2 +++ b/xen/arch/ia64/xen/dom0_ops.c	Fri Mar 03 19:21:48 2006 +0100
     1.3 @@ -20,7 +20,7 @@
     1.4  #include <public/sched_ctl.h>
     1.5  #include <asm/vmx.h>
     1.6  
     1.7 -long arch_do_dom0_op(dom0_op_t *op, guest_handle(dom0_op_t) u_dom0_op)
     1.8 +long arch_do_dom0_op(dom0_op_t *op, GUEST_HANDLE(dom0_op_t) u_dom0_op)
     1.9  {
    1.10      long ret = 0;
    1.11  
     2.1 --- a/xen/arch/x86/dom0_ops.c	Fri Mar 03 19:07:55 2006 +0100
     2.2 +++ b/xen/arch/x86/dom0_ops.c	Fri Mar 03 19:21:48 2006 +0100
     2.3 @@ -49,7 +49,7 @@ static void read_msr_for(void *unused)
     2.4          (void)rdmsr_safe(msr_addr, msr_lo, msr_hi);
     2.5  }
     2.6  
     2.7 -long arch_do_dom0_op(struct dom0_op *op, guest_handle(dom0_op_t) u_dom0_op)
     2.8 +long arch_do_dom0_op(struct dom0_op *op, GUEST_HANDLE(dom0_op_t) u_dom0_op)
     2.9  {
    2.10      long ret = 0;
    2.11  
     3.1 --- a/xen/arch/x86/mm.c	Fri Mar 03 19:07:55 2006 +0100
     3.2 +++ b/xen/arch/x86/mm.c	Fri Mar 03 19:21:48 2006 +0100
     3.3 @@ -2788,7 +2788,7 @@ long do_update_descriptor(u64 pa, u64 de
     3.4  }
     3.5  
     3.6  
     3.7 -long arch_memory_op(int op, guest_handle(void) arg)
     3.8 +long arch_memory_op(int op, GUEST_HANDLE(void) arg)
     3.9  {
    3.10      struct xen_reserved_phys_area xrpa;
    3.11      unsigned long pfn;
     4.1 --- a/xen/arch/x86/x86_32/mm.c	Fri Mar 03 19:07:55 2006 +0100
     4.2 +++ b/xen/arch/x86/x86_32/mm.c	Fri Mar 03 19:21:48 2006 +0100
     4.3 @@ -192,7 +192,7 @@ void subarch_init_memory(struct domain *
     4.4      }
     4.5  }
     4.6  
     4.7 -long subarch_memory_op(int op, guest_handle(void) arg)
     4.8 +long subarch_memory_op(int op, GUEST_HANDLE(void) arg)
     4.9  {
    4.10      struct xen_machphys_mfn_list xmml;
    4.11      unsigned long mfn;
     5.1 --- a/xen/arch/x86/x86_64/mm.c	Fri Mar 03 19:07:55 2006 +0100
     5.2 +++ b/xen/arch/x86/x86_64/mm.c	Fri Mar 03 19:21:48 2006 +0100
     5.3 @@ -183,7 +183,7 @@ void subarch_init_memory(struct domain *
     5.4      }
     5.5  }
     5.6  
     5.7 -long subarch_memory_op(int op, guest_handle(void) arg)
     5.8 +long subarch_memory_op(int op, GUEST_HANDLE(void) arg)
     5.9  {
    5.10      struct xen_machphys_mfn_list xmml;
    5.11      l3_pgentry_t l3e;
     6.1 --- a/xen/common/dom0_ops.c	Fri Mar 03 19:07:55 2006 +0100
     6.2 +++ b/xen/common/dom0_ops.c	Fri Mar 03 19:21:48 2006 +0100
     6.3 @@ -24,7 +24,7 @@
     6.4  #include <acm/acm_hooks.h>
     6.5  
     6.6  extern long arch_do_dom0_op(
     6.7 -    struct dom0_op *op, guest_handle(dom0_op_t) u_dom0_op);
     6.8 +    struct dom0_op *op, GUEST_HANDLE(dom0_op_t) u_dom0_op);
     6.9  extern void arch_getdomaininfo_ctxt(
    6.10      struct vcpu *, struct vcpu_guest_context *);
    6.11  
    6.12 @@ -90,7 +90,7 @@ static void getdomaininfo(struct domain 
    6.13      memcpy(info->handle, d->handle, sizeof(xen_domain_handle_t));
    6.14  }
    6.15  
    6.16 -long do_dom0_op(guest_handle(dom0_op_t) u_dom0_op)
    6.17 +long do_dom0_op(GUEST_HANDLE(dom0_op_t) u_dom0_op)
    6.18  {
    6.19      long ret = 0;
    6.20      struct dom0_op curop, *op = &curop;
     7.1 --- a/xen/common/memory.c	Fri Mar 03 19:07:55 2006 +0100
     7.2 +++ b/xen/common/memory.c	Fri Mar 03 19:21:48 2006 +0100
     7.3 @@ -31,7 +31,7 @@
     7.4  static long
     7.5  increase_reservation(
     7.6      struct domain *d, 
     7.7 -    guest_handle(ulong) extent_list,
     7.8 +    GUEST_HANDLE(ulong) extent_list,
     7.9      unsigned int   nr_extents,
    7.10      unsigned int   extent_order,
    7.11      unsigned int   flags,
    7.12 @@ -80,7 +80,7 @@ increase_reservation(
    7.13  static long
    7.14  populate_physmap(
    7.15      struct domain *d, 
    7.16 -    guest_handle(ulong) extent_list,
    7.17 +    GUEST_HANDLE(ulong) extent_list,
    7.18      unsigned int  nr_extents,
    7.19      unsigned int  extent_order,
    7.20      unsigned int  flags,
    7.21 @@ -141,7 +141,7 @@ populate_physmap(
    7.22  static long
    7.23  decrease_reservation(
    7.24      struct domain *d,
    7.25 -    guest_handle(ulong) extent_list,
    7.26 +    GUEST_HANDLE(ulong) extent_list,
    7.27      unsigned int   nr_extents,
    7.28      unsigned int   extent_order,
    7.29      unsigned int   flags,
    7.30 @@ -198,7 +198,7 @@ decrease_reservation(
    7.31  
    7.32  static long
    7.33  translate_gpfn_list(
    7.34 -    guest_handle(xen_translate_gpfn_list_t) uop, unsigned long *progress)
    7.35 +    GUEST_HANDLE(xen_translate_gpfn_list_t) uop, unsigned long *progress)
    7.36  {
    7.37      struct xen_translate_gpfn_list op;
    7.38      unsigned long i, gpfn, mfn;
    7.39 @@ -257,7 +257,7 @@ translate_gpfn_list(
    7.40      return 0;
    7.41  }
    7.42  
    7.43 -long do_memory_op(unsigned long cmd, guest_handle(void) arg)
    7.44 +long do_memory_op(unsigned long cmd, GUEST_HANDLE(void) arg)
    7.45  {
    7.46      struct domain *d;
    7.47      int rc, op, flags = 0, preempted = 0;
     8.1 --- a/xen/common/perfc.c	Fri Mar 03 19:07:55 2006 +0100
     8.2 +++ b/xen/common/perfc.c	Fri Mar 03 19:21:48 2006 +0100
     8.3 @@ -132,7 +132,7 @@ void perfc_reset(unsigned char key)
     8.4  
     8.5  static dom0_perfc_desc_t perfc_d[NR_PERFCTRS];
     8.6  static int               perfc_init = 0;
     8.7 -static int perfc_copy_info(guest_handle(dom0_perfc_desc_t) desc)
     8.8 +static int perfc_copy_info(GUEST_HANDLE(dom0_perfc_desc_t) desc)
     8.9  {
    8.10      unsigned int i, j;
    8.11      atomic_t *counters = (atomic_t *)&perfcounters;
     9.1 --- a/xen/drivers/char/console.c	Fri Mar 03 19:07:55 2006 +0100
     9.2 +++ b/xen/drivers/char/console.c	Fri Mar 03 19:21:48 2006 +0100
     9.3 @@ -222,7 +222,7 @@ static void putchar_console_ring(int c)
     9.4          conringc = conringp - CONRING_SIZE;
     9.5  }
     9.6  
     9.7 -long read_console_ring(guest_handle(char) str, u32 *pcount, int clear)
     9.8 +long read_console_ring(GUEST_HANDLE(char) str, u32 *pcount, int clear)
     9.9  {
    9.10      unsigned int idx, len, max, sofar, c;
    9.11      unsigned long flags;
    10.1 --- a/xen/include/asm-x86/mm.h	Fri Mar 03 19:07:55 2006 +0100
    10.2 +++ b/xen/include/asm-x86/mm.h	Fri Mar 03 19:21:48 2006 +0100
    10.3 @@ -380,7 +380,7 @@ void propagate_page_fault(unsigned long 
    10.4  int __sync_lazy_execstate(void);
    10.5  
    10.6  /* Arch-specific portion of memory_op hypercall. */
    10.7 -long arch_memory_op(int op, guest_handle(void) arg);
    10.8 -long subarch_memory_op(int op, guest_handle(void) arg);
    10.9 +long arch_memory_op(int op, GUEST_HANDLE(void) arg);
   10.10 +long subarch_memory_op(int op, GUEST_HANDLE(void) arg);
   10.11  
   10.12  #endif /* __ASM_X86_MM_H__ */
    11.1 --- a/xen/include/public/arch-ia64.h	Fri Mar 03 19:07:55 2006 +0100
    11.2 +++ b/xen/include/public/arch-ia64.h	Fri Mar 03 19:21:48 2006 +0100
    11.3 @@ -298,7 +298,7 @@ typedef struct vcpu_guest_context {
    11.4      arch_initrd_info_t initrd;
    11.5      char cmdline[IA64_COMMAND_LINE_SIZE];
    11.6  } vcpu_guest_context_t;
    11.7 -define_guest_handle(vcpu_guest_context_t);
    11.8 +DEFINE_GUEST_HANDLE(vcpu_guest_context_t);
    11.9  
   11.10  #endif /* !__ASSEMBLY__ */
   11.11  
    12.1 --- a/xen/include/public/arch-x86_32.h	Fri Mar 03 19:07:55 2006 +0100
    12.2 +++ b/xen/include/public/arch-x86_32.h	Fri Mar 03 19:21:48 2006 +0100
    12.3 @@ -130,7 +130,7 @@ typedef struct vcpu_guest_context {
    12.4      unsigned long failsafe_callback_eip;
    12.5      unsigned long vm_assist;                /* VMASST_TYPE_* bitmap */
    12.6  } vcpu_guest_context_t;
    12.7 -define_guest_handle(vcpu_guest_context_t);
    12.8 +DEFINE_GUEST_HANDLE(vcpu_guest_context_t);
    12.9  
   12.10  typedef struct arch_shared_info {
   12.11      unsigned long max_pfn;                  /* max pfn that appears in table */
    13.1 --- a/xen/include/public/arch-x86_64.h	Fri Mar 03 19:07:55 2006 +0100
    13.2 +++ b/xen/include/public/arch-x86_64.h	Fri Mar 03 19:21:48 2006 +0100
    13.3 @@ -215,7 +215,7 @@ typedef struct vcpu_guest_context {
    13.4      uint64_t      gs_base_kernel;
    13.5      uint64_t      gs_base_user;
    13.6  } vcpu_guest_context_t;
    13.7 -define_guest_handle(vcpu_guest_context_t);
    13.8 +DEFINE_GUEST_HANDLE(vcpu_guest_context_t);
    13.9  
   13.10  typedef struct arch_shared_info {
   13.11      unsigned long max_pfn;                  /* max pfn that appears in table */
    14.1 --- a/xen/include/public/dom0_ops.h	Fri Mar 03 19:07:55 2006 +0100
    14.2 +++ b/xen/include/public/dom0_ops.h	Fri Mar 03 19:21:48 2006 +0100
    14.3 @@ -28,21 +28,21 @@ typedef struct dom0_getmemlist {
    14.4      /* IN variables. */
    14.5      domid_t       domain;
    14.6      unsigned long max_pfns;
    14.7 -    guest_handle(ulong) buffer;
    14.8 +    GUEST_HANDLE(ulong) buffer;
    14.9      /* OUT variables. */
   14.10      unsigned long num_pfns;
   14.11  } dom0_getmemlist_t;
   14.12 -define_guest_handle(dom0_getmemlist_t);
   14.13 +DEFINE_GUEST_HANDLE(dom0_getmemlist_t);
   14.14  
   14.15  #define DOM0_SCHEDCTL          6
   14.16   /* struct sched_ctl_cmd is from sched-ctl.h   */
   14.17  typedef struct sched_ctl_cmd dom0_schedctl_t;
   14.18 -define_guest_handle(dom0_schedctl_t);
   14.19 +DEFINE_GUEST_HANDLE(dom0_schedctl_t);
   14.20  
   14.21  #define DOM0_ADJUSTDOM         7
   14.22  /* struct sched_adjdom_cmd is from sched-ctl.h */
   14.23  typedef struct sched_adjdom_cmd dom0_adjustdom_t;
   14.24 -define_guest_handle(dom0_adjustdom_t);
   14.25 +DEFINE_GUEST_HANDLE(dom0_adjustdom_t);
   14.26  
   14.27  #define DOM0_CREATEDOMAIN      8
   14.28  typedef struct dom0_createdomain {
   14.29 @@ -53,28 +53,28 @@ typedef struct dom0_createdomain {
   14.30      /* Identifier for new domain (auto-allocate if zero is specified). */
   14.31      domid_t domain;
   14.32  } dom0_createdomain_t;
   14.33 -define_guest_handle(dom0_createdomain_t);
   14.34 +DEFINE_GUEST_HANDLE(dom0_createdomain_t);
   14.35  
   14.36  #define DOM0_DESTROYDOMAIN     9
   14.37  typedef struct dom0_destroydomain {
   14.38      /* IN variables. */
   14.39      domid_t domain;
   14.40  } dom0_destroydomain_t;
   14.41 -define_guest_handle(dom0_destroydomain_t);
   14.42 +DEFINE_GUEST_HANDLE(dom0_destroydomain_t);
   14.43  
   14.44  #define DOM0_PAUSEDOMAIN      10
   14.45  typedef struct dom0_pausedomain {
   14.46      /* IN parameters. */
   14.47      domid_t domain;
   14.48  } dom0_pausedomain_t;
   14.49 -define_guest_handle(dom0_pausedomain_t);
   14.50 +DEFINE_GUEST_HANDLE(dom0_pausedomain_t);
   14.51  
   14.52  #define DOM0_UNPAUSEDOMAIN    11
   14.53  typedef struct dom0_unpausedomain {
   14.54      /* IN parameters. */
   14.55      domid_t domain;
   14.56  } dom0_unpausedomain_t;
   14.57 -define_guest_handle(dom0_unpausedomain_t);
   14.58 +DEFINE_GUEST_HANDLE(dom0_unpausedomain_t);
   14.59  
   14.60  #define DOM0_GETDOMAININFO    12
   14.61  typedef struct dom0_getdomaininfo {
   14.62 @@ -100,7 +100,7 @@ typedef struct dom0_getdomaininfo {
   14.63      uint32_t ssidref;
   14.64      xen_domain_handle_t handle;
   14.65  } dom0_getdomaininfo_t;
   14.66 -define_guest_handle(dom0_getdomaininfo_t);
   14.67 +DEFINE_GUEST_HANDLE(dom0_getdomaininfo_t);
   14.68  
   14.69  #define DOM0_SETVCPUCONTEXT   13
   14.70  typedef struct dom0_setvcpucontext {
   14.71 @@ -108,9 +108,9 @@ typedef struct dom0_setvcpucontext {
   14.72      domid_t               domain;
   14.73      uint32_t              vcpu;
   14.74      /* IN/OUT parameters */
   14.75 -    guest_handle(vcpu_guest_context_t) ctxt;
   14.76 +    GUEST_HANDLE(vcpu_guest_context_t) ctxt;
   14.77  } dom0_setvcpucontext_t;
   14.78 -define_guest_handle(dom0_setvcpucontext_t);
   14.79 +DEFINE_GUEST_HANDLE(dom0_setvcpucontext_t);
   14.80  
   14.81  #define DOM0_MSR              15
   14.82  typedef struct dom0_msr {
   14.83 @@ -124,7 +124,7 @@ typedef struct dom0_msr {
   14.84      uint32_t out1;
   14.85      uint32_t out2;
   14.86  } dom0_msr_t;
   14.87 -define_guest_handle(dom0_msr_t);
   14.88 +DEFINE_GUEST_HANDLE(dom0_msr_t);
   14.89  
   14.90  /*
   14.91   * Set clock such that it would read <secs,nsecs> after 00:00:00 UTC,
   14.92 @@ -137,7 +137,7 @@ typedef struct dom0_settime {
   14.93      uint32_t nsecs;
   14.94      uint64_t system_time;
   14.95  } dom0_settime_t;
   14.96 -define_guest_handle(dom0_settime_t);
   14.97 +DEFINE_GUEST_HANDLE(dom0_settime_t);
   14.98  
   14.99  #define DOM0_GETPAGEFRAMEINFO 18
  14.100  #define NOTAB 0         /* normal page */
  14.101 @@ -158,7 +158,7 @@ typedef struct dom0_getpageframeinfo {
  14.102      /* Is the page PINNED to a type? */
  14.103      uint32_t type;         /* see above type defs */
  14.104  } dom0_getpageframeinfo_t;
  14.105 -define_guest_handle(dom0_getpageframeinfo_t);
  14.106 +DEFINE_GUEST_HANDLE(dom0_getpageframeinfo_t);
  14.107  
  14.108  /*
  14.109   * Read console content from Xen buffer ring.
  14.110 @@ -168,10 +168,10 @@ typedef struct dom0_readconsole {
  14.111      /* IN variables. */
  14.112      uint32_t clear;            /* Non-zero -> clear after reading. */
  14.113      /* IN/OUT variables. */
  14.114 -    guest_handle(char) buffer; /* In: Buffer start; Out: Used buffer start */
  14.115 +    GUEST_HANDLE(char) buffer; /* In: Buffer start; Out: Used buffer start */
  14.116      uint32_t count;            /* In: Buffer size;  Out: Used buffer size  */
  14.117  } dom0_readconsole_t;
  14.118 -define_guest_handle(dom0_readconsole_t);
  14.119 +DEFINE_GUEST_HANDLE(dom0_readconsole_t);
  14.120  
  14.121  /* 
  14.122   * Set which physical cpus a vcpu can execute on.
  14.123 @@ -183,7 +183,7 @@ typedef struct dom0_setvcpuaffinity {
  14.124      uint32_t  vcpu;
  14.125      cpumap_t  cpumap;
  14.126  } dom0_setvcpuaffinity_t;
  14.127 -define_guest_handle(dom0_setvcpuaffinity_t);
  14.128 +DEFINE_GUEST_HANDLE(dom0_setvcpuaffinity_t);
  14.129  
  14.130  /* Get trace buffers machine base address */
  14.131  #define DOM0_TBUFCONTROL       21
  14.132 @@ -203,7 +203,7 @@ typedef struct dom0_tbufcontrol {
  14.133      unsigned long buffer_mfn;
  14.134      uint32_t size;
  14.135  } dom0_tbufcontrol_t;
  14.136 -define_guest_handle(dom0_tbufcontrol_t);
  14.137 +DEFINE_GUEST_HANDLE(dom0_tbufcontrol_t);
  14.138  
  14.139  /*
  14.140   * Get physical information about the host machine
  14.141 @@ -219,7 +219,7 @@ typedef struct dom0_physinfo {
  14.142      unsigned long free_pages;
  14.143      uint32_t hw_cap[8];
  14.144  } dom0_physinfo_t;
  14.145 -define_guest_handle(dom0_physinfo_t);
  14.146 +DEFINE_GUEST_HANDLE(dom0_physinfo_t);
  14.147  
  14.148  /*
  14.149   * Get the ID of the current scheduler.
  14.150 @@ -229,7 +229,7 @@ typedef struct dom0_sched_id {
  14.151      /* OUT variable */
  14.152      uint32_t sched_id;
  14.153  } dom0_sched_id_t;
  14.154 -define_guest_handle(dom0_sched_id_t);
  14.155 +DEFINE_GUEST_HANDLE(dom0_sched_id_t);
  14.156  
  14.157  /* 
  14.158   * Control shadow pagetables operation
  14.159 @@ -251,19 +251,19 @@ typedef struct dom0_shadow_control_stats
  14.160      uint32_t dirty_net_count;     
  14.161      uint32_t dirty_block_count;     
  14.162  } dom0_shadow_control_stats_t;
  14.163 -define_guest_handle(dom0_shadow_control_stats_t);
  14.164 +DEFINE_GUEST_HANDLE(dom0_shadow_control_stats_t);
  14.165  
  14.166  typedef struct dom0_shadow_control {
  14.167      /* IN variables. */
  14.168      domid_t        domain;
  14.169      uint32_t       op;
  14.170 -    guest_handle(ulong) dirty_bitmap;
  14.171 +    GUEST_HANDLE(ulong) dirty_bitmap;
  14.172      /* IN/OUT variables. */
  14.173      unsigned long  pages;        /* size of buffer, updated with actual size */
  14.174      /* OUT variables. */
  14.175      dom0_shadow_control_stats_t stats;
  14.176  } dom0_shadow_control_t;
  14.177 -define_guest_handle(dom0_shadow_control_t);
  14.178 +DEFINE_GUEST_HANDLE(dom0_shadow_control_t);
  14.179  
  14.180  #define DOM0_SETDOMAINMAXMEM   28
  14.181  typedef struct dom0_setdomainmaxmem {
  14.182 @@ -271,7 +271,7 @@ typedef struct dom0_setdomainmaxmem {
  14.183      domid_t       domain;
  14.184      unsigned long max_memkb;
  14.185  } dom0_setdomainmaxmem_t;
  14.186 -define_guest_handle(dom0_setdomainmaxmem_t);
  14.187 +DEFINE_GUEST_HANDLE(dom0_setdomainmaxmem_t);
  14.188  
  14.189  #define DOM0_GETPAGEFRAMEINFO2 29   /* batched interface */
  14.190  typedef struct dom0_getpageframeinfo2 {
  14.191 @@ -279,9 +279,9 @@ typedef struct dom0_getpageframeinfo2 {
  14.192      domid_t        domain;
  14.193      unsigned long  num;
  14.194      /* IN/OUT variables. */
  14.195 -    guest_handle(ulong) array;
  14.196 +    GUEST_HANDLE(ulong) array;
  14.197  } dom0_getpageframeinfo2_t;
  14.198 -define_guest_handle(dom0_getpageframeinfo2_t);
  14.199 +DEFINE_GUEST_HANDLE(dom0_getpageframeinfo2_t);
  14.200  
  14.201  /*
  14.202   * Request memory range (@mfn, @mfn+@nr_mfns-1) to have type @type.
  14.203 @@ -300,7 +300,7 @@ typedef struct dom0_add_memtype {
  14.204      uint32_t      handle;
  14.205      uint32_t      reg;
  14.206  } dom0_add_memtype_t;
  14.207 -define_guest_handle(dom0_add_memtype_t);
  14.208 +DEFINE_GUEST_HANDLE(dom0_add_memtype_t);
  14.209  
  14.210  /*
  14.211   * Tear down an existing memory-range type. If @handle is remembered then it
  14.212 @@ -315,7 +315,7 @@ typedef struct dom0_del_memtype {
  14.213      uint32_t handle;
  14.214      uint32_t reg;
  14.215  } dom0_del_memtype_t;
  14.216 -define_guest_handle(dom0_del_memtype_t);
  14.217 +DEFINE_GUEST_HANDLE(dom0_del_memtype_t);
  14.218  
  14.219  /* Read current type of an MTRR (x86-specific). */
  14.220  #define DOM0_READ_MEMTYPE        33
  14.221 @@ -327,7 +327,7 @@ typedef struct dom0_read_memtype {
  14.222      unsigned long nr_mfns;
  14.223      uint32_t type;
  14.224  } dom0_read_memtype_t;
  14.225 -define_guest_handle(dom0_read_memtype_t);
  14.226 +DEFINE_GUEST_HANDLE(dom0_read_memtype_t);
  14.227  
  14.228  /* Interface for controlling Xen software performance counters. */
  14.229  #define DOM0_PERFCCONTROL        34
  14.230 @@ -339,23 +339,23 @@ typedef struct dom0_perfc_desc {
  14.231      uint32_t     nr_vals;              /* number of values for this counter */
  14.232      uint32_t     vals[64];             /* array of values */
  14.233  } dom0_perfc_desc_t;
  14.234 -define_guest_handle(dom0_perfc_desc_t);
  14.235 +DEFINE_GUEST_HANDLE(dom0_perfc_desc_t);
  14.236  typedef struct dom0_perfccontrol {
  14.237      /* IN variables. */
  14.238      uint32_t       op;                /*  DOM0_PERFCCONTROL_OP_??? */
  14.239      /* OUT variables. */
  14.240      uint32_t       nr_counters;       /*  number of counters */
  14.241 -    guest_handle(dom0_perfc_desc_t) desc; /*  counter information (or NULL) */
  14.242 +    GUEST_HANDLE(dom0_perfc_desc_t) desc; /*  counter information (or NULL) */
  14.243  } dom0_perfccontrol_t;
  14.244 -define_guest_handle(dom0_perfccontrol_t);
  14.245 +DEFINE_GUEST_HANDLE(dom0_perfccontrol_t);
  14.246  
  14.247  #define DOM0_MICROCODE           35
  14.248  typedef struct dom0_microcode {
  14.249      /* IN variables. */
  14.250 -    guest_handle(void) data;          /* Pointer to microcode data */
  14.251 +    GUEST_HANDLE(void) data;          /* Pointer to microcode data */
  14.252      uint32_t length;                  /* Length of microcode data. */
  14.253  } dom0_microcode_t;
  14.254 -define_guest_handle(dom0_microcode_t);
  14.255 +DEFINE_GUEST_HANDLE(dom0_microcode_t);
  14.256  
  14.257  #define DOM0_IOPORT_PERMISSION   36
  14.258  typedef struct dom0_ioport_permission {
  14.259 @@ -364,7 +364,7 @@ typedef struct dom0_ioport_permission {
  14.260      uint32_t nr_ports;                /* size of port range */
  14.261      uint8_t  allow_access;            /* allow or deny access to range? */
  14.262  } dom0_ioport_permission_t;
  14.263 -define_guest_handle(dom0_ioport_permission_t);
  14.264 +DEFINE_GUEST_HANDLE(dom0_ioport_permission_t);
  14.265  
  14.266  #define DOM0_GETVCPUCONTEXT      37
  14.267  typedef struct dom0_getvcpucontext {
  14.268 @@ -372,9 +372,9 @@ typedef struct dom0_getvcpucontext {
  14.269      domid_t  domain;                  /* domain to be affected */
  14.270      uint32_t vcpu;                    /* vcpu # */
  14.271      /* OUT variables. */
  14.272 -    guest_handle(vcpu_guest_context_t) ctxt;
  14.273 +    GUEST_HANDLE(vcpu_guest_context_t) ctxt;
  14.274  } dom0_getvcpucontext_t;
  14.275 -define_guest_handle(dom0_getvcpucontext_t);
  14.276 +DEFINE_GUEST_HANDLE(dom0_getvcpucontext_t);
  14.277  
  14.278  #define DOM0_GETVCPUINFO         43
  14.279  typedef struct dom0_getvcpuinfo {
  14.280 @@ -389,18 +389,18 @@ typedef struct dom0_getvcpuinfo {
  14.281      uint32_t cpu;                     /* current mapping   */
  14.282      cpumap_t cpumap;                  /* allowable mapping */
  14.283  } dom0_getvcpuinfo_t;
  14.284 -define_guest_handle(dom0_getvcpuinfo_t);
  14.285 +DEFINE_GUEST_HANDLE(dom0_getvcpuinfo_t);
  14.286  
  14.287  #define DOM0_GETDOMAININFOLIST   38
  14.288  typedef struct dom0_getdomaininfolist {
  14.289      /* IN variables. */
  14.290      domid_t               first_domain;
  14.291      uint32_t              max_domains;
  14.292 -    guest_handle(dom0_getdomaininfo_t) buffer;
  14.293 +    GUEST_HANDLE(dom0_getdomaininfo_t) buffer;
  14.294      /* OUT variables. */
  14.295      uint32_t              num_domains;
  14.296  } dom0_getdomaininfolist_t;
  14.297 -define_guest_handle(dom0_getdomaininfolist_t);
  14.298 +DEFINE_GUEST_HANDLE(dom0_getdomaininfolist_t);
  14.299  
  14.300  #define DOM0_PLATFORM_QUIRK      39  
  14.301  #define QUIRK_NOIRQBALANCING  1
  14.302 @@ -408,7 +408,7 @@ typedef struct dom0_platform_quirk {
  14.303      /* IN variables. */
  14.304      uint32_t quirk_id;
  14.305  } dom0_platform_quirk_t;
  14.306 -define_guest_handle(dom0_platform_quirk_t);
  14.307 +DEFINE_GUEST_HANDLE(dom0_platform_quirk_t);
  14.308  
  14.309  #define DOM0_PHYSICAL_MEMORY_MAP 40
  14.310  typedef struct dom0_memory_map_entry {
  14.311 @@ -416,36 +416,36 @@ typedef struct dom0_memory_map_entry {
  14.312      uint32_t flags; /* reserved */
  14.313      uint8_t  is_ram;
  14.314  } dom0_memory_map_entry_t;
  14.315 -define_guest_handle(dom0_memory_map_entry_t);
  14.316 +DEFINE_GUEST_HANDLE(dom0_memory_map_entry_t);
  14.317  typedef struct dom0_physical_memory_map {
  14.318      /* IN variables. */
  14.319      uint32_t max_map_entries;
  14.320      /* OUT variables. */
  14.321      uint32_t nr_map_entries;
  14.322 -    guest_handle(dom0_memory_map_entry_t) memory_map;
  14.323 +    GUEST_HANDLE(dom0_memory_map_entry_t) memory_map;
  14.324  } dom0_physical_memory_map_t;
  14.325 -define_guest_handle(dom0_physical_memory_map_t);
  14.326 +DEFINE_GUEST_HANDLE(dom0_physical_memory_map_t);
  14.327  
  14.328  #define DOM0_MAX_VCPUS 41
  14.329  typedef struct dom0_max_vcpus {
  14.330      domid_t  domain;        /* domain to be affected */
  14.331      uint32_t max;           /* maximum number of vcpus */
  14.332  } dom0_max_vcpus_t;
  14.333 -define_guest_handle(dom0_max_vcpus_t);
  14.334 +DEFINE_GUEST_HANDLE(dom0_max_vcpus_t);
  14.335  
  14.336  #define DOM0_SETDOMAINHANDLE 44
  14.337  typedef struct dom0_setdomainhandle {
  14.338      domid_t domain;
  14.339      xen_domain_handle_t handle;
  14.340  } dom0_setdomainhandle_t;
  14.341 -define_guest_handle(dom0_setdomainhandle_t);
  14.342 +DEFINE_GUEST_HANDLE(dom0_setdomainhandle_t);
  14.343  
  14.344  #define DOM0_SETDEBUGGING 45
  14.345  typedef struct dom0_setdebugging {
  14.346      domid_t domain;
  14.347      uint8_t enable;
  14.348  } dom0_setdebugging_t;
  14.349 -define_guest_handle(dom0_setdebugging_t);
  14.350 +DEFINE_GUEST_HANDLE(dom0_setdebugging_t);
  14.351  
  14.352  #define DOM0_IRQ_PERMISSION 46
  14.353  typedef struct dom0_irq_permission {
  14.354 @@ -453,7 +453,7 @@ typedef struct dom0_irq_permission {
  14.355      uint8_t pirq;
  14.356      uint8_t allow_access;    /* flag to specify enable/disable of IRQ access */
  14.357  } dom0_irq_permission_t;
  14.358 -define_guest_handle(dom0_irq_permission_t);
  14.359 +DEFINE_GUEST_HANDLE(dom0_irq_permission_t);
  14.360  
  14.361  #define DOM0_IOMEM_PERMISSION 47
  14.362  typedef struct dom0_iomem_permission {
  14.363 @@ -462,14 +462,14 @@ typedef struct dom0_iomem_permission {
  14.364      unsigned long nr_mfns;    /* number of pages in range (>0) */
  14.365      uint8_t allow_access;     /* allow (!0) or deny (0) access to range? */
  14.366  } dom0_iomem_permission_t;
  14.367 -define_guest_handle(dom0_iomem_permission_t);
  14.368 +DEFINE_GUEST_HANDLE(dom0_iomem_permission_t);
  14.369   
  14.370  #define DOM0_HYPERCALL_INIT   48
  14.371  typedef struct dom0_hypercall_init {
  14.372      domid_t  domain;          /* domain to be affected */
  14.373      unsigned long mfn;        /* machine frame to be initialised */
  14.374  } dom0_hypercall_init_t;
  14.375 -define_guest_handle(dom0_hypercall_init_t);
  14.376 +DEFINE_GUEST_HANDLE(dom0_hypercall_init_t);
  14.377   
  14.378  typedef struct dom0_op {
  14.379      uint32_t cmd;
  14.380 @@ -515,7 +515,7 @@ typedef struct dom0_op {
  14.381          uint8_t                       pad[128];
  14.382      } u;
  14.383  } dom0_op_t;
  14.384 -define_guest_handle(dom0_op_t);
  14.385 +DEFINE_GUEST_HANDLE(dom0_op_t);
  14.386  
  14.387  #endif /* __XEN_PUBLIC_DOM0_OPS_H__ */
  14.388  
    15.1 --- a/xen/include/public/memory.h	Fri Mar 03 19:07:55 2006 +0100
    15.2 +++ b/xen/include/public/memory.h	Fri Mar 03 19:21:48 2006 +0100
    15.3 @@ -29,7 +29,7 @@ typedef struct xen_memory_reservation {
    15.4       *   OUT: GMFN bases of extents that were allocated
    15.5       *   (NB. This command also updates the mach_to_phys translation table)
    15.6       */
    15.7 -    guest_handle(ulong) extent_start;
    15.8 +    GUEST_HANDLE(ulong) extent_start;
    15.9  
   15.10      /* Number of extents, and size/alignment of each (2^extent_order pages). */
   15.11      unsigned long  nr_extents;
   15.12 @@ -50,7 +50,7 @@ typedef struct xen_memory_reservation {
   15.13      domid_t        domid;
   15.14  
   15.15  } xen_memory_reservation_t;
   15.16 -define_guest_handle(xen_memory_reservation_t);
   15.17 +DEFINE_GUEST_HANDLE(xen_memory_reservation_t);
   15.18  
   15.19  /*
   15.20   * Returns the maximum machine frame number of mapped RAM in this system.
   15.21 @@ -86,7 +86,7 @@ typedef struct xen_machphys_mfn_list {
   15.22       * any large discontiguities in the machine address space, 2MB gaps in
   15.23       * the machphys table will be represented by an MFN base of zero.
   15.24       */
   15.25 -    guest_handle(ulong) extent_start;
   15.26 +    GUEST_HANDLE(ulong) extent_start;
   15.27  
   15.28      /*
   15.29       * Number of extents written to the above array. This will be smaller
   15.30 @@ -94,7 +94,7 @@ typedef struct xen_machphys_mfn_list {
   15.31       */
   15.32      unsigned int nr_extents;
   15.33  } xen_machphys_mfn_list_t;
   15.34 -define_guest_handle(xen_machphys_mfn_list_t);
   15.35 +DEFINE_GUEST_HANDLE(xen_machphys_mfn_list_t);
   15.36  
   15.37  /*
   15.38   * Returns the base and size of the specified reserved 'RAM hole' in the
   15.39 @@ -115,7 +115,7 @@ typedef struct xen_reserved_phys_area {
   15.40      /* Base and size of the specified reserved area. */
   15.41      unsigned long first_gpfn, nr_gpfns;
   15.42  } xen_reserved_phys_area_t;
   15.43 -define_guest_handle(xen_reserved_phys_area_t);
   15.44 +DEFINE_GUEST_HANDLE(xen_reserved_phys_area_t);
   15.45  
   15.46  /*
   15.47   * Translates a list of domain-specific GPFNs into MFNs. Returns a -ve error
   15.48 @@ -130,15 +130,15 @@ typedef struct xen_translate_gpfn_list {
   15.49      unsigned long nr_gpfns;
   15.50  
   15.51      /* List of GPFNs to translate. */
   15.52 -    guest_handle(ulong) gpfn_list;
   15.53 +    GUEST_HANDLE(ulong) gpfn_list;
   15.54  
   15.55      /*
   15.56       * Output list to contain MFN translations. May be the same as the input
   15.57       * list (in which case each input GPFN is overwritten with the output MFN).
   15.58       */
   15.59 -    guest_handle(ulong) mfn_list;
   15.60 +    GUEST_HANDLE(ulong) mfn_list;
   15.61  } xen_translate_gpfn_list_t;
   15.62 -define_guest_handle(xen_translate_gpfn_list_t);
   15.63 +DEFINE_GUEST_HANDLE(xen_translate_gpfn_list_t);
   15.64  
   15.65  #endif /* __XEN_PUBLIC_MEMORY_H__ */
   15.66  
    16.1 --- a/xen/include/public/xen.h	Fri Mar 03 19:07:55 2006 +0100
    16.2 +++ b/xen/include/public/xen.h	Fri Mar 03 19:21:48 2006 +0100
    16.3 @@ -10,25 +10,25 @@
    16.4  #define __XEN_PUBLIC_XEN_H__
    16.5  
    16.6  #ifdef __XEN__
    16.7 -#define __define_guest_handle(name, type) \
    16.8 +#define __DEFINE_GUEST_HANDLE(name, type) \
    16.9      typedef struct { type *p; } __guest_handle_ ## name
   16.10  #else
   16.11 -#define __define_guest_handle(name, type) \
   16.12 +#define __DEFINE_GUEST_HANDLE(name, type) \
   16.13      typedef type * __guest_handle_ ## name
   16.14  #endif
   16.15  
   16.16 -#define define_guest_handle(name) __define_guest_handle(name, name)
   16.17 -#define guest_handle(name)        __guest_handle_ ## name
   16.18 +#define DEFINE_GUEST_HANDLE(name) __DEFINE_GUEST_HANDLE(name, name)
   16.19 +#define GUEST_HANDLE(name)        __guest_handle_ ## name
   16.20  
   16.21  #ifndef __ASSEMBLY__
   16.22  /* Guest handles for primitive C types. */
   16.23 -__define_guest_handle(uchar, unsigned char);
   16.24 -__define_guest_handle(uint,  unsigned int);
   16.25 -__define_guest_handle(ulong, unsigned long);
   16.26 -define_guest_handle(char);
   16.27 -define_guest_handle(int);
   16.28 -define_guest_handle(long);
   16.29 -define_guest_handle(void);
   16.30 +__DEFINE_GUEST_HANDLE(uchar, unsigned char);
   16.31 +__DEFINE_GUEST_HANDLE(uint,  unsigned int);
   16.32 +__DEFINE_GUEST_HANDLE(ulong, unsigned long);
   16.33 +DEFINE_GUEST_HANDLE(char);
   16.34 +DEFINE_GUEST_HANDLE(int);
   16.35 +DEFINE_GUEST_HANDLE(long);
   16.36 +DEFINE_GUEST_HANDLE(void);
   16.37  #endif
   16.38  
   16.39  #if defined(__i386__)
    17.1 --- a/xen/include/xen/console.h	Fri Mar 03 19:07:55 2006 +0100
    17.2 +++ b/xen/include/xen/console.h	Fri Mar 03 19:21:48 2006 +0100
    17.3 @@ -13,7 +13,7 @@ extern spinlock_t console_lock;
    17.4  
    17.5  void set_printk_prefix(const char *prefix);
    17.6  
    17.7 -long read_console_ring(guest_handle(char), u32 *, int);
    17.8 +long read_console_ring(GUEST_HANDLE(char), u32 *, int);
    17.9  
   17.10  void init_console(void);
   17.11  void console_endboot(int disable_vga);
    18.1 --- a/xen/include/xen/guest_access.h	Fri Mar 03 19:07:55 2006 +0100
    18.2 +++ b/xen/include/xen/guest_access.h	Fri Mar 03 19:21:48 2006 +0100
    18.3 @@ -18,7 +18,7 @@
    18.4  /* Cast a guest handle to the specified type of handle. */
    18.5  #define guest_handle_cast(hnd, type) ({         \
    18.6      type *_x = (hnd).p;                         \
    18.7 -    (guest_handle(type)) { _x };                \
    18.8 +    (GUEST_HANDLE(type)) { _x };                \
    18.9  })
   18.10  
   18.11  /*
    19.1 --- a/xen/include/xen/sched.h	Fri Mar 03 19:07:55 2006 +0100
    19.2 +++ b/xen/include/xen/sched.h	Fri Mar 03 19:21:48 2006 +0100
    19.3 @@ -311,7 +311,7 @@ void startup_cpu_idle_loop(void);
    19.4   *  'i' [unsigned] {char, int}
    19.5   *  'l' [unsigned] long
    19.6   *  'p' pointer (foo *)
    19.7 - *  'h' guest handle (guest_handle(foo))
    19.8 + *  'h' guest handle (GUEST_HANDLE(foo))
    19.9   */
   19.10  unsigned long hypercall_create_continuation(
   19.11      unsigned int op, const char *format, ...);