direct-io.hg

diff tools/libxc/xc.h @ 3961:a19f7bbbe144

bitkeeper revision 1.1236.1.44 (4224f156AyEV3oV5JinuYtfS9e_ITA)

Rationalise memory-barrier definitions in user-space tools.
Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@scramble.cl.cam.ac.uk
date Tue Mar 01 22:48:54 2005 +0000 (2005-03-01)
parents 0a4b76b6b5a0
children 24703bde489b 0b9ff7354a95
line diff
     1.1 --- a/tools/libxc/xc.h	Tue Mar 01 20:47:20 2005 +0000
     1.2 +++ b/tools/libxc/xc.h	Tue Mar 01 22:48:54 2005 +0000
     1.3 @@ -25,9 +25,25 @@ typedef int64_t            s64;
     1.4  #include <xen/event_channel.h>
     1.5  #include <xen/sched_ctl.h>
     1.6  
     1.7 -/*\
     1.8 +
     1.9 +/*
    1.10 + *  DEFINITIONS FOR CPU BARRIERS
    1.11 + */ 
    1.12 +
    1.13 +#if defined(__i386__)
    1.14 +#define rmb() __asm__ __volatile__ ("lock; addl $0,0(%%esp)" : : : "memory")
    1.15 +#define wmb() __asm__ __volatile__ ("" : : : "memory")
    1.16 +#elif defined(__x86_64__)
    1.17 +#define mb()     asm volatile("mfence":::"memory")
    1.18 +#define rmb()    asm volatile("lfence":::"memory")
    1.19 +#define wmb()    asm volatile( "" :::"memory")
    1.20 +#else
    1.21 +#error "Define barriers"
    1.22 +#endif
    1.23 +
    1.24 +/*
    1.25   *  INITIALIZATION FUNCTIONS
    1.26 -\*/ 
    1.27 + */ 
    1.28  
    1.29  /**
    1.30   * This function opens a handle to the hypervisor interface.  This function can
    1.31 @@ -55,9 +71,9 @@ int xc_interface_open(void);
    1.32   */
    1.33  int xc_interface_close(int xc_handle);
    1.34  
    1.35 -/*\
    1.36 +/*
    1.37   * DOMAIN MANAGEMENT FUNCTIONS
    1.38 -\*/
    1.39 + */
    1.40  
    1.41  typedef struct {
    1.42      u32           domid;
    1.43 @@ -257,9 +273,9 @@ int xc_rrobin_global_get(int xc_handle, 
    1.44  
    1.45  typedef evtchn_status_t xc_evtchn_status_t;
    1.46  
    1.47 -/*\
    1.48 +/*
    1.49   * EVENT CHANNEL FUNCTIONS
    1.50 -\*/
    1.51 + */
    1.52  
    1.53  /**
    1.54   * This function allocates an unbound port.  Ports are named endpoints used for