eal/linux: fix illegal memory access in uevent handler
[dpdk.git] / lib / eal / include / rte_common.h
index 99eb5f1..4a399cc 100644 (file)
@@ -778,6 +778,14 @@ rte_log2_u64(uint64_t v)
                })
 #endif
 
+/** Swap two variables. */
+#define RTE_SWAP(a, b) \
+       __extension__ ({ \
+               typeof (a) _a = a; \
+               a = b; \
+               b = _a; \
+       })
+
 /**
  * Get the size of a field in a structure.
  *