From: Julien Grall Date: Thu, 15 Oct 2015 17:10:15 +0000 (+0100) Subject: xen: replace barrier by __compiler_membar X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=46bb8cb06523023c96d6b6d873c73d3efed31639;p=people%2Fjulieng%2Ffreebsd.git xen: replace barrier by __compiler_membar --- diff --git a/sys/x86/include/xen/xen-os.h b/sys/x86/include/xen/xen-os.h index dc1ad682e7db..b313a139b1b1 100644 --- a/sys/x86/include/xen/xen-os.h +++ b/sys/x86/include/xen/xen-os.h @@ -40,9 +40,6 @@ static inline void rep_nop(void) } #define cpu_relax() rep_nop() -/* This is a barrier for the compiler only, NOT the processor! */ -#define barrier() __asm__ __volatile__("": : :"memory") - #endif /* !__ASSEMBLY__ */ #endif /* _MACHINE_X86_XEN_XEN_OS_H_ */ diff --git a/sys/xen/blkif.h b/sys/xen/blkif.h index 8a19d5d01d87..721bb93c3c48 100644 --- a/sys/xen/blkif.h +++ b/sys/xen/blkif.h @@ -120,7 +120,7 @@ static void inline blkif_get_x86_32_req(blkif_request_t *dst, blkif_x86_32_reque dst->handle = src->handle; dst->id = src->id; dst->sector_number = src->sector_number; - barrier(); + __compiler_membar(); if (n > dst->nr_segments) n = dst->nr_segments; for (i = 0; i < n; i++) @@ -135,7 +135,7 @@ static void inline blkif_get_x86_64_req(blkif_request_t *dst, blkif_x86_64_reque dst->handle = src->handle; dst->id = src->id; dst->sector_number = src->sector_number; - barrier(); + __compiler_membar(); if (n > dst->nr_segments) n = dst->nr_segments; for (i = 0; i < n; i++)