Those macros where introduced when a prefix "xen_" was added to
mb,rmb,wmb. There are gated on __XEN_INTERFACE_VERSION__, but there
are not part of the Xen interface. Users of ring.h needs to provide
xen_[rw]?mb() anywai because [rw]?mb() isn't likely to exist.

Suggested-by: Paul Durrant <paul.durr...@citrix.com>
Signed-off-by: Anthony PERARD <anthony.per...@citrix.com>
---
 xen/include/public/io/ring.h | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/xen/include/public/io/ring.h b/xen/include/public/io/ring.h
index c5d53e3103..5610ae14f8 100644
--- a/xen/include/public/io/ring.h
+++ b/xen/include/public/io/ring.h
@@ -33,6 +33,13 @@
  * - standard integers types (uint8_t, uint16_t, etc)
  * They are provided by stdint.h of the standard headers.
  *
+ * Before using the different macros, you need to provide the following
+ * macros:
+ * - xen_mb()  a memory barrier
+ * - xen_rmb() a read memory barrier
+ * - xen_wmb() a write memory barrier
+ * Example of those can be found in xenctrl.h.
+ *
  * In addition, if you intend to use the FLEX macros, you also need to
  * provide the following, before invoking the FLEX macros:
  * - size_t
@@ -42,14 +49,6 @@
  * and grant_table.h from the Xen public headers.
  */
 
-#include "../xen-compat.h"
-
-#if __XEN_INTERFACE_VERSION__ < 0x00030208
-#define xen_mb()  mb()
-#define xen_rmb() rmb()
-#define xen_wmb() wmb()
-#endif
-
 typedef unsigned int RING_IDX;
 
 /* Round a 32-bit unsigned constant down to the nearest power of two. */
-- 
Anthony PERARD


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to