From cb900b45e80ea751ebdf2f151d87f30d84febb1a Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 17 Jan 2022 13:01:57 -0500 Subject: [PATCH] Fix: membarrier flags for kernels headers < 5.10 Signed-off-by: Mathieu Desnoyers Change-Id: I0c31e77a97d62140f162e058a975d47c849c5782 --- tests/param_test.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/param_test.c b/tests/param_test.c index 68a34dc..e71e92c 100644 --- a/tests/param_test.c +++ b/tests/param_test.c @@ -3,6 +3,7 @@ #define _GNU_SOURCE #endif #include +#include #include #include #include @@ -18,6 +19,17 @@ #include #include +#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]; -- 2.34.1