Skip to contentSkip to conversation

PV-on-HVM: Define atomic_cmpxchg() for old Linux kernels.

PATCH New KUWAMURA Shin'ya 1 participant 1 message May 22, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PV-on-HVM: Define atomic_cmpxchg() for old Linux kernels.

Hi,

Building PV-on-HVM drivers for RHEL4U2 failed:
/ia64/xen-unstable.hg/unmodified_drivers/linux-2.6/platform-pci/../xenbus/xenbus_comms.c:81: warning: implicit declaration of function `atomic_cmpxchg'

This patch fixes it.

Best regards,

Signature · 1 line
  KUWAMURA Shin'ya

# HG changeset patch
# User KUWAMURA Shin'ya <[email protected]>
# Date 1242892488 -32400
# Node ID 21aa4b4ac479051c2b8e5c2582844ec6b5c4fb47 # Parent 145e49b8574c8da3a72932a57c076227d38fee60
PV-on-HVM: Define atomic_cmpxchg() for old Linux kernels.

unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h +4 -0
diff -r 145e49b8574c -r 21aa4b4ac479 unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h
@@ -157,4 +157,8 @@ typedef irqreturn_t (*irq_handler_t)(int
 #define setup_xen_features xen_setup_features
 #endif
 
+#ifndef atomic_cmpxchg
+#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new)))
 #endif
+
+#endif

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