Fix: membarrier flags for kernels headers < 5.10
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 17 Jan 2022 18:01:57 +0000 (13:01 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 17 Jan 2022 18:01:57 +0000 (13:01 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I0c31e77a97d62140f162e058a975d47c849c5782

tests/param_test.c

index 68a34dc077157612ff2fdd5c878d4e99ff43e0f6..e71e92c82b1b39e00c720a618f98c7b1219cae53 100644 (file)
@@ -3,6 +3,7 @@
 #define _GNU_SOURCE
 #endif
 #include <assert.h>
+#include <linux/version.h>
 #include <linux/membarrier.h>
 #include <pthread.h>
 #include <sched.h>
 #include <errno.h>
 #include <stddef.h>
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0)
+enum {
+       MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ                   = (1 << 7),
+       MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ          = (1 << 8),
+};
+
+enum {
+       MEMBARRIER_CMD_FLAG_CPU         = (1 << 0),
+};
+#endif
+
 #define NR_INJECT      9
 static int loop_cnt[NR_INJECT + 1];
 
This page took 0.035642 seconds and 4 git commands to generate.