Skip to contentSkip to conversation

public header: portability

PATCH In review Christoph Egger 2 participants 3 messages Aug 21, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 public header: portability

Hi!

Attached patch defines xen_*mb() macros for NetBSD.

Signature · 12 lines
AMD Saxony, Dresden, Germany
Operating System Research Center

Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
   Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
   AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
   Dr. Hans-R. Deppe, Thomas McCoy
xen/include/public/io/ring.h +7 -0
diff -r 598d92a5ae7a xen/include/public/io/ring.h
@@ -30,9 +30,16 @@
 #include "../xen-compat.h"
 
 #if __XEN_INTERFACE_VERSION__ < 0x00030208
+#if defined(__Linux__)
 #define xen_mb()  mb()
 #define xen_rmb() rmb()
 #define xen_wmb() wmb()
+#endif
+#if defined(__NetBSD__)
+#define xen_mb()  x86_mfence()
+#define xen_rmb() x86_lfence()
+#define xen_wmb() x86_sfence()
+#endif
 #endif
 
 typedef unsigned int RING_IDX;

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 3 lines · Christoph Egger

Attached patch defines xen_*mb() macros for NetBSD.

Since this has presumably never worked unmodified for NetBSD, it's not a compatibility issue. You should simply specify __XEN_INTERFACE_VERSION__ >= 0x00030208 and fix up any small build breakages that this causes in the NetBSD kernel sources.

-- Keir

#2 lore raw
Quoted 10 lines · Keir Fraser
Quoted 3 lines · Christoph Egger

Attached patch defines xen_*mb() macros for NetBSD.

Since this has presumably never worked unmodified for NetBSD, it's not a compatibility issue. You should simply specify __XEN_INTERFACE_VERSION__ >= 0x00030208 and fix up any small build breakages that this causes in the NetBSD kernel sources.

Actually I suspect you're not specifying __XEN_INTERFACE_VERSION__ at all right now. The easiest way to do so is to add it to your CPPFLAGS (-D__XEN_INTERFACE_VERSION__=<whatever>), or NetBSD build system equivalent, then it definitely gets defined correctly everywhere that you include Xen public header files.

-- Keir