Index: compiler.h =================================================================== RCS file: /cvsroot/xsrc/xfree/xc/programs/Xserver/hw/xfree86/common/compiler.h,v retrieving revision 1.20 diff -u -r1.20 compiler.h --- compiler.h 8 Apr 2005 20:56:22 -0000 1.20 +++ compiler.h 1 Oct 2006 15:19:38 -0000 @@ -1357,8 +1357,15 @@ # define stq_u(v,p) (*(unsigned long *)(p)) = (v) # define stl_u(v,p) (*(unsigned int *)(p)) = (v) # define stw_u(v,p) (*(unsigned short *)(p)) = (v) -# define mem_barrier() /* NOP */ -# define write_mem_barrier() /* NOP */ +# if defined(__NetBSD__) && defined(__amd64__) +# define mem_barrier() \ + __asm__ __volatile__ ("lock; addl $0,0(%%rsp)": : :"memory") +# define write_mem_barrier() \ + __asm__ __volatile__ ("": : :"memory") +# else +# define mem_barrier() /* NOP */ +# define write_mem_barrier() /* NOP */ +# endif # if !defined(__SUNPRO_C) # if !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__)