diff -Nuarp xen-unstable.orig/tools/blktap/blktaplib.h xen-unstable/tools/blktap/blktaplib.h --- xen-unstable.orig/tools/blktap/blktaplib.h 2005-03-01 22:50:19.499166000 -0500 +++ xen-unstable/tools/blktap/blktaplib.h 2005-03-01 23:07:52.849166000 -0500 @@ -8,24 +8,7 @@ #ifndef __BLKTAPLIB_H__ #define __BLKTAPLIB_H__ -#include - -typedef uint8_t u8; -typedef uint16_t u16; -typedef uint32_t u32; -typedef uint64_t u64; -typedef int8_t s8; -typedef int16_t s16; -typedef int32_t s32; -typedef int64_t s64; - -#if defined(__i386__) -#define rmb() __asm__ __volatile__ ( "lock; addl $0,0(%%esp)" : : : "memory" ) -#define wmb() __asm__ __volatile__ ( "" : : : "memory" ) -#else -#error "Define barriers" -#endif - +#include #include #include #include diff -Nuarp xen-unstable.orig/tools/libxc/xc.h xen-unstable/tools/libxc/xc.h --- xen-unstable.orig/tools/libxc/xc.h 2005-03-01 22:50:19.499166000 -0500 +++ xen-unstable/tools/libxc/xc.h 2005-03-01 23:07:14.069166000 -0500 @@ -25,6 +25,21 @@ typedef int64_t s64; #include #include + +/*\ + * DEFINITIONS FOR CPU BARRIERS +\*/ +#if defined(__i386__) +#define rmb() __asm__ __volatile__ ( "lock; addl $0,0(%%esp)" : : : "memory" ) +#define wmb() __asm__ __volatile__ ( "" : : : "memory" ) +#elif defined(__x86_64__) +#define mb() __asm__ __volatile__ ( "mfence" : : : "memory" ) +#define rmb() __asm__ __volatile__ ( "lfence" : : : "memory" ) +#define wmb() __asm__ __volatile__ ( "sfence" : : : "memory" ) +#else +#error "Define barriers" +#endif + /*\ * INITIALIZATION FUNCTIONS \*/ diff -Nuarp xen-unstable.orig/tools/python/xen/lowlevel/xu/xu.c xen-unstable/tools/python/xen/lowlevel/xu/xu.c --- xen-unstable.orig/tools/python/xen/lowlevel/xu/xu.c 2005-03-01 22:50:19.519166000 -0500 +++ xen-unstable/tools/python/xen/lowlevel/xu/xu.c 2005-03-01 23:07:14.069166000 -0500 @@ -49,14 +49,6 @@ /* Size of a machine page frame. */ #define PAGE_SIZE 4096 -#if defined(__i386__) -#define rmb() __asm__ __volatile__ ( "lock; addl $0,0(%%esp)" : : : "memory" ) -#define wmb() __asm__ __volatile__ ( "" : : : "memory" ) -#else -#error "Define barriers" -#endif - - /* Set the close-on-exec flag on a file descriptor. Doesn't currently bother * to check for errors. */ /* diff -Nuarp xen-unstable.orig/tools/xcs/xcs.h xen-unstable/tools/xcs/xcs.h --- xen-unstable.orig/tools/xcs/xcs.h 2005-03-01 22:50:19.499166000 -0500 +++ xen-unstable/tools/xcs/xcs.h 2005-03-01 23:07:14.069166000 -0500 @@ -39,13 +39,6 @@ /* Size of a machine page frame. */ #define PAGE_SIZE 4096 -#if defined(__i386__) -#define rmb() __asm__ __volatile__ ( "lock; addl $0,0(%%esp)" : : : "memory" ) -#define wmb() __asm__ __volatile__ ( "" : : : "memory" ) -#else -#error "Define barriers" -#endif - #ifndef timersub /* XOPEN and __BSD don't cooperate well... */ #define timersub(a, b, result) \ do { \